:root {
    color-scheme: dark;
    --primary: #10db93;         /* Verde esmeralda brillante de alto contraste */
    --primary-hover: #05b075;   /* Tono hover correspondiente */
    --primary-dark: #036b47;    /* Verde oscuro para insignias o acentos */
    --bg-color: #080c14;        /* Azul espacio profundo */
    --surface-color: #121b2d;   /* Azul medianoche de alto contraste para tarjetas */
    --text-main: #f8fafc;
    --text-muted: #a5b6ce;      /* Mayor brillo en textos secundarios */
    --accent: #3b82f6;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.08); /* Borde sutil y elegante */
    
    /* Variables de compatibilidad interna para asegurar compatibilidad */
    --surface: var(--surface-color);
    --background: var(--bg-color);
    --text: var(--text-main);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Container & Typography */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Auth Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-card h2 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-block {
    display: block;
    width: 100%;
}

.mt-4 {
    margin-top: 1.5rem;
}

.alert {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* =========================================
   Dashboard & Match Cards Styles
   ========================================= */
.dashboard-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.match-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.closed-match {
    opacity: 0.8;
    border-color: #ef4444;
}

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

.badge {
    background: var(--primary-dark);
    color: var(--text);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-group {
    background: #334155;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.team {
    flex: 1;
}

.vs {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0 10px;
}

.match-meta {
    text-align: center;
    color: var(--text-muted);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.prediction-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.score-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.score-input {
    width: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text);
    border-radius: 8px;
}

.score-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn-sm {
    padding: 0.5rem;
    font-size: 0.9rem;
}

.match-result {
    text-align: center;
}

.score-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0.5rem 0;
}

.points-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* =========================================
   Custom Modal Styles
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin-top: 0;
    color: var(--text-main);
}

.modal-content p {
    color: var(--text-muted);
    margin: 1.5rem 0;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* =========================================
   Mobile Bottom Navigation & Bottom Sheet
   ========================================= */

/* Desktop only elements by default */
.mobile-bottom-nav,
.bottom-sheet-overlay {
    display: none !important;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    /* Hide desktop nav links */
    .nav-links {
        display: none;
    }
    
    /* Ensure body has padding so content doesn't hide behind bottom nav */
    body {
        padding-bottom: 70px; 
    }

    /* Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 900;
        justify-content: space-around;
        padding: 0.5rem 0;
        backdrop-filter: blur(10px);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.75rem;
        flex: 1;
        transition: color 0.2s;
        background: none;
        border: none;
        cursor: pointer;
    }

    .mobile-nav-item i {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item:focus {
        color: var(--primary);
    }

    /* Bottom Sheet Menu */
    .bottom-sheet-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        display: none !important; /* Managed by JS */
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .bottom-sheet-overlay.active {
        display: block !important;
        opacity: 1;
    }

    .bottom-sheet-content {
        position: absolute;
        bottom: -100%;
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        border-radius: 20px 20px 0 0;
        padding: 1.5rem;
        transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
    }

    .bottom-sheet-overlay.active .bottom-sheet-content {
        bottom: 0;
    }

    .bottom-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .bottom-sheet-header h3 {
        margin: 0;
        font-size: 1.2rem;
    }

    .close-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.5rem;
        cursor: pointer;
    }

    .bottom-sheet-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .bottom-sheet-links a {
        display: flex;
        align-items: center;
        color: var(--text-main);
        text-decoration: none;
        padding: 1rem;
        border-radius: 10px;
        transition: background-color 0.2s;
        font-weight: 500;
        font-size: 1.1rem;
    }

    .bottom-sheet-links a i {
        margin-right: 1rem;
        font-size: 1.4rem;
        color: var(--text-muted);
    }

    .bottom-sheet-links a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .bottom-sheet-links a.text-danger i {
        color: var(--danger);
    }
}

/* ==========================================================================
   GLOBAL ACTIVE NEWS TICKER (MARQUEE)
   ========================================================================== */
.news-ticker-container {
    width: 100%;
    color: var(--text-main);
    display: none;
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 38px;
    z-index: 1000;
}

/* Tailored harmonious glassmorphic gradients */
.news-ticker-container.ticker-info {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    border-bottom: 1px solid rgba(16, 185, 129, 0.35);
}

.news-ticker-container.ticker-warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}

.news-ticker-container.ticker-error {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.35);
}

.ticker-wrapper {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.ticker-content strong {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
    margin-right: 0.5rem;
}

@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.close-ticker-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1001;
}

.close-ticker-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

