/* ============================================
   RaceLink V3 — Professional Racing Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --red: #e63946;
    --red-dark: #b71c1c;
    --red-glow: rgba(230, 57, 70, 0.4);
    --bg-primary: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f5;
    --text-secondary: #6b6b80;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ============ NAVBAR ============ */

.nav-blur {
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: all 0.4s ease;
    z-index: 1000;
    padding: 12px 0;
}

.nav-scrolled {
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--red);
    letter-spacing: 2px;
}

.btn-login {
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.3);
    color: var(--red);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: var(--red);
    border-color: var(--red);
    color: white;
    box-shadow: 0 4px 20px var(--red-glow);
}

/* ============ HERO ============ */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 120px 0 80px;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
}

.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, var(--red-glow) 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(80px);
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.2; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.35; transform: translateX(-50%) scale(1.05); }
}

/* Speed lines */
.speed-lines {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.speed-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red-glow), transparent);
    animation: speedLine 3s linear infinite;
}

.speed-line:nth-child(1) { top: 20%; width: 200px; left: -200px; animation-delay: 0s; animation-duration: 2.5s; }
.speed-line:nth-child(2) { top: 35%; width: 300px; left: -300px; animation-delay: 0.8s; animation-duration: 3s; }
.speed-line:nth-child(3) { top: 55%; width: 150px; left: -150px; animation-delay: 1.5s; animation-duration: 2s; }
.speed-line:nth-child(4) { top: 70%; width: 250px; left: -250px; animation-delay: 0.3s; animation-duration: 3.5s; }
.speed-line:nth-child(5) { top: 85%; width: 180px; left: -180px; animation-delay: 2s; animation-duration: 2.8s; }

@keyframes speedLine {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(calc(100vw + 400px)); opacity: 0; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.25);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--red);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.hero-badge i {
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3.5rem, 10vw, 7rem);
    letter-spacing: 8px;
    line-height: 1;
    margin-bottom: 24px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--red) 0%, #ff6b6b 50%, var(--red) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-hero-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-hero-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--red-glow);
}

.btn-hero-primary:hover::before {
    transform: translateX(100%);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 500;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-hero-secondary:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-arrow {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    position: relative;
}

.scroll-arrow::before {
    content: '';
    width: 4px;
    height: 8px;
    background: var(--red);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { top: 8px; opacity: 1; }
    50% { top: 20px; opacity: 0.3; }
}

/* ============ STATS ============ */

.stats-section {
    padding: 60px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(18, 18, 26, 0.8) 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    text-align: center;
    padding: 24px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.4s ease;
    transition-delay: var(--delay, 0s);
}

.stat-item:hover {
    background: rgba(230, 57, 70, 0.05);
    border-color: rgba(230, 57, 70, 0.15);
    transform: translateY(-4px);
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--red);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 3px;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ============ FEATURES ============ */

.features-section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 20px;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    height: 100%;
    transition: all 0.4s ease;
    transition-delay: var(--delay, 0s);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(230, 57, 70, 0.15);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon-wrap {
    margin-bottom: 20px;
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.bg-gradient-red { background: linear-gradient(135deg, #e63946, #b71c1c); }
.bg-gradient-orange { background: linear-gradient(135deg, #f4845f, #c2410c); }
.bg-gradient-blue { background: linear-gradient(135deg, #4cc9f0, #1d4ed8); }
.bg-gradient-green { background: linear-gradient(135deg, #52b788, #14532d); }
.bg-gradient-purple { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.bg-gradient-yellow { background: linear-gradient(135deg, #facc15, #a16207); }

.feature-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.feature-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.feature-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============ HIGHLIGHT BANNER ============ */

.highlight-section {
    padding: 40px 0;
    background: var(--bg-primary);
}

.highlight-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 30px 40px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.15), rgba(230, 57, 70, 0.05));
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 16px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red);
    text-align: center;
    letter-spacing: 1px;
}

.highlight-banner i {
    font-size: 1.8rem;
    animation: pulse-flag 2s ease-in-out infinite;
}

@keyframes pulse-flag {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

/* ============ OUTLOOK ============ */

.outlook-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0d0d14 100%);
}

/* ============ CTA ============ */

.cta-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.cta-glow {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, var(--red-glow) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(60px);
}

.cta-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.cta-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 460px;
    margin: 0 auto;
}

/* ============ FOOTER ============ */

.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--red);
    letter-spacing: 2px;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============ ANIMATIONS ============ */

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--delay, 0s);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .hero-section { padding: 100px 0 60px; }
    .hero-title { letter-spacing: 4px; }
    .hero-subtitle { font-size: 1rem; }
    .stats-section { padding: 40px 0; }
    .features-section { padding: 60px 0; }
    .cta-section { padding: 60px 0; }
    .footer-content { flex-direction: column; gap: 12px; text-align: center; }
    .speed-lines { display: none; }
}

/* ============ ADMIN PANEL STYLES ============ */

.stat-card {
    transition: border-color 0.3s ease;
}
.stat-card:hover {
    border-color: #dc3545 !important;
}

.led-btn {
    min-width: 70px;
}

.event-log-container {
    max-height: 200px;
    overflow-y: auto;
    background: #0a0a0a;
    border-radius: 4px;
    padding: 8px;
}
.event-log-container::-webkit-scrollbar { width: 6px; }
.event-log-container::-webkit-scrollbar-track { background: #111; }
.event-log-container::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.event-entry {
    padding: 2px 0;
    border-bottom: 1px solid #1a1a1a;
}
.event-entry:last-child { border-bottom: none; }

#map { background: #1a1a1a; }

.badge-online {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.form-range::-webkit-slider-thumb { background: #dc3545; }
.form-range::-moz-range-thumb { background: #dc3545; }
.form-range::-webkit-slider-runnable-track { background: #333; }
.form-range::-moz-range-track { background: #333; }
