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

:root {
    --primary-red: #cc0000;
    --hover-red: #ff1a1a;
    --dark-bg: #0f0f0f;
    --light-bg: #f8f9fa;
    --text-main: #2d2d2d;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --secure-gold: #ff9900;
    --success-green: #28a745;
    --error-red: #dc3545;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

body { 
    font-family: var(--font-body); 
    margin: 0; padding: 0;
    background-color: var(--light-bg); 
    color: var(--text-main); 
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- HEADER & GLOSSY NAV --- */
header { 
    background: linear-gradient(180deg, #000 0%, #1a1a1a 100%);
    color: white; border-bottom: 4px solid var(--primary-red);
    position: sticky; top: 0; z-index: 1000;
}

.header-container { display: flex; justify-content: center; padding: 25px 20px; }
.logo { 
    max-height: 130px; width: auto; 
    filter: drop-shadow(0 0 15px rgba(204, 0, 0, 0.4));
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.logo:hover { transform: scale(1.05) rotate(-2deg); }

nav { display: flex; justify-content: center; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(10px); overflow-x: auto; }
.nav-btn { 
    background: transparent; color: #bbb; border: none; padding: 15px 25px; 
    cursor: pointer; font-family: var(--font-heading); font-weight: 800; 
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px;
    transition: 0.3s; border-bottom: 3px solid transparent;
}
.nav-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-btn.active { color: white; border-bottom-color: var(--primary-red); }

/* --- SECTION ANIMATIONS --- */
main { padding: 20px; max-width: 900px; margin: 20px auto; min-height: 70vh; }

.content-section { display: none; opacity: 0; transform: translateY(20px); }
.content-section.active { 
    display: block; 
    animation: slideUp 0.5s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}

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

.section-header h2 { 
    font-size: 2rem; font-weight: 900; color: var(--dark-bg);
    position: relative; padding-bottom: 10px; margin-bottom: 30px;
}
.section-header h2::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 0; height: 5px; background: var(--primary-red);
    transition: width 0.5s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.content-section.active .section-header h2::after { width: 60px; }

/* --- MODERN CARDS --- */
.card { 
    background: white; padding: 25px; margin-bottom: 25px; 
    border-radius: 12px; box-shadow: var(--card-shadow);
    border-left: 8px solid var(--primary-red);
    transition: 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.12); }

/* --- DASHBOARD UPGRADES --- */
.season-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 30px; }
@media (min-width: 600px) { .season-summary { grid-template-columns: repeat(4, 1fr); } }

.stat-box {
    background: white; padding: 20px; border-radius: 12px; text-align: center;
    box-shadow: var(--card-shadow); transition: 0.3s; border: 1px solid #eee;
    display: flex; flex-direction: column; align-items: center;
}
.stat-box:hover { transform: translateY(-5px); border-color: var(--primary-red); }
.stat-box i { font-size: 1.2rem; margin-bottom: 8px; color: #aaa; display: block; }
.stat-box.wins i { color: var(--success-green); }
.stat-box.draws i { color: var(--secure-gold); }
.stat-box.losses i { color: var(--error-red); }

.stat-num { font-size: 1.8rem; font-weight: 900; font-family: var(--font-heading); color: var(--dark-bg); }
.stat-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: #888; letter-spacing: 1.5px; }

.pc-container { position: relative; width: 65px; height: 65px; margin-bottom: 5px; }
.pc-meter { stroke-width: 5; filter: drop-shadow(0 0 5px rgba(40, 167, 69, 0.3)); }
.pc-text { font-size: 1rem; color: var(--dark-bg); }

/* --- FILTER PILLS --- */
.sub-nav, .filter-nav { gap: 10px; margin-bottom: 30px; }
.sub-btn, .filter-btn {
    background: white; border: 1px solid #ddd; padding: 10px 25px;
    border-radius: 50px; font-weight: 800; font-size: 0.8rem; color: #555;
    font-family: var(--font-heading); letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: 0.3s; cursor: pointer;
}
.sub-btn.active, .filter-btn.active.all { background: var(--dark-bg); color: white; border-color: var(--dark-bg); }
.filter-btn.active.win { background: var(--success-green); color: white; border-color: var(--success-green); }
.filter-btn.active.draw { background: var(--secure-gold); color: white; border-color: var(--secure-gold); }
.filter-btn.active.loss { background: var(--error-red); color: white; border-color: var(--error-red); }

/* --- MATCH CARDS --- */
.match-header h3 { font-size: 1.1rem; margin: 0; font-weight: 800; }
.match-logo { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); }

.result-badge { 
    width: 28px; height: 28px; font-size: 0.8rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.potm-badge { 
    background: linear-gradient(135deg, #fff9eb 0%, #fff 100%);
    border: 1px solid var(--secure-gold); color: #856404;
    padding: 10px 20px; border-radius: 50px; font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(255, 153, 0, 0.1);
}

/* --- FORMS --- */
.auth-card { border-left: 10px solid var(--secure-gold); }
input { 
    border: 2px solid #eee; background: #fafafa;
    transition: 0.3s; font-weight: 500;
}
input:focus { border-color: var(--primary-red); background: white; }

.btn-submit { 
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    padding: 18px; border-radius: 8px; font-size: 0.9rem;
}

/* --- FOOTER & BACK TO TOP --- */
footer { background: #0a0a0a; padding: 40px 20px; }
.club-link { border-width: 2px; font-weight: 900; }
.club-link:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(255,255,255,0.1); }

#backToTop {
    position: fixed; bottom: 30px; right: 30px;
    width: 55px; height: 55px; font-size: 1.4rem;
    background: var(--primary-red); box-shadow: 0 8px 25px rgba(204, 0, 0, 0.4);
    display: none; border-radius: 50%; border: none; cursor: pointer;
    align-items: center; justify-content: center; color: white; z-index: 999;
}

/* --- SCHEDULE TABS --- */
.schedule-tab { display: none; }
.schedule-tab.active { display: block; }

/* --- SUB NAV & FILTER NAV --- */
.sub-nav, .filter-nav { display: flex; flex-wrap: wrap; }

/* --- MATCH CARDS --- */
.match-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.map-preview { width: 100%; height: 200px; border: none; border-radius: 8px; margin-top: 10px; display: block; }
.map-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
    color: var(--primary-red); text-decoration: none; font-size: 0.85rem; font-weight: 700;
}
.map-link:hover { text-decoration: underline; }

/* --- RESULT BADGE --- */
.result-badge {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 900; font-family: var(--font-heading); color: white;
    vertical-align: middle;
}
.badge-win { background: var(--success-green); }
.badge-draw { background: var(--secure-gold); }
.badge-loss { background: var(--error-red); }

/* --- POTM BADGE --- */
.potm-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; }

/* --- WIN % SVG CIRCLE --- */
.stat-box.win-pc { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pc-svg { width: 65px; height: 65px; transform: rotate(-90deg); }
.pc-bg { fill: none; stroke: #eee; stroke-width: 3; }
.pc-meter {
    fill: none; stroke: var(--success-green); stroke-width: 3;
    stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.8s ease;
}
.pc-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.85rem; font-weight: 900; font-family: var(--font-heading);
}

/* --- LOADER --- */
.loader-container { display: flex; flex-direction: column; align-items: center; padding: 40px; gap: 15px; }
.spinner {
    width: 40px; height: 40px; border: 4px solid #eee;
    border-top-color: var(--primary-red); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loader-text { font-family: var(--font-heading); font-weight: 800; letter-spacing: 2px; color: #888; margin: 0; font-size: 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- EMPTY STATE --- */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 40px; color: #aaa; gap: 10px; }
.empty-state i { font-size: 2rem; }
.empty-state p { margin: 0; font-size: 0.9rem; }

/* --- FORMS --- */
.input-group { position: relative; margin-bottom: 15px; }
.input-prefix-group { display: flex; align-items: center; }
.input-prefix { background: rgba(255,255,255,0.08); border: 1px solid var(--border-color); border-right: none; border-radius: 8px 0 0 8px; padding: 14px 10px; font-size: 0.9rem; color: #aaa; white-space: nowrap; flex-shrink: 0; }
.input-prefix-group input { border-radius: 0 8px 8px 0 !important; padding-right: 16px !important; }
.input-addons { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.toggle-password { background: none; border: none; cursor: pointer; color: #888; font-size: 1rem; padding: 5px; }
.toggle-password:hover { color: var(--primary-red); }
.form-row { display: flex; gap: 10px; margin-bottom: 15px; }
.form-row input { flex: 1; margin-bottom: 0; }

input {
    width: 100%; padding: 14px 16px; border-radius: 8px; font-size: 0.9rem;
    font-family: var(--font-body); outline: none; box-sizing: border-box; display: block;
    margin-bottom: 0;
}
.input-group input { padding-right: 45px; }

.btn-submit {
    width: 100%; color: white; border: none; cursor: pointer;
    font-family: var(--font-heading); font-weight: 800; letter-spacing: 1px;
    text-transform: uppercase; margin-bottom: 15px; transition: 0.3s;
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-1px); }

/* --- PASSWORD CRITERIA --- */
.password-criteria { margin-bottom: 15px; font-size: 0.8rem; }
.password-criteria p { margin: 0 0 5px; font-weight: 700; color: #555; }
.password-criteria ul { margin: 0; padding-left: 20px; }
.password-criteria li.valid { color: var(--success-green); }
.password-criteria li.invalid { color: #aaa; }

/* --- STRENGTH BAR --- */
.strength-container { height: 6px; background: #eee; border-radius: 3px; margin-bottom: 15px; overflow: hidden; }
#strength-bar { height: 100%; width: 0%; border-radius: 3px; transition: width 0.3s, background 0.3s; }

/* --- AUTH CARD --- */
.auth-card h3 { margin-top: 0; font-family: var(--font-heading); color: var(--dark-bg); }
.auth-card p { font-size: 0.9rem; color: #555; }
.auth-card a { color: var(--primary-red); text-decoration: none; font-weight: 700; }
.auth-card a:hover { text-decoration: underline; }

/* --- AUTH MESSAGES --- */
.auth-message { font-size: 0.85rem; margin-bottom: 12px; padding: 10px 14px; border-radius: 6px; display: none; }
.auth-message.error { display: block; background: #fff0f0; color: var(--error-red); border: 1px solid #ffc0c0; }
.auth-message.success { display: block; background: #f0fff4; color: var(--success-green); border: 1px solid #b0e8c0; }

/* --- PARENTS PORTAL NOTICES --- */
.notice-card {
    background: #fffbf0; border: 1px solid #ffe0a0; border-radius: 10px;
    padding: 20px; margin-bottom: 15px;
}
.notice-card h4 { margin: 0 0 8px; color: #7a5500; font-family: var(--font-heading); font-size: 0.95rem; }
.notice-card p { margin: 0; font-size: 0.9rem; color: #555; }

/* --- NAV SECURE BUTTON --- */
.nav-btn.btn-secure { color: var(--secure-gold); }
.nav-btn.btn-secure.active { color: var(--secure-gold); border-bottom-color: var(--secure-gold); }
.nav-btn.btn-secure:hover { color: var(--secure-gold); }

/* --- FOOTER --- */
.footer-container { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.footer-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-content { text-align: center; color: #888; font-size: 0.85rem; }
.footer-content p { margin: 4px 0; }
.footer-sub { color: #555; font-size: 0.75rem; }
.social-icon { color: white; font-size: 1.5rem; transition: 0.3s; text-decoration: none; }
.social-icon:hover { color: var(--primary-red); transform: scale(1.1); display: inline-block; }

/* Override the incomplete .club-link rule above with full styles */
a.club-link {
    display: inline-flex; align-items: center; gap: 8px; color: white;
    text-decoration: none; padding: 10px 20px;
    border: 2px solid rgba(255,255,255,0.3); border-radius: 50px;
    font-family: var(--font-heading); font-size: 0.8rem; font-weight: 900;
    transition: 0.3s; letter-spacing: 0.5px;
}

/* --- HOME / AWAY BADGES --- */
.badge-home {
    display: inline-block; background: #e8f5e9; color: #2e7d32;
    border: 1px solid #a5d6a7; padding: 2px 8px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 800; font-family: var(--font-heading);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-away {
    display: inline-block; background: #fff3e0; color: #e65100;
    border: 1px solid #ffcc80; padding: 2px 8px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 800; font-family: var(--font-heading);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* --- NEWS DATE CHIP --- */
.news-date {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.75rem; font-weight: 700; color: #888; margin-bottom: 8px;
}

/* --- MATCH HEADER TEXT BLOCK --- */
.match-header-info { display: flex; flex-direction: column; gap: 4px; }
.match-header-info h3 { margin: 0; }

/* ============================================================
   MOBILE — Bottom Tab Bar + Layout Fixes
   ============================================================ */
@media (max-width: 600px) {

    /* Compact header — just the logo */
    .logo { max-height: 55px; }
    .header-container { padding: 10px 20px; }
    header { border-bottom: 2px solid var(--primary-red); }

    /* Detach nav from header and fix it to the bottom of the screen */
    nav {
        position: fixed;
        bottom: 0; left: 0; right: 0; top: auto;
        background: #111;
        border-top: 2px solid var(--primary-red);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 2000;
        justify-content: space-around;
        overflow: visible;
    }

    /* Tab buttons */
    .nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 4px;
        padding: 10px 4px;
        min-height: 56px;          /* Apple HIG minimum touch target */
        font-size: 0.58rem;
        letter-spacing: 0;
        border-bottom: none;
        border-top: 3px solid transparent;
    }
    .nav-btn i { font-size: 1.3rem; line-height: 1; }
    .nav-text { display: block !important; }
    .nav-btn.active { color: var(--primary-red); border-top-color: var(--primary-red); }

    /* Section content: pad bottom to clear the tab bar */
    main {
        margin-top: 10px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Cards: tighter padding on small screens */
    .card { padding: 15px 14px; }

    /* Section headings */
    .section-header h2 { font-size: 1.5rem; }

    /* Sub-nav pills and filter pills — bigger touch targets */
    .sub-btn, .filter-btn {
        padding: 10px 14px;
        font-size: 0.75rem;
    }

    /* Auth / login forms */
    .auth-container { padding: 20px 16px; }

    /* Admin section nav on mobile */
    .admin-section-nav { gap: 6px; }
    .admin-section-btn { padding: 8px 10px; font-size: 0.7rem; }

    /* Back-to-top button — keep above tab bar */
    #backToTop { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

    /* Toast — keep above tab bar */
    .toast-notification { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* --- ALERT BANNER --- */
.alert-banner {
    padding: 12px 20px; text-align: center;
    position: sticky; top: 0; z-index: 1001;
    font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem;
    letter-spacing: 0.3px;
}
.alert-warning { background: var(--secure-gold); color: #000; }
.alert-info    { background: #0070f3; color: white; }
.alert-success { background: var(--success-green); color: white; }
.alert-content {
    max-width: 900px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px; justify-content: center;
}
.alert-close {
    background: none; border: none; cursor: pointer;
    color: inherit; font-size: 1.1rem; padding: 0; margin-left: auto; opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* --- NEXT MATCH CARD --- */
.next-match-card {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: white; padding: 20px 25px; border-radius: 12px; margin-bottom: 25px;
    border-left: 8px solid var(--primary-red);
}
.next-match-label {
    font-family: var(--font-heading); font-size: 0.65rem; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase; color: #aaa;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.next-match-countdown {
    background: var(--primary-red); color: white;
    padding: 2px 10px; border-radius: 4px; font-size: 0.65rem; letter-spacing: 1px;
}
.next-match-body { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; }
.next-match-body h3 { margin: 0; font-size: 1.2rem; color: white; }
.next-match-card p { margin: 5px 0; font-size: 0.85rem; color: #ccc; }
.next-match-card p i { color: var(--primary-red); margin-right: 5px; }

/* --- SPONSORS STRIP --- */
.sponsors-strip {
    background: white; padding: 20px 25px; border-radius: 12px;
    box-shadow: var(--card-shadow); margin-top: 10px; text-align: center;
}
.sponsors-label {
    font-family: var(--font-heading); font-size: 0.65rem; font-weight: 800;
    letter-spacing: 2px; color: #aaa; margin: 0 0 15px; text-transform: uppercase;
}
.sponsors-logos { display: flex; align-items: center; justify-content: center; gap: 30px; flex-wrap: wrap; }
.sponsor-logo {
    max-height: 50px; max-width: 120px; object-fit: contain;
    filter: grayscale(40%); opacity: 0.8; transition: 0.3s;
}
.sponsor-logo:hover { filter: grayscale(0%); opacity: 1; }

/* --- TRAINING CARDS --- */
.training-day { font-size: 1.05rem; margin-bottom: 8px; }
.training-notes { color: #888; font-size: 0.85rem; margin: 4px 0 0; }
.training-notes i { color: var(--secure-gold); margin-right: 4px; }

/* --- REPORTS TABS --- */
.reports-tab { display: none; }
.reports-tab.active { display: block; }

/* --- LEAGUE TABLE --- */
.table-wrapper { overflow-x: auto; }
.league-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.league-table thead tr { background: var(--dark-bg); }
.league-table th {
    padding: 10px 8px; color: white;
    font-family: var(--font-heading); font-size: 0.65rem; font-weight: 800;
    letter-spacing: 1px; text-transform: uppercase; text-align: center;
}
.league-table th:nth-child(2) { text-align: left; }
.league-table td { padding: 10px 8px; border-bottom: 1px solid #f0f0f0; text-align: center; }
.league-table td:nth-child(2) { text-align: left; font-weight: 700; }
.league-table .our-row { background: #fff8f8; }
.league-table .our-row td { color: var(--primary-red); font-weight: 800; }
.league-table tbody tr:hover { background: #f8f9fa; }
.team-name { min-width: 130px; }
.our-star { font-size: 0.7rem; vertical-align: middle; }

/* --- GALLERY --- */
.gallery-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 600px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item {
    position: relative; border-radius: 10px; overflow: hidden;
    cursor: pointer; aspect-ratio: 4/3; background: #eee;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; display: block; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white; padding: 8px 10px; font-size: 0.75rem; font-weight: 700;
    opacity: 0; transition: 0.3s;
}
.gallery-item:hover .gallery-caption { opacity: 1; }

/* --- LIGHTBOX --- */
#lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 2000;
    flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
#lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 8px; }
#lightbox p { color: #ccc; margin: 12px 0 0; font-size: 0.9rem; text-align: center; }
.lightbox-close {
    position: absolute; top: 20px; right: 20px; background: none; border: none;
    color: white; font-size: 2rem; cursor: pointer; opacity: 0.7; line-height: 1;
}
.lightbox-close:hover { opacity: 1; }

/* --- SQUAD --- */
.squad-group { margin-bottom: 25px; }
.squad-position {
    font-family: var(--font-heading); font-size: 0.65rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px; color: #888;
    margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid #eee;
}
.squad-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.squad-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: #f8f9fa; border-radius: 8px; border: 1px solid #eee;
    transition: 0.2s;
}
.squad-card:hover { border-color: var(--primary-red); background: #fff; }
.squad-number {
    font-family: var(--font-heading); font-weight: 900; font-size: 1rem;
    color: var(--primary-red); min-width: 20px; text-align: center;
}
.squad-name { font-size: 0.9rem; font-weight: 700; }

/* --- PARENTS TABS --- */
.parents-tab { display: none; }
.parents-tab.active { display: block; }

/* --- COACHES TABS --- */
.coaches-tab { display: none; }
.coaches-tab.active { display: block; }

/* --- LAST MATCH WIDGET --- */
.last-match-widget {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: white; padding: 20px 25px; border-radius: 12px; margin-bottom: 20px;
    border-left: 8px solid var(--success-green);
}
.last-match-label {
    font-family: var(--font-heading); font-size: 0.65rem; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase; color: #aaa;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.result-chip {
    padding: 2px 10px; border-radius: 4px; font-size: 0.65rem;
    letter-spacing: 1px; color: white; font-weight: 900;
}
.last-match-body { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.last-match-body h3 { margin: 0; font-size: 1.2rem; color: white; }
.last-match-score {
    font-family: var(--font-heading); font-size: 1.5rem; font-weight: 900;
    color: white; display: block; margin-top: 2px;
}
.last-match-widget p { margin: 5px 0; font-size: 0.85rem; color: #ccc; }
.last-match-widget p i { color: var(--success-green); margin-right: 5px; }
.last-match-summary { font-style: italic; color: #bbb !important; font-size: 0.8rem !important; margin-top: 8px !important; }
.last-match-widget .potm-badge { margin-top: 12px; background: rgba(255,153,0,0.15); border-color: rgba(255,153,0,0.4); color: #ffc966; }

/* --- LOGOUT BUTTON --- */
.btn-logout { background: #444; margin-top: 20px; }

/* --- STAT NUMBER COLOURS --- */
#stat-wins   { color: var(--success-green); }
#stat-draws  { color: var(--secure-gold); }
#stat-losses { color: var(--error-red); }
#stat-gf     { color: #1565c0; }
#stat-ga     { color: #888; }
.stat-box.goals-for i { color: #1565c0; }
.stat-box.goals-ag  i { color: #bbb; }

/* --- 6-BOX STAT GRID (override 2/4 col rules above) --- */
.season-summary { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 600px) { .season-summary { grid-template-columns: repeat(3, 1fr); } }
.stat-box { padding: 15px 10px; }

/* --- SECTION HEADER ICONS --- */
.section-header h2 i { font-size: 1.3rem; color: var(--primary-red); margin-right: 10px; vertical-align: middle; }

/* --- NEWS DATE (title-first layout) --- */
.news-date { margin-top: 4px; margin-bottom: 12px; }

/* --- COUNTDOWN CHIP --- */
.countdown-chip {
    display: inline-block; background: #e3f2fd; color: #1565c0;
    border: 1px solid #90caf9; padding: 2px 8px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 800; font-family: var(--font-heading);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* --- CARD ACTIONS ROW --- */
.card-actions {
    display: flex; align-items: center; gap: 15px; margin-top: 12px; flex-wrap: wrap;
}

/* --- iCAL BUTTON --- */
.ical-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7;
    padding: 6px 14px; border-radius: 6px; font-size: 0.8rem;
    font-weight: 700; font-family: var(--font-body); cursor: pointer; transition: 0.2s;
}
.ical-btn:hover { background: #2e7d32; color: white; }

/* --- SPONSOR ENHANCEMENTS --- */
.sponsor-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sponsor-name { font-family: var(--font-heading); font-weight: 800; font-size: 0.85rem; color: var(--dark-bg); }
.sponsors-thanks { font-size: 0.8rem; color: #888; margin: 12px 0 0; font-style: italic; }
.sponsor-logo { max-height: 70px; max-width: 200px; }

/* --- ADMIN FAB --- */
#admin-fab {
    position: fixed; bottom: 100px; right: 30px;
    width: 55px; height: 55px; background: #1a1a1a;
    border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.2rem; z-index: 998;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3); transition: 0.3s;
}
#admin-fab:hover { background: var(--primary-red); transform: scale(1.1); }

/* --- ADMIN OVERLAY & PANEL --- */
/* admin-overlay / admin-panel / admin-tab — modal removed; rules cleared */
.admin-panel { /* coach tab panels — layout handled inline */ }

/* --- SELECT & TEXTAREA FORM ELEMENTS --- */
select, textarea {
    width: 100%; padding: 14px 16px; border-radius: 8px; font-size: 0.9rem;
    font-family: var(--font-body); outline: none; box-sizing: border-box;
    border: 2px solid #eee; background: #fafafa; transition: 0.3s;
    margin-bottom: 15px; display: block;
}
select:focus, textarea:focus { border-color: var(--primary-red); background: white; }

/* --- STATS PANELS --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 16px; }
.stats-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; }
.stats-panel-title { font-family: var(--font-heading); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-blue); margin-bottom: 12px; }
.stats-list { list-style: none; padding: 0; margin: 0; }
.stats-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-color); }
.stats-row:last-child { border-bottom: none; }
.stats-rank { font-weight: 700; color: var(--accent-blue); min-width: 18px; font-size: 0.85rem; }
.stats-name { flex: 1; font-size: 0.9rem; }
.stats-value { font-weight: 700; font-size: 1.05rem; color: var(--secure-gold); }
.stats-clean-sheet-banner { text-align: center; padding: 12px 16px; background: var(--success-green); color: #fff; border-radius: 8px; font-weight: 700; font-family: var(--font-heading); font-size: 0.9rem; }

/* --- MATCH STAT LINES (in results list) --- */
.match-stat-line { font-size: 0.85rem; color: #aaa; margin: 5px 0 0; }
.clean-sheet-badge { display: inline-block; background: var(--success-green); color: #fff; font-size: 0.75rem; padding: 2px 10px; border-radius: 20px; margin-top: 7px; }

/* --- ADMIN STAT INPUTS --- */
.admin-section-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin: 12px 0 6px; }
.admin-squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.admin-squad-check { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; }
.admin-squad-check input { cursor: pointer; }
.admin-stat-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.admin-stat-row select { flex: 1; margin-bottom: 0; }
.admin-stat-row input[type=number] { width: 70px; margin-bottom: 0; }
.admin-add-btn { background: none; border: 1px dashed var(--accent-blue); color: var(--accent-blue); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; margin-bottom: 12px; transition: 0.2s; }
.admin-add-btn:hover { background: rgba(30,100,255,0.1); }
.admin-remove-btn { background: none; border: none; color: var(--error-red); cursor: pointer; font-size: 1rem; padding: 4px; line-height: 1; }
.admin-checkbox-label { display: flex; align-items: center; gap: 8px; margin: 10px 0 16px; font-size: 0.9rem; cursor: pointer; }

/* --- AVAILABILITY CARDS (parent view) --- */
.avail-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.avail-type-badge { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 9px; border-radius: 20px; margin-right: 6px; font-weight: 700; }
.avail-match { background: rgba(30,100,255,0.15); color: var(--accent-blue); }
.avail-training { background: rgba(76,175,80,0.15); color: var(--success-green); }
.avail-btns { display: flex; gap: 8px; flex-shrink: 0; }
.avail-btn, .unavail-btn { border: 1px solid var(--border-color); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 0.83rem; font-family: var(--font-heading); letter-spacing: 0.5px; transition: all 0.2s; background: rgba(255,255,255,0.05); color: #ccc; }
.avail-btn:hover { border-color: var(--success-green); color: var(--success-green); }
.unavail-btn:hover { border-color: var(--error-red); color: var(--error-red); }
.avail-btn-active { background: var(--success-green) !important; color: #fff !important; border-color: var(--success-green) !important; }
.unavail-btn-active { background: var(--error-red) !important; color: #fff !important; border-color: var(--error-red) !important; }

/* --- AVAILABILITY DASHBOARD (coach view) --- */
.coach-avail-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.coach-avail-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.coach-view-btn { background: none; border: 1px solid var(--accent-blue); color: var(--accent-blue); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 0.82rem; font-family: var(--font-heading); letter-spacing: 0.5px; transition: 0.2s; flex-shrink: 0; }
.coach-view-btn:hover { background: var(--accent-blue); color: #fff; }
.coach-response-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.response-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.chip-available { background: rgba(76,175,80,0.2); color: var(--success-green); }
.chip-unavailable { background: rgba(244,67,54,0.2); color: var(--error-red); }

/* Coach self-attendance row */
.coach-self-avail { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 0 4px; border-top: 1px solid var(--border-color); margin-top: 10px; }
.coach-self-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-blue); font-family: var(--font-heading); font-weight: 700; white-space: nowrap; }
textarea { resize: vertical; min-height: 80px; }

/* ===== ADMIN PANEL (coaches area) ===== */
.admin-section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.admin-section-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: #aaa; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 0.82rem; font-family: var(--font-heading); letter-spacing: 0.5px; transition: all 0.2s; }
.admin-section-btn.active, .admin-section-btn:hover { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }

/* Admin form cards */
.admin-form-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.admin-form-card h3 { font-family: var(--font-heading); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-blue); margin: 0 0 16px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.admin-form-grid input, .admin-form-grid select, .admin-form-grid textarea {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-color);
    color: var(--text-primary); border-radius: 8px; padding: 10px 12px;
    font-size: 0.88rem; font-family: var(--font-body); width: 100%; box-sizing: border-box;
}
.admin-form-grid input:focus, .admin-form-grid select:focus, .admin-form-grid textarea:focus { outline: none; border-color: var(--accent-blue); }
.admin-form-grid textarea { grid-column: 1 / -1; min-height: 80px; }
.admin-form-grid select option { background: var(--bg-secondary); }
.admin-submit-btn { background: var(--accent-blue); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-family: var(--font-heading); font-size: 0.88rem; letter-spacing: 0.5px; transition: opacity 0.2s; }
.admin-submit-btn:hover { opacity: 0.85; }
.admin-cancel-btn { background: none; border: 1px solid var(--border-color); color: #888; padding: 10px 16px; border-radius: 8px; cursor: pointer; font-size: 0.88rem; transition: all 0.2s; }
.admin-cancel-btn:hover { border-color: var(--error-red); color: var(--error-red); }

/* Admin item list */
.admin-item-list { display: flex; flex-direction: column; gap: 8px; }
.admin-item-row { display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 14px; flex-wrap: wrap; }
.admin-item-label { flex: 1; font-size: 0.9rem; min-width: 0; }
.admin-item-meta { font-size: 0.8rem; color: #888; }
.admin-edit-btn { background: none; border: 1px solid var(--accent-blue); color: var(--accent-blue); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 0.78rem; white-space: nowrap; transition: all 0.2s; }
.admin-edit-btn:hover { background: var(--accent-blue); color: #fff; }
.admin-delete-btn { background: none; border: 1px solid var(--error-red); color: var(--error-red); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 0.78rem; white-space: nowrap; transition: all 0.2s; }
.admin-delete-btn:hover { background: var(--error-red); color: #fff; }

/* ============================================================
   COACHES SECURE AREA — DARK COMMAND-CENTRE THEME
   All CSS custom properties used in coaches UI (--card-bg,
   --border-color, --text-primary, --bg-secondary, --accent-blue)
   are undefined in :root. Scope them here so everything renders.
   ============================================================ */

#coaches-secure-area {
    background: linear-gradient(160deg, #0d1117 0%, #111827 100%);
    border: 1px solid #1f2937;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    color: #e5e7eb;
    --card-bg:      #1a2332;
    --bg-secondary: #0d1117;
    --border-color: #2d3748;
    --text-primary: #e5e7eb;
    --accent-blue:  #3b82f6;
}

/* Heading */
#coaches-secure-area > h3 { color: #f9fafb; margin-top: 0; }

/* Season stat boxes */
#coaches-secure-area .stat-box {
    background: #1a2332;
    border-color: #2d3748;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#coaches-secure-area .stat-num  { color: #f9fafb; }
#coaches-secure-area .stat-label { color: #9ca3af; }
#coaches-secure-area .pc-text   { color: #f9fafb; }

/* Coaches sub-nav (Results / League / Stats / Availability / Admin) */
#coaches-secure-area .sub-btn {
    background: rgba(255,255,255,0.05);
    border-color: #2d3748;
    color: #9ca3af;
    box-shadow: none;
}
#coaches-secure-area .sub-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}
#coaches-secure-area .sub-btn:hover:not(.active) {
    background: rgba(59,130,246,0.12);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Filter buttons inside coaches results tab */
#coaches-secure-area .filter-btn {
    background: rgba(255,255,255,0.05);
    border-color: #2d3748;
    color: #9ca3af;
    box-shadow: none;
}

/* Native select & textarea */
#coaches-secure-area select,
#coaches-secure-area textarea {
    background: rgba(255,255,255,0.06);
    border: 2px solid #2d3748;
    color: #e5e7eb;
}
#coaches-secure-area select:focus,
#coaches-secure-area textarea:focus { border-color: #3b82f6; }
#coaches-secure-area select option  { background: #1a2332; }

/* ---- ADMIN SECTION POLISH ---- */

/* Section nav — active/hover = club red */
.admin-section-btn.active,
.admin-section-btn:hover { background: var(--primary-red); border-color: var(--primary-red); color: #fff; }

/* Save button — prominent, club red */
.admin-submit-btn {
    background: var(--primary-red);
    padding: 12px 28px;
    font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(204,0,0,0.4);
}
.admin-submit-btn:hover {
    opacity: 1;
    background: var(--hover-red);
    box-shadow: 0 6px 20px rgba(204,0,0,0.5);
    transform: translateY(-1px);
}

/* Edit button — blue */
.admin-edit-btn { border-color: #3b82f6; color: #3b82f6; }
.admin-edit-btn:hover { background: #3b82f6; }

/* Add row button — blue */
.admin-add-btn { border-color: #3b82f6; color: #3b82f6; }
.admin-add-btn:hover { background: rgba(59,130,246,0.12); }

/* Form card headings */
.admin-form-card h3 {
    color: #e2e8f0;
    border-bottom: 1px solid #2d3748;
    padding-bottom: 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

/* Section labels */
.admin-section-label { color: #9ca3af; margin-top: 16px; }

/* Item meta */
.admin-item-meta { color: #9ca3af; }

/* Checkbox label */
.admin-checkbox-label { color: #e5e7eb; }

/* Remove row button */
.admin-remove-btn { color: var(--error-red); }

/* Placeholder text readable on dark inputs */
#coaches-secure-area .admin-form-grid input::placeholder,
#coaches-secure-area .admin-form-grid textarea::placeholder { color: #6b7280; opacity: 1; }

/* Full-width save button on mobile */
@media (max-width: 600px) {
    .admin-submit-btn { width: 100%; display: block; text-align: center; }
    .admin-cancel-btn { width: 100%; display: block; text-align: center; }
}

/* Toast notifications */
.toast-notification {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: 8px; color: #fff; font-size: 0.9rem;
    z-index: 9999; pointer-events: none; white-space: nowrap;
    animation: toastFadeInOut 3.5s forwards;
}
.toast-success { background: var(--success-green); }
.toast-error   { background: var(--error-red); }
@keyframes toastFadeInOut {
    0%   { opacity: 0; transform: translateX(-50%) translateY(12px); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}