/* Design System & CSS Variables */
:root {
    /* Color Palette */
    --bg-dark: #0a0e17;
    --bg-darker: #05070a;
    --glass-bg: rgba(20, 26, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --primary-neon: #00ff88;
    --primary-neon-dim: rgba(0, 255, 136, 0.2);
    --secondary-accent: #3b82f6;
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    --card-hover: rgba(255, 255, 255, 0.03);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Spacing & Layout */
    --nav-height: 70px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 255, 136, 0.05), transparent 25%);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .text-brand {
    font-family: 'Outfit', sans-serif;
}

ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; background: none; }

/* Utilities */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
}

.mt-4 { margin-top: 1.5rem; }
.w-100 { width: 100%; }

/* Navigation */
.navbar {
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.icon-brand { color: var(--primary-neon); }
.text-brand span { color: var(--primary-neon); }

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.balance small {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.balance span {
    font-weight: 700;
    color: var(--text-primary);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-neon);
}

/* Main Layout */
.app-container {
    display: grid;
    grid-template-columns: 250px 1fr 320px;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - var(--nav-height));
}

.ranking-container, .quiniela-container {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - var(--nav-height));
}

.sidebar {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Filter Panel */
.filter-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.tournament-list li {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.tournament-list li:hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

.tournament-list li.active {
    background: var(--primary-neon-dim);
    color: var(--primary-neon);
    font-weight: 600;
}

.tournament-list li.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Action Cards */
.group-card {
    background: var(--card-hover);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--secondary-accent);
}

/* Feed Container */
.feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-pills {
    display: flex;
    gap: 0.5rem;
}

.pill {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.pill:hover, .pill.active {
    background: var(--text-primary);
    color: var(--bg-dark);
    font-weight: 600;
}

/* Match Cards */
.matches-grid {
    display: grid;
    gap: 1rem;
}

.match-card {
    padding: 1.5rem;
    transition: transform 0.2s;
}

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

.match-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.status.live { color: var(--danger); }
.status.upcoming { color: var(--text-secondary); }
.competition { color: var(--text-secondary); }

.anim-pulse {
    animation: pulse 2s infinite;
}

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

.teams-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.team:last-child {
    flex-direction: row-reverse;
}

.flag {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

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

.score {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.vs {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 1rem;
}

/* Odds Buttons */
.odds-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.odd-btn {
    background: var(--card-hover);
    border: 1px solid var(--glass-border);
    padding: 0.8rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.odd-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.odd-btn.selected {
    background: var(--primary-neon);
    color: var(--bg-darker);
    border-color: var(--primary-neon);
    box-shadow: 0 0 15px var(--primary-neon-dim);
}

.odd-btn .label { font-size: 0.9rem; font-weight: 600; opacity: 0.8; }
.odd-btn .value { font-weight: 800; }

/* Bet Slip Simulation */
.bet-slip {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.bet-slip-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.bet-slip-header h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: var(--primary-neon);
    color: var(--bg-dark);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.bet-selections-container {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Individual Selection Item */
.selection-item {
    background: var(--card-hover);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 0.8rem;
    position: relative;
    border-left: 3px solid var(--primary-neon);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.sel-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sel-match { font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; font-size: 0.9rem;}

.sel-odds {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sel-pick {
    background: var(--primary-neon-dim);
    color: var(--primary-neon);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
}

.sel-val { font-weight: 800; }

.remove-sel {
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--text-secondary);
    background: none;
    padding: 5px;
}

.remove-sel:hover { color: var(--danger); }

/* Bet Slip Footer */
.bet-slip-footer {
    padding: 1.5rem;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--glass-border);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.stake-input {
    margin-bottom: 1rem;
}

.stake-input label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
}

.input-wrapper span, .input-wrapper select {
    color: var(--text-secondary);
    margin-right: 0.5rem;
    font-weight: 600;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}

.input-wrapper select option {
    background: var(--bg-darker);
    color: var(--text-primary);
}

.input-wrapper input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    outline: none;
}

.highlight {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.highlight-green {
    color: var(--primary-neon);
    font-size: 1.5rem;
    font-weight: 800;
}

.btn-primary {
    background: var(--primary-neon);
    color: var(--bg-darker);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 800;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--primary-neon-dim);
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr 320px;
    }
    .filter-panel { display: none; }
}

@media (max-width: 768px) {
    .global-filters {
        max-width: 100% !important; /* Expansion full width en mobiles */
    }
    
    .feed-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-container, .ranking-container, .quiniela-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .bet-slip { display: none; }
    
    .navbar { height: auto; padding: 1rem; flex-wrap: wrap; gap: 1rem; }
    .nav-links { width: 100%; justify-content: space-between; order: 3; padding-top: 0.5rem; border-top: 1px solid var(--glass-border); }
    .user-profile { order: 2; }

    /* Forzar contención de tarjetas para evitar scroll horizontal en 320px */
    .matches-grid { grid-template-columns: 1fr !important; }
    .teams-container { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .team { width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 1rem; }
    .team .team-name { font-size: 1rem; }
    .team .flag { width: 30px !important; height: 30px !important; }
    .team .score { margin-left: auto; font-size: 1.5rem; }
    .team:last-child { flex-direction: row; }
    .vs { display: none; }
    
    .odds-container { grid-template-columns: 1fr; gap: 0.5rem; }
    .odd-btn { padding: 1rem; }
    .odd-btn .label { font-size: 1rem; }
    .odd-btn .value { font-size: 1.1rem; }
}

/* ==========================================
   FASE 11: PORTAL MUNDIAL 2026
========================================== */
.world-cup-portal {
    display: none;
    margin-top: 2rem;
    animation: slideIn 0.4s ease;
}

.wc-section-title {
    color: var(--primary-neon);
    margin: 3rem 0 1.5rem 0;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-neon-dim);
    padding-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2rem;
}

.standings-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    color: var(--text-primary);
}

.standings-table th, .standings-table td {
    padding: 1rem 0.8rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.standings-table th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    background: rgba(0,0,0,0.2);
}

.standings-table td.team-cell {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
}

.standings-table tr:hover {
    background: var(--card-hover);
}

.pts-col {
    color: var(--primary-neon);
    font-weight: 800;
    font-size: 1.1rem;
}

.knockout-bracket {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.ko-round-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
