/* --- GLOBAL VARIABLES --- */
:root {
    --acc-red: #ff3b3b;
    --acc-dark: #0f0f0f;
    --acc-card-bg: rgba(30, 30, 30, 0.85);
    --acc-text: #e0e0e0;
    --acc-cyan: #00f0ff;
    --acc-border: rgba(255, 255, 255, 0.1);
    
    --glass-bg: rgba(18, 18, 18, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --nav-height: 70px;
    
    --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --bs-body-bg: #050505;
}

/* --- BASE STYLES --- */
body { 
    background-color: var(--bs-body-bg);
    background-image: 
        radial-gradient(circle at 50% 0%, #1a1a1a 0%, transparent 70%),
        linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0.9)),
        url("https://www.transparenttextures.com/patterns/carbon-fibre.png");
    color: var(--acc-text);
    font-family: var(--bs-body-font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* padding-top is handled inline in HTML for debug mode logic */
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .badge, .stats-number {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

a { text-decoration: none; color: var(--acc-text); transition: all 0.2s ease; }
a:hover { color: var(--acc-red); }

/* --- MODERN NAVBAR --- */
.glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    height: var(--nav-height);
    transition: all 0.3s ease;
    /* top positioning handled inline for debug mode */
}

.glass-nav.scrolled {
    background: rgba(10, 10, 10, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand .leading-tight {
    line-height: 1;
    letter-spacing: 1.5px;
    font-size: 1.4rem;
}

/* Nav Links */
.navbar-nav .nav-link {
    font-family: 'Rajdhani', sans-serif;
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Active Indicator */
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--acc-red);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 8px var(--acc-red);
    opacity: 0;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
    opacity: 1;
}

/* --- UI ELEMENTS --- */

/* Glass Cards */
.card { 
    background-color: var(--acc-card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--acc-border);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, border-color 0.2s;
}

/* Tables */
.table { 
    color: #ccc; 
    border-collapse: separate; 
    border-spacing: 0 4px; 
}
.table thead th {
    background-color: transparent;
    border-bottom: 2px solid var(--acc-border);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #888;
    font-family: 'Rajdhani', sans-serif;
}
.table tbody tr {
    background-color: rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s;
}
.table-hover tbody tr:hover { 
    background-color: rgba(255, 59, 59, 0.1) !important;
    color: #fff;
}
.table td {
    border: none;
    vertical-align: middle;
    padding: 12px 15px;
}

/* Badges & Text */
.badge {
    font-weight: 600;
    border-radius: 2px;
}
.lap-time { 
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--acc-cyan); 
}

/* Buttons & Forms */
.btn-outline-acc {
    border-color: var(--acc-red);
    color: var(--acc-red);
}
.btn-outline-acc:hover {
    background-color: var(--acc-red);
    color: white;
}

.search-form .input-group {
    width: 220px;
    transition: width 0.3s ease;
    background-color: rgba(0, 0, 0, 0.3) !important;
}
.search-form .input-group:focus-within {
    width: 280px;
    background-color: rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}
.search-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* Dropdowns */
.bg-dark-glass {
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
}
.dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}
.dropdown-toggle-no-arrow::after { display: none; }

/* Icon Buttons */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}
.btn-icon:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Hamburger Animation */
.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    cursor: pointer;
}
.hamburger-icon span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}
.hamburger-icon span:nth-child(1) { top: 0px; }
.hamburger-icon span:nth-child(2) { top: 8px; }
.hamburger-icon span:nth-child(3) { top: 16px; }

button[aria-expanded="true"] .hamburger-icon span:nth-child(1) { top: 8px; transform: rotate(135deg); }
button[aria-expanded="true"] .hamburger-icon span:nth-child(2) { opacity: 0; left: -60px; }
button[aria-expanded="true"] .hamburger-icon span:nth-child(3) { top: 8px; transform: rotate(-135deg); }
.focus-none:focus { box-shadow: none !important; }

/* Dev Banner */
.dev-warning-banner {
    position: fixed; top: 0; left: 0; width: 100%; height: 35px;
    background: repeating-linear-gradient(45deg, #dc3545, #dc3545 10px, #b02a37 10px, #b02a37 20px);
    color: white; text-align: center; font-weight: bold; font-size: 0.9rem;
    line-height: 35px; z-index: 9999;
    text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid #ff5b6b;
}

/* Discord Widget */
#discord-widget-container {
    position: fixed; bottom: 80px; right: 20px; z-index: 1000;
    display: none; box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border-radius: 8px; overflow: hidden; border: 1px solid #7289da;
    background-color: #2c2f33; width: 350px; height: 500px;
}
#discord-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; text-align: center; padding: 20px; color: #ddd;
}
#discord-toggle-btn {
    position: fixed; bottom: 20px; right: 20px; z-index: 1001;
    width: 50px; height: 50px; border-radius: 50%;
    background-color: #5865F2; color: white; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, background-color 0.2s;
}
#discord-toggle-btn:hover { transform: scale(1.1); background-color: #4752C4; }

footer { margin-top: auto; background-color: #080808; border-top: 1px solid var(--acc-border) !important; }
.main-content { padding-top: 40px; padding-bottom: 60px; }
.hover-lift { transition: transform 0.2s ease; }
.hover-lift:hover { transform: translateY(-3px); }
.hover-red:hover { color: var(--acc-red) !important; }
.hover-white:hover { color: #fff !important; }
.navbar-nav .dropdown-toggle::after { display: none; }

/* MOBILE (< 992px) */
@media (max-width: 991.98px) {
    .glass-nav { height: auto; min-height: var(--nav-height); padding: 0.5rem 0; }
    .navbar-collapse {
        background: rgba(10, 10, 10, 0.98); padding: 1.5rem;
        border-radius: 12px; margin-top: 10px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .navbar-nav .nav-link { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .navbar-nav .nav-link::after { display: none; }
    .navbar-nav .nav-link.active {
        color: var(--acc-red) !important;
        padding-left: 10px; border-left: 3px solid var(--acc-red);
    }
    .search-form .input-group { width: 100%; }
    .vr { display: none; }
}
