:root {
    --primary-color: #007bff;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
        /* Space for bottom tab bar */
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header & Nav */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}


.header-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-right: 12px;
    transition: transform 0.3s;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 64px;
    padding: 10px 15px;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-links li {
    display: flex;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 14px;
    padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Match List */
.match-section {
    margin-top: 20px;
}

.date-header {
    font-size: 16px;
    font-weight: 700;
    margin: 30px 0 15px 0;
    padding: 12px 20px;
    background: linear-gradient(90deg, var(--primary-color), #3b82f6);
    color: white;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.match-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.match-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(5px);
    text-decoration: none;
    color: inherit;
    gap: 10px;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.match-time {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 50px;
    font-size: 14px;
}

.match-league {
    color: var(--text-muted);
    font-size: 12px;
    width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
    /* Hide on small mobile, show on tablet */
}

.match-info {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
}

.team-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.team-box.home {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.team-box.away {
    flex-direction: row;
    justify-content: flex-start;
}

.team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 500;
}

.team-logo {
    width: auto;
    height: auto;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.match-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    white-space: nowrap;
    text-align: center;
    min-width: 65px;
}

/* Responsive adjustments */
@media (min-width: 640px) {
    .match-league {
        display: block;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 5px;
    }

    .nav {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 15px;
    }

    .header-brand {
        flex-direction: row;
        margin-bottom: 0;
        justify-content: center;
    }

    .logo-img {
        margin-right: 12px !important;
    }

    .nav-links {
        justify-content: center;
        width: 100%;
        gap: 12px;
        margin-top: 15px;
        /* Added spacing from logo */
    }

    .date-header {
        width: calc(100% + 10px) !important;
        text-align: center;
        border-radius: 0;
        margin-left: -5px;
        margin-right: -5px;
        padding: 12px 0;
        display: block;
        box-shadow: none;
    }

    .match-card {
        padding: 10px 4px;
        gap: 4px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .match-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .team-box {
        flex-direction: column !important;
        gap: 5px;
        text-align: center;
    }

    .team-name {
        font-size: 12px;
    }

    .team-logo {
        max-width: 36px;
        max-height: 36px;
    }

    .header-brand h1 {
        font-size: 22px !important;
        margin: 0;
    }

    .nav-links a {
        font-size: 14px;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .match-info {
        gap: 2px;
        flex: 1;
        min-width: 0;
    }

    .match-time {
        min-width: 38px;
        font-size: 11px;
    }

    .match-status {
        min-width: 55px;
        padding: 4px 4px;
        font-size: 9px;
    }

    .team-name {
        font-size: 11px;
        word-break: break-all;
    }
}

/* Detail Page Refined */
.match-detail-box {
    margin-top: 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.detail-header {
    margin-bottom: 40px;
}

.detail-time {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.detail-league-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.detail-status-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
}

.detail-status-text.is-live {
    color: #ef4444;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.detail-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.detail-logo-wrapper {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    padding: 15px;
    border: 1px solid var(--glass-border);
}

.detail-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-team-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Remove white-space: nowrap to allow wrapping on mobile if needed */
}

.detail-vs-block {
    text-align: center;
}

.detail-vs-text {
    font-size: 40px;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -2px;
}

@media (max-width: 640px) {
    .match-detail-box {
        padding: 30px 10px;
    }

    .detail-content {
        grid-template-columns: 1fr 50px 1fr;
        gap: 8px;
    }

    .detail-logo-wrapper {
        width: 64px;
        height: 64px;
        padding: 10px;
        margin-bottom: 10px;
    }

    .detail-team-name {
        font-size: 16px;
    }

    .detail-vs-text {
        font-size: 24px;
    }

    .detail-header {
        margin-bottom: 25px;
    }
}

.status-live {
    background: #ef4444;
    animation: pulse 2s infinite;
}

.status-finished {
    background: #4b5563;
    color: #9ca3af;
}

.status-upcoming {
    background: #0ea5e9;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Mobile Bottom Tab Bar */
.mobile-tab-bar {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .mobile-tab-bar {
        display: flex;
    }
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: color 0.3s;
    gap: 4px;
}

.tab-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    /* Cleaner lines */
}

.tab-item.active svg {
    filter: drop-shadow(0 0 8px var(--primary-color));
}

.tab-item:hover,
.tab-item.active {
    color: var(--primary-color);
}