/* ============================================
   NXRC Track Day - Motorsport Carbon Theme
   ============================================ */

/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
    /* Colors - Motorsport Palette */
    --color-bg-primary: #121212;
    --color-bg-secondary: #000000;
    --color-bg-tertiary: #1e1e1e;

    /* Carbon Texture Fallback */
    --color-surface: #1a1a1a;
    --color-surface-hover: #252525;

    --color-accent-red: #E60000;
    --color-accent-red-dark: #cc0000;
    --color-accent-red-light: #ff3333;

    --color-text-primary: #FFFFFF;
    --color-text-secondary: #B0B0B0;
    --color-text-muted: #666666;

    --color-success: #00E676;
    --color-warning: #FFAB00;
    --color-error: #FF1744;
    --color-info: #00B0FF;

    --color-border: #333333;
    --color-border-light: #444444;

    /* Typography */
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Prompt', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    --spacing-2xl: 6rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.7);
    --shadow-glow-red: 0 0 20px rgba(230, 0, 0, 0.4);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    background-image:
        linear-gradient(rgba(18, 18, 18, 0.9), rgba(18, 18, 18, 0.9)),
        repeating-linear-gradient(45deg,
            #151515,
            #151515 10px,
            #1a1a1a 10px,
            #1a1a1a 11px);
    /* Simple carbon fiber effect */
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    font-style: italic;
    /* Speed look */
    letter-spacing: 0.5px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--spacing-md);
    font-weight: 300;
}

a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-red);
}

/* ============================================
   Layout Components
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--color-accent-red);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1.5rem 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    font-family: var(--font-heading);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-style: italic;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--color-text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   Cards & Surfaces
   ============================================ */
.card {
    background: linear-gradient(145deg, #1e1e1e, #161616);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent-red), transparent);
}

.card-glass {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-style: italic;
    border-radius: 4px;
    /* Sharper corners for racing look */
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent-red);
    color: white;
    box-shadow: 0 4px 0 var(--color-accent-red-dark);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--color-accent-red-dark);
}

.btn-primary:hover {
    background: var(--color-accent-red-light);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-border-light);
    color: var(--color-text-primary);
}

.btn-secondary:hover {
    border-color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

/* ============================================
   Tables (Leaderboard)
   ============================================ */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: #151515;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force scroll on mobile */
}

.table th {
    background: #000;
    color: var(--color-text-secondary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Rank Styling */
.rank {
    font-family: var(--font-heading);
    font-weight: 700;
    font-style: italic;
    font-size: 1.2rem;
}

.rank-1 {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    color: #C0C0C0;
}

.rank-3 {
    color: #CD7F32;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    background: #000;
    border: 1px solid var(--color-border);
    color: white;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent-red);
    box-shadow: 0 0 0 2px rgba(230, 0, 0, 0.2);
}

/* ============================================
   Grid & Utilities
   ============================================ */
.grid {
    display: grid;
    gap: var(--spacing-lg);
    padding-bottom: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.text-center {
    text-align: center;
}

.text-red {
    color: var(--color-accent-red);
}

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

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-md {
    gap: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 3rem;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

.gap-sm {
    gap: 0.5rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.mb-0 {
    margin-bottom: 0;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-uppercase {
    text-transform: uppercase;
}

.italic {
    font-style: italic;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.text-left {
    text-align: left;
}

.mobile-only {
    display: none;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-verified {
    background: rgba(0, 230, 118, 0.2);
    color: #00E676;
    border: 1px solid #00E676;
}

.badge-race {
    background: rgba(230, 0, 0, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
}

.badge-street {
    background: rgba(0, 176, 255, 0.2);
    color: #40c4ff;
    border: 1px solid #40c4ff;
}

/* ============================================
   Mobile Responsiveness
   ============================================ */
@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .mobile-only {
        display: block;
    }

    .navbar-menu {
        display: none;
        /* In future steps we'll implement the toggle */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #000;
        padding: 2rem;
        border-bottom: 2px solid var(--color-accent-red);
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-toggle {
        display: block;
    }

    h1 {
        font-size: 2rem;
    }
}

/* =========================================
   Footer & Floating Menu Styles
   ========================================= */

.site-footer {
    background-color: var(--color-bg-secondary, #111);
    color: var(--color-text-primary, #fff);
    font-family: var(--font-body, sans-serif);
    margin-top: 5rem;
    position: relative;
    z-index: 10;
}

/* CTA Bar */
.footer-cta {
    background: linear-gradient(90deg, #1a1a1a 0%, #000 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.footer-cta::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-accent-red, #dc3545);
}

/* Lists */
.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #fff;
    transform: translateX(5px);
}

/* Social Icons */
.social-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.social-btn:hover {
    background: var(--color-accent-red, #dc3545);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* Misc */
.footer-bottom {
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hover-white:hover {
    color: #fff !important;
}

.text-green {
    color: #06c755;
}

@media (max-width: 768px) {
    .site-footer .grid-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-footer {
        text-align: left;
    }

    .social-icons {
        justify-content: flex-start;
    }

    .site-footer .wrap-mobile {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .footer-cta .text-left {
        margin-bottom: 1rem;
    }

    .footer-cta .btn {
        width: 100%;
    }
}

/* Floating Menu */
.float-menu-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.float-btn:hover {
    transform: scale(1.1) translateY(-3px);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.float-line {
    background: rgba(6, 199, 85, 0.9);
}

.float-line:hover {
    background: #06c755;
    box-shadow: 0 0 15px rgba(6, 199, 85, 0.6);
}

.float-tel {
    background: rgba(13, 110, 253, 0.9);
}

.float-tel:hover {
    background: #0d6efd;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.6);
}

.float-top {
    background: rgba(220, 53, 69, 0.9);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.float-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.float-top.show:hover {
    background: #dc3545;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
    transform: scale(1.1) translateY(-3px);
}

@media (max-width: 768px) {
    .float-menu-container {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .float-btn {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

/* =========================================
   Event Card V3 (Race Calendar Style)
   ========================================= */
.event-card-race {
    background: #1a1a1a;
    border-radius: 12px;
    border-left: 6px solid var(--color-accent-red);
    display: flex;
    flex-direction: column;
    min-height: 380px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.event-card-race:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Event Image Background */
.event-card-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.event-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(26, 26, 26, 0.95) 100%
    );
    z-index: 1;
}

/* Date Block (Absolute Top Right) */
.race-date-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-accent-red);
    color: white;
    padding: 0.5rem 1rem;
    border-bottom-left-radius: 12px;
    text-align: center;
    line-height: 1.1;
    z-index: 3;
}

.race-day {
    font-size: 1.5rem;
    font-weight: 800;
    display: block;
}

.race-month {
    font-size: 0.8rem;
    text-transform: uppercase;
    display: block;
}

/* Status (Top Left) */
.race-status {
    position: relative;
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Content */
.race-content {
    position: relative;
    padding: 0.5rem 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    z-index: 2;
    margin-top: 150px; /* Push content below image */
}

.race-title {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: white;
    text-transform: uppercase;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.race-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ddd;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Footer & Progress */
.race-footer {
    position: relative;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.race-progress-container {
    margin-bottom: 1rem;
}

.race-progress-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.race-progress-fill {
    height: 100%;
    background: var(--color-accent-red);
}

/* Button override for this card */
.btn-race {
    width: 100%;
    background: transparent;
    border: 1px solid var(--color-accent-red);
    color: var(--color-text-primary);
    text-align: center;
    padding: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-race:hover {
    background: var(--color-accent-red);
    color: white;
}

/* =========================================
   Sponsors Section
   ========================================= */
.sponsors-section {
    background: linear-gradient(to bottom, #111, #000);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-divider {
    width: 60px;
    height: 3px;
    background-color: var(--primary-color, #e60000);
    border-radius: 2px;
}

.sponsor-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Platinum Tier */
.sponsor-card.platinum {
    height: 140px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    /* Gold-ish accent for platinum/premium */
}

/* Gold Tier */
.sponsor-card.gold {
    height: 120px;
}

/* Silver Tier */
.sponsor-card.silver {
    height: 80px;
}

/* Partner Tier */
.sponsor-card.partner {
    height: 60px;
}

.sponsor-logo {
    max-width: 80%;
    max-height: 80%;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.3s ease;
    object-fit: contain;
}

.sponsor-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.sponsor-card.platinum:hover {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.sponsor-card:hover .sponsor-logo {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sponsor-card.platinum {
        height: 100px;
    }

    .sponsor-card.gold {
        height: 90px;
    }

    .sponsor-card.silver {
        height: 70px;
    }
}