:root {
    --bg-primary: #090a0e;
    --bg-secondary: #12141c;
    --glass-bg: rgba(25, 28, 41, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-red: #8a1538;
    --accent-red-hover: #b01a47;
    --gold: #dfa72b;
    --green-live: #2ec4b6;
    --text-primary: #ffffff;
    --text-secondary: #9ea4bb;
    --text-muted: #676d85;
    --font-family: 'Cairo', sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    padding-bottom: 40px;
}

/* Header Styles */
.app-header {
    background: linear-gradient(135deg, var(--accent-red) 0%, #3a0011 100%);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-wrapper {
    background: white;
    padding: 4px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.app-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 800;
}

.brand .subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.notify-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.notify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
}

.notify-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.notify-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.notify-btn svg {
    width: 16px;
    height: 16px;
}

/* App Container */
.app-container {
    max-width: 800px;
    margin: 24px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Sections */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title h2 svg {
    width: 22px;
    height: 22px;
}

.icon-gold { color: var(--gold); }
.icon-purple { color: #bb86fc; }

/* Live Indicator */
.live-indicator-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 196, 182, 0.15);
    color: var(--green-live);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--green-live);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.5; }
}

/* Matches Grid */
.matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Glassmorphism Card styling */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.match-card {
    padding: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.match-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Match Card Headers */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.match-stage {
    font-weight: 700;
}

.match-status {
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.match-status.live {
    background: rgba(46, 196, 182, 0.15);
    color: var(--green-live);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Match Teams and Scores */
.match-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.team.away {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.team-flag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.score-container {
    width: 80px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.team-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.score-divider {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Match details/date */
.match-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Standings styling */
.groups-tabs-wrapper {
    overflow-x: auto;
    margin-bottom: 12px;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}
.groups-tabs-wrapper::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.groups-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
}

.group-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.group-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.group-tab-btn.active {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.standings-card {
    padding: 12px;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.standings-table th, 
.standings-table td {
    padding: 12px 10px;
    text-align: center;
}

.standings-table th {
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.standings-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table .text-right {
    text-align: right;
}

.table-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-team-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rank-num {
    font-weight: 700;
    color: var(--text-muted);
}

tr:nth-child(1) .rank-num, 
tr:nth-child(2) .rank-num {
    color: var(--gold);
}

.points {
    font-weight: 800;
    color: var(--text-primary);
}

/* Spinner and Loaders */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    gap: 12px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer styling */
.app-footer {
    max-width: 800px;
    margin: 40px auto 0 auto;
    padding: 0 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pwa-install-tip {
    background: rgba(223, 167, 43, 0.08);
    color: var(--gold);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(223, 167, 43, 0.2);
    display: inline-block;
    align-self: center;
}

/* Responsive adjustments */
@media(max-width: 480px) {
    .brand h1 {
        font-size: 1.1rem;
    }
    .app-logo {
        width: 36px;
        height: 36px;
    }
    .notify-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    .team-name {
        font-size: 0.85rem;
    }
    .team-flag {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    .team-score {
        font-size: 1.25rem;
    }
}
