/* 
 * LiveScore Indonesia Premium Style
 * Mobile First Approach
 */

:root {
    /* Colors - Dark Theme Premium */
    --bg-main: #121212;
    --bg-card: #1E1E1E;
    --bg-header: #000000;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B3B8;

    /* Accents */
    --primary: #00FF88;
    /* Neon Green */
    --primary-dim: rgba(0, 255, 136, 0.1);
    --danger: #FF3B30;
    /* Live Red */
    --warning: #FFCC00;

    /* UI Elements */
    --border-color: #2C2C2C;
    --nav-height: 60px;
    --header-height: 60px;
    --radius-sm: 8px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding-bottom: calc(var(--nav-height) + 60px);
    /* Space for bottom nav + sticky ad */
}

/* --- Layout Utilities --- */
.container {
    padding: 0 16px;
}

.hidden {
    display: none !important;
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: 700;
    color: var(--text-primary);
}

.small-date {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Header --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-header);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
}

.logo-text {
    font-size: 18px;
    letter-spacing: -0.5px;
}

.logo-text .highlight {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.icon-btn:hover {
    color: var(--text-primary);
}

/* --- Ads --- */
.ad-banner {
    width: 100%;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.top-banner {
    padding: 0;
}

.in-feed-ad {
    margin: 16px 0;
    padding: 10px 0;
    background-color: transparent;
}

.ad-placeholder {
    width: 320px;
    height: 50px;
    background: #333;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 1px dashed #444;
}

.in-feed-ad .ad-placeholder {
    height: 250px;
    width: 300px;
}

.sticky-footer-ad {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    width: 100%;
    background: #1a1a1a;
    z-index: 90;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.close-ad-btn {
    align-self: flex-end;
    margin-right: 10px;
    margin-bottom: 2px;
    background: none;
    border: 1px solid #333;
    color: #777;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

/* --- Sport Filter --- */
.sport-filter {
    display: flex;
    overflow-x: auto;
    padding: 12px 16px;
    gap: 12px;
    background: var(--bg-main);
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.sport-filter::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome */
}

.filter-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-item.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Date Filter --- */
.date-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.date-nav-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.current-date {
    font-weight: 600;
    text-align: center;
}

.calendar-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* --- Match List & Cards --- */
.content-container {
    padding: 0 12px;
}

.section-header {
    display: flex;
    align-items: center;
    margin: 16px 0 10px;
    gap: 8px;
}

.section-header h2 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.live-header h2 {
    color: var(--text-primary);
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 59, 48, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* --- Loading Spinner --- */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* --- Modal & Prediction --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Bottom sheet on mobile */
    opacity: 0;
    visibility: hidden;
    /* Fix: Hides it from clicks */
    pointer-events: none;
    /* Fix: Clicks pass through */
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Bottom Nav --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    /* Glassmorphism Effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(30, 30, 30, 0.95);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    gap: 4px;
    padding: 8px;
    flex: 1;
    /* Auto width */
}

.nav-item.active {
    color: var(--primary);
}


/* --- Match Card Components --- */
.match-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.match-card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.league-name {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.match-time {
    font-weight: 700;
}

.match-time.live {
    color: var(--danger);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

.card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.team-logo {
    width: 36px;
    height: 36px;
    background: #252525;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    /* Placeholder for emoji/icon */
}

.team-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    max-width: 100px;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
}

.score-board {
    background: #000;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    border: 1px solid #333;
    min-width: 80px;
    text-align: center;
}

.score-status {
    font-size: 10px;
    color: var(--text-secondary);
}

/* --- Actions --- */
.card-actions {
    display: flex;
    justify-content: center;
    /* Centered visually, but favorite is absolute usually */
    margin-top: 12px;
    border-top: 1px solid #2a2a2a;
    padding-top: 8px;
}

.prediction-btn {
    font-size: 11px;
    color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.favorite-btn.active {
    color: var(--warning);
}

/* --- Klasemen & Stats Styles --- */
.league-nav-container {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    background: var(--bg-main);
}

.league-nav-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 4px;
    gap: 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.league-nav-scroll::-webkit-scrollbar {
    display: none;
}

.league-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    padding: 12px 4px;
    /* Vertical padding + Border space */
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    letter-spacing: 0.5px;
}

.league-nav-item.active {
    color: var(--primary);
}

.league-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 6px rgba(0, 255, 136, 0.4);
}

.sub-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 25px;
    background: #000;
    padding: 4px;
    border-radius: 30px;
    display: inline-flex;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid #222;
}

.sub-tab {
    background: none;
    border: none;
    color: #666;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab.active {
    background: #333;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.standings-table th,
.standings-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.standings-table th {
    background: #151515;
    color: #777;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.standings-table td.team-cell {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.standings-table img {
    width: 20px;
    height: 20px;
}

.pos-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin: 0 auto;
}

.pos-1 {
    background: var(--primary);
    color: #000;
}

.pos-2,
.pos-3,
.pos-4 {
    background: rgba(0, 255, 136, 0.2);
    color: var(--primary);
}

.pos-danger {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger);
}

/* Top Scorers */
.top-player-card {
    background: var(--bg-card);
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.rank-num {
    font-size: 16px;
    font-weight: 900;
    color: #444;
    width: 25px;
    text-align: center;
}

.rank-1 {
    color: var(--warning);
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.player-team {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-stat {
    text-align: right;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 10px;
    color: #777;
    text-transform: uppercase;
}