:root {
    /* Light Theme */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --accent: #10b981;
    --text-main: #0f172a;
    --text-dim: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    --bg-alt: #fafafa;
}

body.dark-mode {
    /* Dark Theme */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    --bg-alt: #161e2e;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    transition: background-color 0.3s, color 0.3s, border-color 0.3s; 
}

body { 
    font-family: 'Outfit', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.6; 
}

.container { 
    max-width: 850px; 
    margin: 0 auto; 
    padding: 3rem 1rem; 
}

/* Header & Hero */
header { text-align: center; margin-bottom: 2rem; position: relative; }
.hero { text-align: center; margin-bottom: 3.5rem; padding: 1rem 0; }
.hero h1 { 
    font-size: 3.5rem; 
    font-weight: 800; 
    margin-bottom: 1rem; 
    letter-spacing: -2px; 
    line-height: 1.1; 
    background: linear-gradient(135deg, var(--accent), #059669); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
.hero p { font-size: 1.25rem; color: var(--text-dim); max-width: 600px; margin: 0 auto 2rem; }

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: -10px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 10;
}
.theme-toggle:hover { transform: scale(1.1); color: var(--accent); border-color: var(--accent); }

/* Navigation (Events Page) */
.navbar {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.back-link {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.back-link:hover { color: var(--accent); }
.navbar-brand { font-weight: 800; font-size: 1.2rem; color: var(--accent); }
.navbar .theme-toggle { position: static; width: 40px; height: 40px; }

/* Search & List */
.search-container { position: relative; margin-bottom: 2rem; }
.search-input { 
    width: 100%; 
    padding: 1.2rem 1.2rem 1.2rem 3.5rem; 
    border: 2px solid var(--border); 
    border-radius: 1rem; 
    font-size: 1.05rem; 
    outline: none; 
    box-shadow: var(--shadow); 
    background: var(--bg-card); 
    color: var(--text-main); 
}
.search-input:focus { border-color: var(--accent); }
.search-icon { position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

.date-header { 
    background: var(--bg-card); 
    padding: 1rem 1.5rem; 
    border-radius: 1rem; 
    margin-bottom: 1.5rem; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border: 1px solid var(--border); 
    box-shadow: var(--shadow); 
}

.event-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.match-card { background: var(--bg-card); border-radius: 1.25rem; border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.match-header { padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.match-info { display: flex; align-items: center; gap: 1.5rem; }
.match-time { background: var(--bg-body); padding: 0.4rem 0.8rem; border-radius: 0.6rem; font-weight: 800; color: var(--accent); min-width: 65px; text-align: center; }
.match-title { font-weight: 700; font-size: 1.2rem; }
.match-league { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; display: block; }
.event-flag { width: 25px; height: 18px; border-radius: 3px; object-fit: cover; border: 1px solid var(--border); }

.match-options { max-height: 0; overflow: hidden; transition: 0.4s; background: var(--bg-alt); }
.match-card.active { border-color: var(--accent); }
.match-card.active .match-options { max-height: 500px; }
.options-grid { padding: 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; border-top: 1px solid var(--border); }

/* Player Container & Video */
.player-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.video-wrapper {
    background: #000;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    aspect-ratio: 16/9;
    position: relative;
    border: 4px solid var(--bg-card);
}
.play-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.play-overlay.hidden { display: none; }
.play-button {
    width: 80px; height: 80px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
    animation: pulse-play 2s infinite;
}
@keyframes pulse-play {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.info-panel {
    background: var(--bg-card);
    margin-top: 1.5rem;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.info-panel h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }

/* Buttons & Options */
.btn-option { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    padding: 0.8rem; 
    border-radius: 1rem; 
    text-decoration: none; 
    text-align: center; 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: var(--text-main); 
    transition: all 0.2s; 
    display: block;
}
.btn-option:hover { 
    background: var(--accent); 
    color: white; 
    border-color: var(--accent); 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-option.active { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }

.share-container { margin-top: 1.5rem; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-share {
    background: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-share:hover { background: var(--accent); color: white; border-color: var(--accent); transform: translateY(-2px); }
.btn-share.wa { color: #25d366; }
.btn-share.wa:hover { color: white; }

/* Sections & Components */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 3rem 0; }
.feature-card { background: var(--bg-card); padding: 1.5rem; border-radius: 1.25rem; border: 1px solid var(--border); text-align: center; box-shadow: var(--shadow); }
.feature-card i { font-size: 2rem; color: var(--accent); margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.85rem; color: var(--text-dim); }

.cnt-slot, .cnt-slot-wrapper { 
    background: var(--bg-alt); 
    border: 1px dashed var(--border); 
    border-radius: 1rem; 
    margin: 2rem 0; 
    padding: 2rem; 
    text-align: center; 
    color: var(--text-dim); 
    font-size: 0.7rem; 
    letter-spacing: 2px; 
    opacity: 0.5; 
}

.seo-content { 
    margin-top: 4rem; 
    padding: 3.5rem 2rem; 
    background: var(--bg-card); 
    border-radius: 1.5rem; 
    border: 1px solid var(--border); 
    box-shadow: var(--shadow); 
}
.seo-content h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--text-main); }
.seo-content p { color: var(--text-dim); margin-bottom: 1.5rem; line-height: 1.8; }
.faq-item { background: var(--bg-body); padding: 1.5rem; border-radius: 1rem; margin-top: 1rem; border: 1px solid var(--border); }
.faq-item h3 { font-size: 1rem; color: var(--accent); margin-bottom: 0.5rem; }

/* Footer & Extras */
footer { margin-top: 2rem; padding: 1rem 0.5rem; background: var(--bg-card); border-top: 1px solid var(--border); text-align: center; }
.footer-links { margin: 0.5rem 0; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 0.75rem; }
.footer-logo { font-weight: 800; color: var(--accent); font-size: 1.2rem; }

.wa-float { position: fixed; bottom: 30px; right: 30px; background: #25d366; color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); z-index: 999; text-decoration: none; }

#pwa-install-banner {
    display: none;
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
    animation: fadeIn 0.5s ease-out;
}
.pwa-text h4 { font-size: 1rem; font-weight: 800; margin-bottom: 2px; }
.pwa-text p { font-size: 0.8rem; opacity: 0.9; margin: 0; }
.pwa-btns { display: flex; gap: 10px; }
.btn-pwa-install { background: white; color: var(--accent); border: none; padding: 0.5rem 1rem; border-radius: 0.6rem; font-weight: 800; font-size: 0.85rem; cursor: pointer; }
.btn-pwa-close { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.3); padding: 0.5rem; border-radius: 0.6rem; cursor: pointer; }

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

@media (max-width: 640px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .features { grid-template-columns: 1fr; gap: 1rem; }
    .match-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .match-info { width: 100%; }
    .theme-toggle { width: 40px; height: 40px; top: -20px; }
    .player-container { margin: 1rem auto; }
    .info-panel { padding: 1.5rem; }
    .info-panel h1 { font-size: 1.4rem; }
}

/* Noscript styles */
.noscript-banner { background-color: #f59e0b; color: #000; text-align: center; padding: 1rem; font-weight: 600; position: sticky; top: 0; z-index: 9999; border-bottom: 2px solid #d97706; }

/* Theme icon toggle */
.sun-icon { display: none; }
body.dark-mode .sun-icon { display: inline-flex; }
body.dark-mode .moon-icon { display: none; }
.theme-toggle span { display: inline-flex; align-items: center; justify-content: center; }
