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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(255, 70, 85, 0.3);
    color: #fff;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1118;
}

::-webkit-scrollbar-thumb {
    background: #2a3a4a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff4655;
}

/* ===== Navigation ===== */
#navbar {
    background: rgba(10, 17, 24, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
}

#navbar.scrolled {
    background: rgba(10, 17, 24, 0.95);
    border-bottom-color: rgba(42, 58, 74, 0.5);
}

/* Hamburger Animation */
#mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* LIVE Indicator Pulse */
.live-dot {
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* ===== Hero Section ===== */
.hero-grid {
    background-image: 
        linear-gradient(rgba(42, 58, 74, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 58, 74, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.hero-lines {
    background: 
        linear-gradient(135deg, transparent 40%, rgba(255, 70, 85, 0.03) 50%, transparent 60%);
}

.hero-title {
    text-shadow: 0 0 80px rgba(255, 70, 85, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 40px rgba(255, 70, 85, 0.2); }
    100% { text-shadow: 0 0 80px rgba(255, 70, 85, 0.4), 0 0 120px rgba(255, 70, 85, 0.1); }
}

.hero-tagline {
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 1s ease-out both;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out both;
}

/* ===== Scroll Reveal ===== */
.reveal-element {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ===== Player Cards ===== */
.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff4655, transparent);
    opacity: 0;
    transition: opacity 0.5s;
}

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

/* ===== Stat Cards ===== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 70, 85, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
}

.stat-card:hover::after {
    opacity: 1;
}

/* ===== Match Cards ===== */
.match-card {
    position: relative;
    overflow: hidden;
}

.match-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff4655, transparent);
    opacity: 0;
    transition: opacity 0.5s;
}

.match-card:hover::after {
    opacity: 1;
}

/* ===== Agent Chips ===== */
.agent-chip {
    cursor: pointer;
    display: inline-block;
}

.agent-label {
    display: inline-block;
    padding: 6px 14px;
    background: #1a2634;
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af;
    transition: all 0.25s ease;
    user-select: none;
}

.agent-chip:hover .agent-label {
    border-color: rgba(255, 70, 85, 0.5);
    color: #fff;
}

.agent-checkbox:checked + .agent-label {
    background: rgba(255, 70, 85, 0.15);
    border-color: #ff4655;
    color: #ff4655;
    box-shadow: 0 0 12px rgba(255, 70, 85, 0.2);
    font-weight: 600;
}

.agent-chip.disabled .agent-label {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== News Cards ===== */
.news-card {
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.news-card:hover {
    box-shadow: 0 10px 40px rgba(255, 70, 85, 0.08);
}

.news-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.5s ease-in-out;
}

/* ===== Form Styles ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0px 1000px #1a2634 inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===== Button Glow ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== Success Alert Animation ===== */
#success-alert .animate-slide-in {
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 640px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-grid {
        background-size: 40px 40px;
    }
}

@media (max-width: 1024px) {
    html {
        scroll-padding-top: 64px;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal-element {
        opacity: 1;
        transform: none;
    }
}
