:root {
    --bs-body-bg: #0d1117;
    --bs-body-color: #c9d1d9;
    --bs-card-bg: #161b22;
    --bs-card-border-color: #30363d;
    --bs-primary: #58a6ff;
    --bs-success: #3fb950;
    --bs-warning: #d29922;
    --bs-danger: #f85149;
}

body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: 80px; /* Offset for sticky header */
}

/* Sticky Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(22, 27, 34, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bs-card-border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    height: 70px;
}

.header-content {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 45px;
    width: auto;
}

.brand-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #58a6ff;
    letter-spacing: 0.5px;
}

/* Header Navigation (InfoByt style) */
.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 20px;
}

.header-nav .nav-link {
    padding: 10px 24px;
    border-radius: 8px;
    background: transparent;
    color: #c9d1d9;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.header-nav .nav-link:hover {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border-color: rgba(88, 166, 255, 0.3);
}

.header-nav .nav-link.active {
    background: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%);
    color: #ffffff;
    border-color: #58a6ff;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.header-nav .nav-link-admin {
    background: rgba(210, 153, 34, 0.1);
    border-color: rgba(210, 153, 34, 0.3);
}

.header-nav .nav-link-admin:hover {
    background: rgba(210, 153, 34, 0.2);
    color: #d29922;
    border-color: #d29922;
}

.header-nav .nav-link-logout {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
}

.header-nav .nav-link-logout:hover {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
    border-color: #f85149;
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background: #58a6ff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(22, 27, 34, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bs-card-border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
}

.mobile-nav.active {
    max-height: 500px;
    border-bottom: 1px solid var(--bs-card-border-color);
}

.mobile-nav .nav-link {
    display: block;
    padding: 15px 20px;
    color: #c9d1d9;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.mobile-nav .nav-link:hover {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    padding-left: 25px;
}

.mobile-nav .nav-link.active {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-left: 3px solid #58a6ff;
}

.mobile-nav .nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.mobile-nav .nav-link-admin {
    color: rgba(210, 153, 34, 1);
}

.mobile-nav .nav-link-admin:hover {
    background: rgba(210, 153, 34, 0.1);
    color: rgba(210, 153, 34, 1);
}

.mobile-nav .nav-link-logout {
    color: rgba(248, 81, 73, 1);
}

.mobile-nav .nav-link-logout:hover {
    background: rgba(248, 81, 73, 0.1);
    color: rgba(248, 81, 73, 1);
}

body.menu-open {
    overflow: hidden;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .header-logo {
        height: 35px;
    }
}

@media (max-width: 576px) {
    .brand-text {
        display: none;
    }
    
    .main-header {
        height: 60px;
    }
    
    .header-content {
        height: 60px;
    }
    
    body {
        padding-top: 70px;
    }
    
    .mobile-nav {
        top: 60px;
    }
}

.navbar {
    background: rgba(22, 27, 34, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bs-card-border-color);
}

.card {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-card-border-color);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: rgba(88, 166, 255, 0.1);
    border-bottom: 1px solid var(--bs-card-border-color);
    font-weight: 600;
}

.table {
    color: #ffffff;
}

.table-dark {
    --bs-table-bg: #161b22;
    --bs-table-striped-bg: #1c2128;
    --bs-table-hover-bg: #21262d;
    --bs-table-color: #ffffff;
    border-color: var(--bs-card-border-color);
}

/* Remove pink/red background from danger rows */
.table-danger {
    --bs-table-bg: rgba(248, 81, 73, 0.15);
    --bs-table-color: #ffffff;
}

/* Custom class for damage rows - very subtle */
.table-row-damage {
    background-color: rgba(248, 81, 73, 0.08) !important;
    border-left: 3px solid rgba(248, 81, 73, 0.5);
}

/* Better text colors in tables */
.table .text-success {
    color: #58d364 !important;
}

.table .text-warning {
    color: #f0ad4e !important;
}

.table .text-danger {
    color: #ff7b72 !important;
}

.table .text-muted {
    color: #8b949e !important;
}

/* Ensure all table text is white by default */
.table td,
.table th {
    color: #ffffff !important;
}

/* Override specific colored cells */
.table .text-success,
.table .text-warning,
.table .text-danger,
.table .text-primary,
.table .text-info {
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%);
    border: none;
    font-weight: 500;
}

.btn-success {
    background: linear-gradient(135deg, #3fb950 0%, #238636 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #f85149 0%, #da3633 100%);
    border: none;
}

.stat-card {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(88, 166, 255, 0.05) 100%);
    border-left: 4px solid var(--bs-primary);
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.stat-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card.success {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.1) 0%, rgba(63, 185, 80, 0.05) 100%);
    border-left-color: var(--bs-success);
}

.stat-card.warning {
    background: linear-gradient(135deg, rgba(210, 153, 34, 0.1) 0%, rgba(210, 153, 34, 0.05) 100%);
    border-left-color: var(--bs-warning);
}

.stat-card.danger {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.1) 0%, rgba(248, 81, 73, 0.05) 100%);
    border-left-color: var(--bs-danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff !important;
}

.stat-card h6 {
    color: #ffffff !important;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Override Bootstrap text-muted in stat cards */
.stat-card .text-muted,
.stat-card small {
    color: #ffffff !important;
    opacity: 0.9;
}

.badge {
    font-weight: 600;
    padding: 0.5em 0.8em;
}

.trophy-icon {
    font-size: 2rem;
    color: #d29922;
    text-shadow: 0 0 10px rgba(210, 153, 34, 0.5);
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.form-control, .form-select {
    background: #0d1117;
    border: 1px solid var(--bs-card-border-color);
    color: var(--bs-body-color);
}

.form-control:focus, .form-select:focus {
    background: #0d1117;
    border-color: var(--bs-primary);
    color: var(--bs-body-color);
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

.alert {
    border-radius: 8px;
    border: none;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 400px;
    width: 100%;
}

.driver-rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-left: 4px solid #FFD700;
}

.driver-rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.05) 100%);
    border-left: 4px solid #C0C0C0;
}

.driver-rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.05) 100%);
    border-left: 4px solid #CD7F32;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Floating Discord Button */
.discord-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.discord-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.6);
}

.discord-float img {
    width: 60px;
    height: 60px;
}
