/* Layout and Utility Styles */

/* Utility class for fading image edges */
.image-fade-edges {
    position: relative;
    overflow: hidden;
}

.image-fade-edges::before,
.image-fade-edges::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    z-index: 2;
}

.image-fade-edges::before {
    left: 0;
    background: linear-gradient(to right, 
        var(--bg-primary) 0%, 
        rgba(30, 30, 30, 0.8) 30%, 
        transparent 100%);
}

.image-fade-edges::after {
    right: 0;
    background: linear-gradient(to left, 
        var(--bg-primary) 0%, 
        rgba(30, 30, 30, 0.8) 30%, 
        transparent 100%);
}

/* Variant for container backgrounds */
.container-fade-edges {
    position: relative;
}

.container-fade-edges::before,
.container-fade-edges::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    pointer-events: none;
    z-index: 10;
}

.container-fade-edges::before {
    left: -80px;
    background: linear-gradient(to right, 
        var(--bg-primary) 0%, 
        rgba(30, 30, 30, 0.9) 40%, 
        rgba(30, 30, 30, 0.3) 80%, 
        transparent 100%);
}

.container-fade-edges::after {
    right: -80px;
    background: linear-gradient(to left, 
        var(--bg-primary) 0%, 
        rgba(30, 30, 30, 0.9) 40%, 
        rgba(30, 30, 30, 0.3) 80%, 
        transparent 100%);
}

/* Banner specific fade effect */
.banner-fade-edges {
    position: relative;
    overflow: hidden;
}

.banner-fade-edges::before,
.banner-fade-edges::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    pointer-events: none;
    z-index: 1;
}

.banner-fade-edges::before {
    left: 0;
    background: linear-gradient(to right, 
        #1e1e1e 0%, 
        rgba(30, 30, 30, 0.95) 20%, 
        rgba(30, 30, 30, 0.7) 50%, 
        rgba(30, 30, 30, 0.3) 80%, 
        transparent 100%);
}

.banner-fade-edges::after {
    right: 0;
    background: linear-gradient(to left, 
        #1e1e1e 0%, 
        rgba(30, 30, 30, 0.95) 20%, 
        rgba(30, 30, 30, 0.7) 50%, 
        rgba(30, 30, 30, 0.3) 80%, 
        transparent 100%);
}

/* Background image fade effect */
.bg-fade-edges {
    position: relative;
}

.bg-fade-edges::before,
.bg-fade-edges::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    pointer-events: none;
    z-index: 1;
}

.bg-fade-edges::before {
    left: 0;
    background: linear-gradient(to right, 
        var(--bg-primary) 0%, 
        rgba(30, 30, 30, 0.95) 15%, 
        rgba(30, 30, 30, 0.8) 40%, 
        rgba(30, 30, 30, 0.4) 70%, 
        transparent 100%);
}

.bg-fade-edges::after {
    right: 0;
    background: linear-gradient(to left, 
        var(--bg-primary) 0%, 
        rgba(30, 30, 30, 0.95) 15%, 
        rgba(30, 30, 30, 0.8) 40%, 
        rgba(30, 30, 30, 0.4) 70%, 
        transparent 100%);
}

/* Soft fade for subtle effect */
.soft-fade-edges {
    position: relative;
}

.soft-fade-edges::before,
.soft-fade-edges::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 1;
}

.soft-fade-edges::before {
    left: 0;
    background: linear-gradient(to right, 
        rgba(30, 30, 30, 0.6) 0%, 
        rgba(30, 30, 30, 0.3) 50%, 
        transparent 100%);
}

.soft-fade-edges::after {
    right: 0;
    background: linear-gradient(to left, 
        rgba(30, 30, 30, 0.6) 0%, 
        rgba(30, 30, 30, 0.3) 50%, 
        transparent 100%);
}

/* Container with fade effect for background images */
.container-with-fade {
    position: relative;
    overflow: visible;
}

.container-with-fade .row,
.container-with-fade .col,
.container-with-fade .col-12,
.container-with-fade .col-md-12,
.container-with-fade .banner-content {
    position: relative;
    z-index: 2;
}

.container-with-fade::before,
.container-with-fade::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    pointer-events: none;
    z-index: 1;
}

.container-with-fade::before {
    left: -150px;
    background: linear-gradient(to right, 
        #1e1e1e 0%, 
        rgba(30, 30, 30, 0.98) 20%, 
        rgba(30, 30, 30, 0.9) 40%, 
        rgba(30, 30, 30, 0.6) 70%, 
        rgba(30, 30, 30, 0.2) 90%, 
        transparent 100%);
}

.container-with-fade::after {
    right: -150px;
    background: linear-gradient(to left, 
        #1e1e1e 0%, 
        rgba(30, 30, 30, 0.98) 20%, 
        rgba(30, 30, 30, 0.9) 40%, 
        rgba(30, 30, 30, 0.6) 70%, 
        rgba(30, 30, 30, 0.2) 90%, 
        transparent 100%);
}

/* Body and Global Styles */
body {
    font-family: 'Work Sans', Arial, sans-serif;
    background: var(--clr-base-900);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
}

/* Pattern overlay for texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.02) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none !important;
}

.navbar-brand:hover {
    text-decoration: none !important;
}

/* Custom Navbar Styling */
.custom-navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    border-bottom: 2px solid #444;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.custom-navbar .navbar-brand {
    color: #fff !important;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}

.custom-navbar .navbar-brand img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: all 0.3s ease;
}

.custom-navbar .navbar-brand:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.7));
}

.custom-navbar .navbar-nav {
    height: 100%;
}

.custom-navbar .nav-item {
    height: 100%;
    display: flex;
    align-items: stretch;
}

.custom-navbar .nav-link {
    color: #999 !important;
    font-weight: 500;
    padding: 1.5rem 1.2rem !important;
    margin: 0;
    border-radius: 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    height: 100%;
    border-bottom: 3px solid transparent;
    text-decoration: none !important;
}

.custom-navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
    transform: none;
    text-decoration: none !important;
}

.custom-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.custom-navbar .dropdown-menu {
    background: #2d2d2d;
    border: 1px solid #444;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-radius: 2px;
    margin-top: 0.5rem;
}

.custom-navbar .dropdown-item {
    color: #999;
    padding: 0.7rem 1.2rem;
    transition: all 0.3s ease;
}

.custom-navbar .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.custom-navbar .dropdown-divider {
    border-color: #444;
}

/* Dropdown Submenu */
.custom-navbar .dropdown-submenu {
    position: relative;
}

.custom-navbar .dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
}

.custom-navbar .dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.custom-navbar .dropdown-submenu > .dropdown-item {
    position: relative;
    padding-right: 2rem;
}

.custom-navbar .dropdown-submenu > .dropdown-item::after {
    content: "\f285";
    font-family: "bootstrap-icons";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Mobile: submenu opens below instead of side */
@media (max-width: 991.98px) {
    .custom-navbar .dropdown-submenu > .dropdown-menu {
        position: static;
        float: none;
        margin-left: 1rem;
        border: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        margin-top: 0.5rem;
    }
    
    .custom-navbar .dropdown-submenu > .dropdown-item::after {
        content: "\f282";
        transform: translateY(-50%) rotate(0deg);
    }
    
    .custom-navbar .dropdown-submenu.show > .dropdown-item::after {
        transform: translateY(-50%) rotate(180deg);
    }
}

.auth-buttons .nav-item {
    display: flex;
    align-items: stretch;
    margin: 0 0.2rem;
    height: 100%;
}

.auth-buttons .nav-link {
    background: transparent !important;
    border: none;
    border-radius: 0;
    padding: 1.5rem 1.5rem !important;
    display: flex;
    align-items: center;
    margin: 0;
    height: 100%;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.auth-buttons .nav-link.login-btn {
    color: #999 !important;
    font-weight: 500;
    text-decoration: none !important;
}

.auth-buttons .nav-link.login-btn:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.auth-buttons .nav-link.register-btn {
    background: linear-gradient(45deg, #e55a2b, #d4491e) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.auth-buttons .nav-link.register-btn:hover {
    background: linear-gradient(45deg, #d4491e, #bf3f1a) !important;
    transform: none;
    text-decoration: none !important;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Dark theme styling */
.footer {
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 50%, #0a0a0a 100%);
    color: #666;
    padding: 3rem 0 0 0;
    margin-top: auto;
    border-top: 2px solid #333;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff6b35, transparent);
}

.footer h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer h6 {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer h6::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #ff6b35;
}

.footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

.footer .list-unstyled a {
    color: #666;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer .list-unstyled a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer .social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.3s ease;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
}

.footer .social-icon.facebook {
    background: #1565c0;
}

.footer .social-icon.facebook:hover {
    background: #1043a3;
    transform: translateY(-2px);
    color: #fff;
}

.footer .social-icon.reddit {
    background: #d84315;
}

.footer .social-icon.reddit:hover {
    background: #bf360c;
    transform: translateY(-2px);
    color: #fff;
}

.footer .social-icon.discord {
    background: #4752c4;
}

.footer .social-icon.discord:hover {
    background: #3742a6;
    transform: translateY(-2px);
    color: #fff;
}

.footer .social-icon.youtube {
    background: #c62828;
}

.footer .social-icon.youtube:hover {
    background: #ad2323;
    transform: translateY(-2px);
    color: #fff;
}

.footer .btn-outline-light {
    border-radius: 2px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.footer .btn-outline-light:hover {
    background: #ff6b35;
    border-color: #ff6b35;
    transform: translateY(-2px);
}

.footer-bottom {
    background: var(--clr-base-900);
    border-top: 1px solid #222;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.time-display {
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    min-width: 140px;
    text-align: center;
}

.time-label {
    font-size: 0.7rem;
    color: #666;
    display: block;
    margin-bottom: 0.2rem;
}

.time-value {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

.game-card, .card {
    background: var(--bg-secondary);
    border: 1px solid #404040;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.game-card:hover, .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border-color: #555;
}

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid #404040;
    color: var(--text-primary);
    border-radius: 2px 2px 0 0;
}

.card-body {
    background: var(--bg-secondary);
    border-radius: 0 0 2px 2px;
}

/* Alert styling for dark theme */
.alert {
    border: none;
    border-radius: 2px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Page header styling */
.page-header-dark {
    background: var(--bg-secondary);
    border-bottom: 1px solid #404040;
    color: var(--text-primary);
}

/* Button styling */
.btn-primary {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
    text-decoration: none !important;
    letter-spacing: normal !important;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5b61f0, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    text-decoration: none !important;
    color: white !important;
}

.btn-outline-primary {
    border-color: #6366f1;
    color: #6366f1;
    border-radius: 2px;
    text-decoration: none !important;
    letter-spacing: normal !important;
}

.btn-outline-primary:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
    text-decoration: none !important;
}

/* Global button radius override */
.btn {
    border-radius: 2px;
    text-decoration: none !important;
    letter-spacing: normal !important;
}

/* Text colors */
.text-muted {
    color: var(--text-muted) !important;
}

/* Form styling */
.form-control {
    background: var(--bg-tertiary);
    border: 1px solid #404040;
    color: var(--text-primary);
    border-radius: 2px;
}

.form-control:focus {
    background: var(--bg-tertiary);
    border-color: #6366f1;
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Custom Breadcrumb Styling */
.custom-breadcrumb {
    background: var(--bg-secondary);
    border: 1px solid rgba(44, 44, 48, 0.25);
    border-radius: 2px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.custom-breadcrumb .breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
    font-size: 0.9rem;
}

.custom-breadcrumb .breadcrumb-item {
    color: var(--text-secondary);
}

.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: #666;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0 0.5rem;
}

.custom-breadcrumb .breadcrumb-item a {
    color: #8b5cf6;
    text-decoration: none;
    transition: all 0.3s ease;
}

.custom-breadcrumb .breadcrumb-item a:hover {
    color: #a855f7;
    text-decoration: underline;
}

.custom-breadcrumb .breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.custom-breadcrumb .breadcrumb-item i {
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

/* Breadcrumb with icon home */
.breadcrumb-home .breadcrumb-item:first-child::before {
    content: '';
    margin: 0;
}

/* Table styling */
.table-dark {
    --bs-table-bg: var(--bg-secondary);
    --bs-table-border-color: #404040;
}

/* Dropdown improvements */
.dropdown-menu-dark {
    background-color: var(--bg-secondary);
    border-color: #404040;
}

.dropdown-item {
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Bootstrap Fixes and Overrides */

/* Remove default Bootstrap link underlines */
a, .nav-link, .btn, .dropdown-item {
    text-decoration: none !important;
}

a:hover, .nav-link:hover, .dropdown-item:hover {
    text-decoration: none !important;
}

/* Fix Bootstrap button text decoration */
.btn:focus, .btn:hover, .btn:active {
    text-decoration: none !important;
    outline: none !important;
}

/* Remove letter spacing from Bootstrap components that inherit it */
.btn, .form-control, .dropdown-item, .alert {
    letter-spacing: normal !important;
}

/* Fix Bootstrap link styles in footer */
.footer a:hover {
    text-decoration: none !important;
}

/* Ensure breadcrumb links don't get underlined */
.breadcrumb-item a:hover {
    text-decoration: underline !important; /* Keep this one for breadcrumbs */
}

/* Fix Bootstrap navbar toggler focus */
.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Remove Bootstrap focus outlines that conflict with dark theme */
.btn:focus, .form-control:focus, .nav-link:focus {
    outline: none !important;
}

/* Fix Bootstrap card link styling */
.card a {
    text-decoration: none !important;
}

.card a:hover {
    text-decoration: none !important;
}

/* Override Bootstrap's default focus styles */
.form-control:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

/* Fix Bootstrap alert link colors */
.alert a {
    color: inherit !important;
    text-decoration: underline !important;
}

.alert a:hover {
    opacity: 0.8;
    text-decoration: underline !important;
}

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
