/**
 * Trialoop - Grid Theme
 * Modern gradient design with vibrant pink accents
 * Dark gradient background inspired by motorsport technology
 */

@import url('/assets/fonts/wave-block.css');

:root {
    /* Grid Theme Colors */
    --primary: #ff1e6a;              /* Hot pink/magenta accent */
    --primary-dark: #e0195c;         /* Darker pink for hover */
    --primary-light: #ff4d8a;        /* Lighter pink */
    --secondary: #ffffff;            /* White for contrast */
    --accent: #8b1538;               /* Deep burgundy from gradient */
    --success: #00ff88;              /* Bright green */
    --warning: #ffaa00;              /* Orange warning */
    --danger: #ff3366;               /* Red danger */
    
    /* Background Gradient Colors */
    --bg-gradient-1: #1a0a1a;        /* Deep purple-black */
    --bg-gradient-2: #2d1b3d;        /* Purple */
    --bg-gradient-3: #4a1e3d;        /* Purple-pink */
    --bg-gradient-4: #8b1538;        /* Burgundy */
    
    /* Neutral Colors */
    --dark: #0a0a0a;                 /* Almost black */
    --dark-gray: #1a1a1a;            /* Dark gray */
    --medium-gray: #2a2a2a;          /* Medium gray */
    --gray: #999999;                 /* Text gray */
    --light-gray: #cccccc;           /* Light gray */
    --light: #f0f0f0;                /* Light backgrounds */
    --white: #ffffff;                /* Pure white */
    
    /* Card backgrounds - glass effect */
    --card-bg: rgba(255, 255, 255, 0.03);
    --bg-card: rgba(255, 255, 255, 0.03);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-family: 'Play', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2.5rem;
    --font-size-4xl: 3rem;
    
    /* Layout */
    --container-max: 1200px;
    --header-height: 80px;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base */
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--white);
    background: var(--bg-gradient-1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Gradient Background - Grid style */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top left, var(--bg-gradient-2) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, var(--bg-gradient-4) 0%, transparent 50%),
                radial-gradient(ellipse at center, var(--bg-gradient-3) 0%, transparent 70%);
    background-color: var(--bg-gradient-1);
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--white);
    letter-spacing: -0.01em;
}

h1 { 
    font-size: var(--font-size-4xl);
    font-weight: 300;
}
h2 { 
    font-size: var(--font-size-2xl);
    font-weight: 300;
}
h3 { 
    font-size: var(--font-size-xl);
    font-weight: 400;
}

p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

/* Layout */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

main {
    flex: 1;
    padding: var(--space-3xl) 0;
}

/* Header - Grid minimal style with translucent background */
.header {
    background: rgba(26, 10, 26, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header background on scroll */
.header.scrolled {
    background: rgba(26, 10, 26, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.navbar {
    height: 100%;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-xl);
}

/* Logo - Keep existing animation but update colors */
.logo {
    font-size: var(--font-size-2xl);
    font-weight: 400;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 150;
}

.logo img {
    height: 100px;
    width: auto;
    display: block;
    margin: 0;
}

/* SVG Logo Styling */
.logo-svg-wrapper {
    display: block;
    height: 100px;
    width: auto;
    margin: 0;
}

.logo-svg-wrapper svg {
    height: 100%;
    width: auto;
    display: block;
}

/* SVG logo colors for Grid theme - pink like buttons */
.logo-svg-wrapper svg text {
    fill: var(--primary) !important;
    font-family: 'Wave Block', sans-serif !important;
}

/* Make all SVG paths pink */
.logo-svg-wrapper svg path {
    fill: var(--primary) !important;
}

/* Color-changing glow animation for infinity symbol */
.logo-svg-wrapper svg #Symbol path {
    animation: gridColorGlow 4s ease-in-out infinite;
    transform-origin: center;
    fill: var(--primary) !important;
}

/* Apply animation to the entire SVG for better browser support */
.logo-svg-wrapper[data-theme="grid"] svg {
    animation: gridColorGlow 4s ease-in-out infinite;
    -webkit-animation: gridColorGlow 4s ease-in-out infinite;
}

/* Color animation - cycles through pink, cyan, and purple */
@keyframes gridColorGlow {
    0% {
        filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
        -webkit-filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
    }
    33% {
        filter: drop-shadow(0 0 30px #00d4ff) drop-shadow(0 0 50px #00d4ff);
        -webkit-filter: drop-shadow(0 0 30px #00d4ff) drop-shadow(0 0 50px #00d4ff);
    }
    66% {
        filter: drop-shadow(0 0 30px #8b1538) drop-shadow(0 0 50px #8b1538);
        -webkit-filter: drop-shadow(0 0 30px #8b1538) drop-shadow(0 0 50px #8b1538);
    }
    100% {
        filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
        -webkit-filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
    }
}

/* Safari-specific with webkit prefix */
@-webkit-keyframes gridColorGlow {
    0% {
        -webkit-filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
        filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
    }
    33% {
        -webkit-filter: drop-shadow(0 0 30px #00d4ff) drop-shadow(0 0 50px #00d4ff);
        filter: drop-shadow(0 0 30px #00d4ff) drop-shadow(0 0 50px #00d4ff);
    }
    66% {
        -webkit-filter: drop-shadow(0 0 30px #8b1538) drop-shadow(0 0 50px #8b1538);
        filter: drop-shadow(0 0 30px #8b1538) drop-shadow(0 0 50px #8b1538);
    }
    100% {
        -webkit-filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
        filter: drop-shadow(0 0 20px #ff1e6a) drop-shadow(0 0 40px #ff1e6a);
    }
}

/* Hamburger + mobile-only items — hidden on desktop */
.hamburger { display: none; }
.nav-menu-lang { display: none; }
.nav-menu-mobile-auth { display: none; }

/* Navigation - Clean minimal style */
.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    align-items: center;
}

.nav-menu a {
    color: var(--white);
    font-weight: 400;
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    opacity: 0.9;
}

.nav-menu a:hover {
    opacity: 1;
    color: var(--primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Dropdown - Minimal style */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(26, 10, 26, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--space-sm);
    min-width: 200px;
    display: none;
    list-style: none;
    box-shadow: var(--shadow-lg);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    color: var(--white);
    opacity: 0.8;
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: rgba(255, 30, 106, 0.1);
    opacity: 1;
    color: var(--primary);
}

/* Buttons - Grid style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--border-radius-full);
    font-weight: 500;
    font-size: var(--font-size-base);
    text-align: center;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Primary button - Hot pink like "Book a demo" */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 8px 24px rgba(255, 30, 106, 0.3);
}

/* Secondary button - Transparent with border like "Watch Video" */
.btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-sm {
    padding: var(--space-xs) var(--space-lg);
    font-size: var(--font-size-sm);
    min-height: 40px;
}

.btn-icon {
    padding: var(--space-sm);
    min-height: auto;
}

/* Button with icon */
.btn i {
    margin-right: var(--space-sm);
}

/* Forms - Dark minimal style */
.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 400;
    color: var(--white);
    opacity: 0.9;
}

input, select, textarea {
    width: 100%;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--white);
    transition: all var(--transition-fast);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 30, 106, 0.2);
}

/* Cards - Dark glass style */
.card, .info-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    transition: all var(--transition-normal);
}

.info-card {
    padding: var(--space-md);
}

.card:hover, .info-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Race Cards */
.race-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.race-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.race-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.race-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.05);
}

.race-card:hover::before {
    opacity: 1;
}

.race-card.live {
    border-color: var(--primary);
}

.race-card.live::before {
    opacity: 1;
    background: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.race-card h3 {
    margin-bottom: var(--space-sm);
    color: var(--white);
}

.race-card .org {
    color: var(--primary);
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.race-card .location {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

.race-card .stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.race-card .stats span {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

/* Race List */
.race-list {
    margin-bottom: var(--space-lg);
}

.race-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
}

.race-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.race-info h3 {
    margin-bottom: var(--space-xs);
    color: var(--white);
}

.race-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
}

.race-info span {
    margin-right: var(--space-lg);
    font-size: var(--font-size-sm);
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.action-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-normal);
    text-decoration: none;
    color: var(--white);
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    text-decoration: none;
    border-color: rgba(255, 30, 106, 0.3);
    box-shadow: 0 8px 32px rgba(255, 30, 106, 0.2);
}

.action-card i {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-lg);
    display: block;
    color: var(--primary);
}

.action-card h3 {
    margin-bottom: var(--space-sm);
    font-weight: 400;
}

.action-card p {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--space-3xl) 0;
    margin-bottom: var(--space-3xl);
    position: relative;
}

.hero h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
    font-weight: 300;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: var(--font-size-xl);
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

/* Text styles */
.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* Footer */
.footer {
    background: rgba(10, 10, 10, 0.5);
    color: rgba(255, 255, 255, 0.6);
    padding: var(--space-2xl) 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-lg);
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border-color: rgba(0, 255, 136, 0.3);
}

.alert-error {
    background: rgba(255, 51, 102, 0.1);
    color: var(--danger);
    border-color: rgba(255, 51, 102, 0.3);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    color: var(--warning);
    border-color: rgba(255, 170, 0, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius);
    overflow: hidden;
}

th, td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    color: var(--primary);
    text-transform: uppercase;
    font-size: var(--font-size-sm);
    letter-spacing: 0.05em;
}

tr {
    transition: all var(--transition-fast);
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 30, 106, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 30, 106, 0.7);
}

/* Loading animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 30, 106, 0.2) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Infinity symbol styling */
.infinity-symbol {
    font-size: 1.4em;
    position: relative;
    top: 0.08em;
    margin: 0 0.005em;
    display: inline-block;
    line-height: 0;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2.5rem;
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.5rem;
    }
    
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 10001;
        position: relative;
        order: 10;
        margin-left: auto;
    }
    .hamburger span {
        width: 24px;
        height: 2px;
        background: var(--white);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    .hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .nav-menu {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(26, 10, 26, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        z-index: 10000;
        padding: 80px 24px 40px;
        box-sizing: border-box;
        overflow-y: auto;
    }
    .nav-menu.open {
        display: flex !important;
    }
    .nav-menu > li {
        list-style: none;
    }
    .nav-menu > li > a {
        font-size: 1.4rem;
        font-weight: 600;
        color: white;
    }
    .nav-menu .dropdown-menu {
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        display: none;
        text-align: center;
        min-width: unset;
    }
    .nav-menu .dropdown:hover .dropdown-menu,
    .nav-menu .dropdown.active .dropdown-menu {
        display: block;
    }
    .nav-menu .dropdown-menu a {
        color: rgba(255,255,255,0.7);
        font-size: 1.1rem;
    }

    .nav-user {
        display: none;
    }

    .nav-menu-mobile-auth {
        list-style: none;
        margin-top: 8px;
        padding-top: 16px;
        border-top: 1px solid rgba(255,255,255,0.15);
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .nav-menu-lang {
        display: flex;
        gap: 12px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255,255,255,0.15);
        list-style: none;
    }
    .lang-option-mobile {
        color: rgba(255,255,255,0.6);
        text-decoration: none;
        font-size: 1rem;
        padding: 8px 12px;
        border-radius: 8px;
        transition: all 0.2s;
    }
    .lang-option-mobile.active {
        color: #fff;
        background: rgba(255,30,106,0.2);
    }
    .lang-option-mobile:hover {
        color: #fff;
    }
    
    .logo img,
    .logo-svg-wrapper {
        height: 60px;
    }
    
    .race-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        padding: 0 var(--space-md);
    }
    
    main {
        padding: var(--space-2xl) 0;
    }
}

/* Fix main content spacing for fixed header */
body {
    padding-top: var(--header-height);
}

/* Specific card types - Organization cards, stat cards, etc */
.org-card, .stat-card, .feature-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.org-card:hover, .stat-card:hover, .feature-card:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Organization card top borders by type */
.org-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transform: translateY(0);
    transition: all 0.2s ease;
}

.org-card.federation::before { 
    background: linear-gradient(90deg, #0066cc 0%, #0052a3 100%); 
}

.org-card.club::before { 
    background: linear-gradient(90deg, #00aa00 0%, #008800 100%); 
}

.org-card.association::before { 
    background: linear-gradient(90deg, #ff6600 0%, #cc5200 100%); 
}

.org-card:hover::before {
    height: 4px;
}

/* Organization type badges - Keep their original colors */
.org-type.federation { 
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.2) 0%, rgba(0, 82, 163, 0.3) 100%) !important;
    color: #66b2ff !important;
    border: 1px solid rgba(0, 102, 204, 0.4) !important;
}

.org-type.club { 
    background: linear-gradient(135deg, rgba(0, 170, 0, 0.2) 0%, rgba(0, 136, 0, 0.3) 100%) !important;
    color: #66ff66 !important;
    border: 1px solid rgba(0, 170, 0, 0.4) !important;
}

.org-type.association { 
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.2) 0%, rgba(204, 82, 0, 0.3) 100%) !important;
    color: #ff9966 !important;
    border: 1px solid rgba(255, 102, 0, 0.4) !important;
}

/* Country badges */
.org-country {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--light-gray) !important;
}

/* Race tables */
.race-table {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.race-table th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--primary) !important;
}

.race-table tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Modal dialogs */
.modal-content {
    background: rgba(26, 10, 26, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Status badges */
.status-badge, .badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.status-draft { 
    background: rgba(108, 117, 125, 0.2) !important; 
    color: #adb5bd !important;
}

.status-published { 
    background: rgba(13, 110, 253, 0.2) !important; 
    color: #66b2ff !important;
}

.status-ongoing { 
    background: rgba(255, 193, 7, 0.2) !important; 
    color: #ffd666 !important;
}

.status-completed {
    background: rgba(25, 135, 84, 0.2) !important;
    color: #66d9a0 !important;
}

.status-times_up {
    background: rgba(253, 126, 20, 0.2) !important;
    color: #fd7e14 !important;
}

.status-approved { 
    background: rgba(0, 255, 136, 0.2) !important; 
    color: var(--success) !important;
}

.status-pending { 
    background: rgba(255, 170, 0, 0.2) !important; 
    color: var(--warning) !important;
}

/* Race status badges */
.race-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Filters container */
.filters {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Success banners */
.success-banner, .info-banner {
    background: rgba(0, 255, 136, 0.1) !important;
    border: 1px solid rgba(0, 255, 136, 0.3) !important;
    color: var(--success) !important;
}

/* Empty states */
.empty-state {
    color: rgba(255, 255, 255, 0.6) !important;
}

.empty-state-icon {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Pagination */
.pagination {
    background: transparent !important;
}

.page-link {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

.page-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--primary) !important;
}

.page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}

/* Floating action buttons */
.floating-button, .create-button {
    background: var(--primary) !important;
    color: var(--white) !important;
    box-shadow: 0 4px 20px rgba(255, 30, 106, 0.4) !important;
}

.floating-button:hover, .create-button:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 6px 30px rgba(255, 30, 106, 0.6) !important;
}

/* Collapsible sections */
.collapsible-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

.collapsible-content {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* List groups */
.list-group-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent !important;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.6) !important;
}

.breadcrumb-item.active {
    color: var(--white) !important;
}

/* Wells and panels */
.well, .panel {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

/* Custom scrollable areas */
.scrollable {
    scrollbar-color: rgba(255, 30, 106, 0.5) rgba(255, 255, 255, 0.05);
}

/* Text color fixes for dark theme */
.card p, .card span, .card label,
.org-card p, .org-card span, .org-card label,
.stat-card p, .stat-card span, .stat-card label,
.feature-card p, .feature-card span, .feature-card label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.org-card h1, .org-card h2, .org-card h3, .org-card h4, .org-card h5, .org-card h6,
.stat-card h1, .stat-card h2, .stat-card h3, .stat-card h4, .stat-card h5, .stat-card h6,
.feature-card h1, .feature-card h2, .feature-card h3, .feature-card h4, .feature-card h5, .feature-card h6 {
    color: var(--white) !important;
}

/* Organization specific text */
.org-name {
    color: var(--white) !important;
}

.org-description {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Stat numbers */
.stat-number {
    color: var(--primary) !important;
}

/* Icon colors */
.card i, .org-card i, .stat-card i, .feature-card i {
    color: var(--primary) !important;
}

/* Link colors in cards */
.card a, .org-card a, .stat-card a, .feature-card a {
    color: var(--primary) !important;
}

.card a:hover, .org-card a:hover, .stat-card a:hover, .feature-card a:hover {
    color: var(--primary-light) !important;
}

/* Select dropdown fixes */
select option {
    background: var(--dark-gray) !important;
    color: var(--white) !important;
}

/* Tabs and nav pills */
.nav-tabs, .nav-pills {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

.nav-link:hover {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.nav-link.active {
    background: var(--primary) !important;
    color: var(--white) !important;
    border-color: var(--primary) !important;
}

/* Progress bars */
.progress {
    background: rgba(255, 255, 255, 0.1) !important;
}

.progress-bar {
    background: var(--primary) !important;
}

/* Tooltips */
.tooltip-inner {
    background: rgba(26, 10, 26, 0.95) !important;
    color: var(--white) !important;
}

/* Popovers */
.popover {
    background: rgba(26, 10, 26, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.popover-header {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--white) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.popover-body {
    color: var(--white) !important;
}

/* Checkboxes and radios */
input[type="checkbox"],
input[type="radio"] {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* File inputs */
input[type="file"] {
    color: var(--white) !important;
}

/* Range sliders */
input[type="range"] {
    background: transparent !important;
}

input[type="range"]::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.1) !important;
}

input[type="range"]::-webkit-slider-thumb {
    background: var(--primary) !important;
}

/* Switches */
.custom-switch .custom-control-label::before {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Code blocks */
pre, code {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--primary) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* HR lines */
hr {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Profile page specific */
.profile-section {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

.org-list li {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.org-list li:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Test data page */
.form-section {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.info-box {
    background: rgba(17, 109, 255, 0.1) !important;
    border: 1px solid rgba(17, 109, 255, 0.3) !important;
    color: var(--white) !important;
}

.info-box.warning {
    background: rgba(255, 170, 0, 0.1) !important;
    border: 1px solid rgba(255, 170, 0, 0.3) !important;
}

.data-table {
    background: rgba(255, 255, 255, 0.02) !important;
}

.data-table th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--primary) !important;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.code-block {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--primary) !important;
}

/* Organization approval page */
.request-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.justification {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--white) !important;
}

.reject-form {
    background: rgba(255, 23, 68, 0.1) !important;
    border: 1px solid rgba(255, 23, 68, 0.3) !important;
}

/* Users page badges */
.badge-admin {
    background: rgba(220, 53, 69, 0.2) !important;
    color: #ff6b6b !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
}

.badge-pilot {
    background: rgba(40, 167, 69, 0.2) !important;
    color: #66ff66 !important;
    border: 1px solid rgba(40, 167, 69, 0.3) !important;
}

/* Authentication page */
.tool-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px);
}

/* Manage races specific */
.race-table {
    background: rgba(255, 255, 255, 0.02) !important;
}

.race-table th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--primary) !important;
}

/* Card variants for my-organizations */
.card-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

.card-body {
    background: transparent !important;
    color: var(--white) !important;
}

.card-footer {
    background: rgba(255, 255, 255, 0.03) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

/* Override Bootstrap utility classes */
.bg-white, .bg-light {
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--white) !important;
}

.bg-secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--white) !important;
}

.bg-dark {
    background: var(--dark-gray) !important;
    color: var(--white) !important;
}

.text-dark {
    color: var(--white) !important;
}

.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* User dropdown in header - IMPORTANT FIX */
.user-dropdown {
    background: rgba(26, 10, 26, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
}

.user-info {
    background: transparent !important;
}

.user-name {
    color: var(--white) !important;
}

.user-email {
    color: rgba(255, 255, 255, 0.7) !important;
}

.dropdown-item {
    color: var(--white) !important;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--primary) !important;
}

.dropdown-item i {
    color: var(--primary) !important;
}

/* Main navigation dropdowns */
.dropdown-menu {
    background: rgba(26, 10, 26, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.dropdown-menu a {
    color: var(--white) !important;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--primary) !important;
}

.dropdown-menu .dropdown-divider {
    background: rgba(255, 255, 255, 0.1) !important;
}

.dropdown-version {
    text-align: center;
    padding: 6px 16px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary, #ff1e6a);
    opacity: 0.85;
    user-select: none;
}

/* Submenu styling */
.submenu {
    background: rgba(26, 10, 26, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.submenu a {
    color: var(--white) !important;
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--primary) !important;
}

/* Super Admin page specific overrides */
.stats-row {
    background: transparent !important;
}

.stat-value {
    color: var(--primary) !important;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Tables */
.table {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--white) !important;
}

.table th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--primary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Form controls */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
    box-shadow: 0 0 0 3px rgba(255, 30, 106, 0.2) !important;
}

/* Buttons with specific colors */
.btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: var(--white) !important;
}

.btn-danger:hover {
    background: #cc0033 !important;
    border-color: #cc0033 !important;
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: var(--dark) !important;
}

.btn-success:hover {
    background: #00cc66 !important;
    border-color: #00cc66 !important;
}

.btn-warning {
    background: var(--warning) !important;
    border-color: var(--warning) !important;
    color: var(--dark) !important;
}

.btn-warning:hover {
    background: #cc8800 !important;
    border-color: #cc8800 !important;
}

/* Test data specific */
.test-indicator {
    color: var(--primary) !important;
}

.real-indicator {
    color: var(--success) !important;
}

/* Empty states and placeholders */
.text-center {
    color: var(--white) !important;
}

.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Override any remaining white backgrounds */
[style*="background: white"],
[style*="background:white"],
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background:#ffffff"],
[style*="background: #ffffff"] {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Collapsible sections */
.collapsible {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--white) !important;
    cursor: pointer;
}

.collapse-content {
    background: transparent !important;
}

.collapse-icon {
    color: var(--primary) !important;
}

/* Form labels */
.form-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Small text */
.small, small {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Modal overrides */
.modal-header {
    background: rgba(26, 10, 26, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-body {
    background: rgba(26, 10, 26, 0.98) !important;
    color: var(--white) !important;
}

.modal-footer {
    background: rgba(26, 10, 26, 0.98) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-title {
    color: var(--white) !important;
}

.btn-close {
    color: var(--white) !important;
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

/* Headings in dark theme */
h1, h2, h3, h4, h5, h6 {
    color: var(--white) !important;
}

/* Fix button widths */
.w-100 {
    width: 100% !important;
}

/* Icon colors */
.fas, .far, .fab {
    color: currentColor !important;
}

/* Row and column fixes */
.row {
    margin: 0 -0.5rem;
}

.col, .col-md-4, .col-md-8 {
    padding: 0 0.5rem;
}

/* Card specific for super-admin page */
.card-header h3 {
    color: var(--white) !important;
    margin: 0 !important;
}

/* Override inline styles more aggressively */
.super-admin-dashboard .card,
.super-admin-dashboard .stat-card,
body .card,
body .stat-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Stats specific overrides */
.test-stats .stat-value {
    color: #66b2ff !important;
}

.real-stats .stat-value {
    color: var(--success) !important;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}