/* ─────────────────────────────────────────────
   THEFOOTBALL.LIVE - Complete Design
   ───────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 12px 0 80px 0;
}

/* ─── TOP HEADER ─── */
.top-header {
    background: var(--bg-header);
    border-bottom: 2px solid var(--border);
    padding: 12px 0;
    transition: background 0.3s ease;
}

.top-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* ─── LEFT: Logo ─── */
.header-left {
    flex-shrink: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 22px;
}

.site-logo .logo-icon {
    font-size: 28px;
}

.site-logo .logo-text {
    letter-spacing: -0.5px;
}

/* ─── MIDDLE: LIVE + Date ─── */
.header-middle {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

/* LIVE Button - Bigger */
.live-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
}

.live-toggle .live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--live);
    transition: background 0.3s ease;
}

.live-toggle .live-text {
    transition: color 0.3s ease;
}

.live-toggle.active {
    border-color: var(--live);
    background: var(--live-bg);
}

.live-toggle.active .live-text {
    color: var(--live);
}

.live-toggle.active .live-dot {
    background: var(--live);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.live-toggle:not(.active) .live-dot {
    background: #888;
}

.live-toggle:not(.active) .live-text {
    color: #888;
}

/* Date Display - Bigger */
.date-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-display .date-label {
    text-transform: capitalize;
}

.date-display .date-full {
    color: var(--text-muted);
    font-weight: 400;
}

/* Calendar Button */
.calendar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.calendar-toggle:hover {
    color: var(--text-primary);
}

/* ─── RIGHT: Favourites + Sound + Search ─── */
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-btn {
    background: none;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-btn .header-btn-icon {
    font-size: 20px;
    line-height: 1;
}

/* ─── LEAGUE HEADER ─── */
.match-section {
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.league-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.league-header .league-flag {
    font-size: 22px;
    line-height: 1;
}

.league-header .league-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.league-header .league-country {
    font-size: 13px;
    color: var(--text-muted);
}

.league-header .league-round {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 500;
}

/* ─── MATCH ROW ─── */
.match-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.match-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
    gap: 12px;
    font-size: 15px;
}

.match-row:last-child {
    border-bottom: none;
}

.match-row:hover {
    background: var(--bg-hover);
}

/* Time */
.match-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 44px;
    flex-shrink: 0;
}

.match-time.live {
    color: var(--live);
}

.match-time.live .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    margin-right: 4px;
}

.match-time.ft {
    color: var(--ft);
}

/* Teams */
.match-teams {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.match-teams .team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
}

.match-teams .team .team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.match-teams .team .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-teams .team.home {
    justify-content: flex-start;
    flex: 1;
}

.match-teams .team.away {
    justify-content: flex-start;
    flex: 1;
}

/* Score */
.match-score {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 40px;
    justify-content: center;
}

.match-score .score-separator {
    color: var(--text-muted);
    font-weight: 300;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

/* ─── Error State ─── */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #FF5252;
}

.error-state .error-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.error-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.error-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-retry {
    margin-top: 16px;
    padding: 8px 24px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-retry:hover {
    background: var(--accent-hover);
}

/* ─── Footer ─── */
.site-footer {
    padding: 20px 0 12px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-powered a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-powered a:hover {
    color: var(--accent);
}

/* ─── Animations ─── */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .app-container {
        padding: 0 12px;
    }
    
    .top-header {
        padding: 8px 0;
    }
    
    .top-header-inner {
        gap: 10px;
    }
    
    .site-logo {
        font-size: 16px;
    }
    
    .site-logo .logo-icon {
        font-size: 20px;
    }
    
    .live-toggle {
        font-size: 12px;
        padding: 5px 12px;
        gap: 5px;
    }
    
    .live-toggle .live-dot {
        width: 7px;
        height: 7px;
    }
    
    .date-display {
        font-size: 13px;
    }
    
    .calendar-toggle {
        font-size: 18px;
    }
    
    .header-btn {
        font-size: 16px;
        padding: 5px 7px;
    }
    
    .header-btn .header-btn-icon {
        font-size: 16px;
    }
    
    .match-row {
        padding: 8px 12px;
        font-size: 13px;
        gap: 8px;
    }
    
    .match-time {
        font-size: 12px;
        min-width: 34px;
    }
    
    .match-teams .team {
        font-size: 13px;
    }
    
    .match-teams .team .team-logo {
        width: 18px;
        height: 18px;
    }
    
    .match-score {
        font-size: 14px;
        min-width: 30px;
    }
    
    .league-header {
        font-size: 13px;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .league-header .league-flag {
        font-size: 18px;
    }
    
    .league-header .league-name {
        font-size: 14px;
    }
    
    .league-header .league-country {
        font-size: 11px;
    }
    
    .league-header .league-round {
        font-size: 11px;
    }
}