/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --dark-bg: #121212;
    --dark-gray: #1a1a1a;
    --mid-gray: #2c2c2c;
    --light-gray: #777777;
    --red: #E63946;
    --red-light: #FF6B6B;
    --red-gradient: linear-gradient(90deg, #E63946 0%, #FF6B6B 100%);
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --error-color: #FF4444;
    --error-light: #FF8888;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Prompt', sans-serif;
    line-height: 1.6;
}

/* ============ HEADER ============ */
.header {
    background: var(--mid-gray);
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid var(--red);
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    background: var(--red-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* ============ CONTAINER & MAIN ============ */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.main-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: calc(100vh - 400px);
}

/* ============ PROMO BANNER ============ */
.promo-banner {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.banner-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: var(--mid-gray);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    text-decoration: none;
    display: block;
}

.banner-item:hover {
    transform: translateY(-5px);
}

.banner-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============ MATCHES SECTION ============ */
.matches-section {
    background: linear-gradient(135deg, var(--mid-gray) 0%, var(--dark-gray) 100%);
    border-radius: 8px;
    padding: 30px;
    border: 1px solid rgba(230, 57, 70, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.matches-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--red-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.matches-section h2 svg {
    width: 32px;
    height: 32px;
    fill: var(--red);
    -webkit-text-fill-color: var(--red);
}

/* ============ MATCHES GRID ============ */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-light);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    grid-column: 1 / -1;
}

/* ============ MATCH CARD ============ */
.match-card {
    background: linear-gradient(135deg, var(--mid-gray) 0%, var(--dark-gray) 100%);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.match-card:hover {
    border-color: var(--red);
    box-shadow: 0 8px 20px rgba(230, 57, 70, 0.2);
    transform: translateY(-5px);
}

.match-card.live {
    border-color: var(--error-color);
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.05) 0%, var(--dark-gray) 100%);
}

.match-card.live::before {
    content: "LIVE";
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--error-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ---- Match Header ---- */
.match-header {
    padding: 15px;
    border-bottom: 1px solid rgba(230, 57, 70, 0.1);
}

.league-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.league-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(230, 57, 70, 0.1);
}

.league-name {
    font-size: 0.85rem;
    color: var(--red-light);
    font-weight: 600;
}

.match-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ---- Match Body ---- */
.match-body {
    padding: 20px;
    flex-grow: 1;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.team {
    flex: 1;
    text-align: center;
}

.team-logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 8px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(230, 57, 70, 0.1);
    padding: 5px;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.vs {
    font-size: 1.2rem;
    color: var(--red);
    font-weight: 700;
    min-width: 60px;
}

.score {
    font-size: 1.1rem;
    color: var(--red-light);
    font-weight: 700;
    min-width: 60px;
}

/* ---- Match Footer ---- */
.match-footer {
    padding: 15px;
    border-top: 1px solid rgba(230, 57, 70, 0.1);
    display: flex;
    gap: 10px;
}

.odds-box {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: rgba(230, 57, 70, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.odds-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.odds-value {
    font-size: 0.95rem;
    color: var(--red-light);
    font-weight: 700;
}

.watch-btn {
    flex: 1;
    background: var(--red-gradient);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Prompt', sans-serif;
}

.watch-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(230, 57, 70, 0.3);
}

.watch-btn:disabled {
    background: var(--light-gray);
    cursor: not-allowed;
    opacity: 0.5;
}

.watch-btn svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* ============ MODAL (PLAYER) ============ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 70vh;
    background: var(--mid-gray);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(230, 57, 70, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s ease;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--red-light);
    transform: scale(1.1);
}

#player-container {
    width: 100%;
    height: 100%;
    background: #000;
}

/* ============ FIXED ADS ============ */
.fixed-ad {
    position: fixed;
    z-index: 1000;
    max-width: 300px;
    height: auto;
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.3);
    border-radius: 8px;
    overflow: hidden;
    background: var(--mid-gray);
}

.fixed-ad.right {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.fixed-ad.left {
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.fixed-ad.bottom {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
}

.fixed-ad img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.fixed-ad a {
    text-decoration: none;
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--red);
    color: white;
}

.fixed-ad.bottom .close-btn {
    right: 10px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .matches-grid {
        grid-template-columns: 1fr;
    }

    .matches-section {
        padding: 20px;
    }

    .match-card {
        margin: 0;
    }

    .modal-content {
        width: 95%;
        height: 60vh;
    }

    .fixed-ad.right,
    .fixed-ad.left {
        max-width: 200px;
        top: auto;
        bottom: 120px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .matches-section h2 {
        font-size: 1.3rem;
    }

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

    .watch-btn, .odds-box {
        min-height: 40px;
    }

    .fixed-ad.right,
    .fixed-ad.left {
        display: none;
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}