/* ========================================
   VukaSport - Estilos Globais (Corrigido)
   ======================================== */

:root {
    --primary-color: #28A745;
    --primary-dark: #1e7e34;
    --primary-light: #2ecc71;
    --status-live: #28A745;
    --status-finished: #6c757d;
    --status-scheduled: #17a2b8;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --text-main: #333333;
    --text-muted: #777777;
    --border-color: #e0e0e0;
    --shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.4;
}

[data-theme="dark"] {
    --light-bg: #121212;
    --white: #1e1e1e;
    --text-main: #f0f0f0;
    --text-muted: #aaaaaa;
    --border-color: #333333;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 20px;
    font-weight: 800;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background-color: #1e1e1e;
    padding: 10px 20px;
    gap: 10px;
}

.view-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ==========================================
   Competition Group — Flashscore Style
   ========================================== */
.competition-group {
    background: transparent;
    margin: 0 10px 14px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09);
}

[data-theme="dark"] .competition-group {
    box-shadow: 0 2px 14px rgba(0,0,0,0.35);
}

.competition-header {
    padding: 8px 14px;
    background: linear-gradient(135deg, #1a1f2e 0%, #141927 100%);
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid #FFC107;
}

[data-theme="dark"] .competition-header {
    background: linear-gradient(135deg, #0d1117 0%, #0a0e18 100%);
}

.comp-info {
    display: flex;
    align-items: center;
    gap: 7px;
}

.comp-name {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #e2e8f0;
}

/* ==========================================
   Match Card — OneFootball Style
   ========================================== */
.match-card {
    background: #ffffff;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background-color 0.12s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

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

.match-card:active {
    background-color: #f0faf3;
    transform: scale(0.993);
}

.match-card.live-card {
    border-left: 3px solid #28A745;
}

[data-theme="dark"] .match-card {
    background: #1e1e1e;
    border-bottom-color: #252525;
}

[data-theme="dark"] .match-card:active {
    background-color: #252d25;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.55s linear;
    background: rgba(40, 167, 69, 0.18);
    pointer-events: none;
}

@keyframes ripple-anim {
    to { transform: scale(4.5); opacity: 0; }
}

/* Team Sides */
.team-side {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.team-side.home {
    justify-content: flex-end;
    padding-right: 6px;
}

.team-side.away {
    justify-content: flex-start;
    padding-left: 6px;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.team-side.home .team-row {
    flex-direction: row;
}

.team-side.away .team-row {
    flex-direction: row-reverse;
}

.team-name {
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
    max-width: 85px;
    letter-spacing: -0.1px;
}

.team-shield {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: linear-gradient(145deg, #eaf7ed, #d4edda);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #1e7e34;
    flex-shrink: 0;
    border: 1.5px solid rgba(40,167,69,0.2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="dark"] .team-shield {
    background: linear-gradient(145deg, #1b2e1b, #1e361e);
    color: #4caf50;
    border-color: rgba(76,175,80,0.25);
}

/* Match Center */
.match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    flex-shrink: 0;
    gap: 5px;
}

/* Score Block */
.match-score {
    background: #111827;
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 3px;
    padding: 7px 13px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0,0,0,0.28);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.match-main-score {
    color: #ffffff;
}

.match-penalty-score {
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 4px;
    text-align: center;
    line-height: 1;
}

@keyframes score-pulse {
    0%, 100% { background: #111827; box-shadow: 0 3px 8px rgba(0,0,0,0.28); }
    50% { background: #28A745; box-shadow: 0 3px 14px rgba(40,167,69,0.55); }
}

.match-score.flashing {
    animation: score-pulse 0.65s ease-in-out;
}

[data-theme="dark"] .match-score {
    background: #080d15;
    box-shadow: 0 3px 10px rgba(0,0,0,0.55);
}

/* Status + Time Row */
.status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.match-status {
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    white-space: nowrap;
}

.status-live-text {
    color: #28A745;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.status-live-dot {
    width: 5px;
    height: 5px;
    background-color: #28A745;
    border-radius: 50%;
    flex-shrink: 0;
    animation: live-blink 1.3s ease-in-out infinite;
}

@keyframes live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

.status-halftime-text {
    color: #FF9800;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.status-extra-text {
    color: #9C27B0;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* Time Badge (inline, below score) */
.match-time-badge {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

[data-theme="dark"] .match-time-badge {
    color: #64748b;
}

/* Modal de Apoio */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.support-qr {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Footer */
.footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsivo */
@media (max-width: 480px) {
    .competition-group {
        margin: 0 6px 12px;
        border-radius: 14px;
    }
    .match-card {
        padding: 12px 10px;
        gap: 2px;
    }
    .team-name {
        font-size: 12px;
        max-width: 72px;
    }
    .match-score {
        font-size: 16px;
        padding: 6px 10px;
        letter-spacing: 2px;
    }
    .match-penalty-score {
        font-size: 10px;
        margin-top: 3px;
    }
    .match-center {
        min-width: 80px;
    }
    .team-shield {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}
