/* =============================================================
   QUINELAS SAAS - Estilos Principales
   Versión: 2.0.0 — Mobile-first, Footer sticky, Cart
   ============================================================= */

/* -- Variables & Reset -- */
:root {
    --color-primario: #0d6efd;
    --color-fondo: #f0f2f5;
    --color-superficie: #ffffff;
    --radio-borde: 1rem;
    --sombra-suave: 0 4px 24px rgba(0, 0, 0, .08);
    --fuente: 'Inter', system-ui, -apple-system, sans-serif;
    --transicion: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--fuente);
    background: var(--color-fondo);
    color: #1a1d23;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -- Utilidades -- */
.fw-black { font-weight: 900 !important; }

/* ============================================================
   LAYOUT — Sticky Footer
   ============================================================ */
main { flex: 1 0 auto; }

/* ============================================================
   NAVBAR
   ============================================================ */
#navPrincipal {
    background: linear-gradient(135deg, var(--color-primario) 0%, color-mix(in srgb, var(--color-primario) 80%, #000) 100%);
    box-shadow: 0 2px 20px rgba(0,0,0,.15);
    z-index: 1030;
}

#navPrincipal .navbar-brand {
    font-size: 1.15rem;
    letter-spacing: -.02em;
}

#navPrincipal .nav-link {
    font-size: .88rem;
    font-weight: 500;
    padding: .4rem .65rem;
    border-radius: .5rem;
    transition: background .15s;
}
#navPrincipal .nav-link:hover {
    background: rgba(255,255,255,.15);
}

/* ============================================================
   HERO DE JORNADA
   ============================================================ */
.jornada-hero {
    background: linear-gradient(135deg, var(--color-primario) 0%, #0a3d62 100%);
    box-shadow: var(--sombra-suave);
}

/* ============================================================
   TARJETAS DE PUNTOS
   ============================================================ */
.puntos-card {
    background: var(--color-superficie);
    border: 2px solid #e9ecef;
    transition: border-color var(--transicion), transform var(--transicion);
}
.puntos-card:hover {
    border-color: var(--color-primario);
    transform: translateY(-2px);
}

/* ============================================================
   TARJETA DE APOSTADOR
   ============================================================ */
.card-apostador {
    border: 2px solid #e9ecef;
    border-radius: var(--radio-borde);
    transition: border-color var(--transicion);
}
.card-apostador:focus-within {
    border-color: var(--color-primario);
    box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--color-primario) 20%, transparent);
}

/* ============================================
   QUINIELA L/E/V — Base Styles
   (Layout is in the view's inline <style>)
   ============================================ */
.btn-lev {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    background: #fff;
    font-weight: 800;
    font-size: .85rem;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
    color: #6c757d;
}
.btn-lev:hover { transform: scale(1.12); }
.btn-lev.activo-L { background:#198754; border-color:#198754; color:#fff; box-shadow: 0 2px 8px rgba(25,135,84,.4); }
.btn-lev.activo-E { background:#ffc107; border-color:#ffc107; color:#212529; box-shadow: 0 2px 8px rgba(255,193,7,.4); }
.btn-lev.activo-V { background:#0d6efd; border-color:#0d6efd; color:#fff; box-shadow: 0 2px 8px rgba(13,110,253,.4); }
.partido-quinela.seleccionado { background: #f0fff4; }
.partido-quinela.seleccionado .btn-lev:not(.activo-L):not(.activo-E):not(.activo-V) { opacity: .5; }

.logo-mini {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    display: block;
}
.logo-mini-placeholder {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    background: linear-gradient(135deg,#6f42c1,#0d6efd);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .7rem;
    flex-shrink: 0;
}

/* ============================================================
   LOGO DE EQUIPO (grande)
   ============================================================ */
.logo-equipo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
.logo-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-primario), #0a3d62);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}
.logo-placeholder-visita {
    background: linear-gradient(135deg, #e63946, #780000);
}

/* VS Badge */
.vs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0f4ff;
    border: 2px solid #c8d6ff;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
    color: var(--color-primario);
}

/* ============================================================
   TICKET (MI TICKET)
   ============================================================ */
.ticket-card {
    max-width: 560px;
    margin: 0 auto;
}
.ticket-header {
    background: linear-gradient(135deg, var(--color-primario), #0a3d62);
}
.ticket-perforation {
    height: 20px;
    background: radial-gradient(circle, var(--color-fondo) 40%, transparent 40%) 0 50% / 20px 20px repeat-x;
    margin: 0 -1px;
}
.pronostico-row {
    background: #f8f9fa;
}
.resultado-box {
    font-size: 1.1rem;
    letter-spacing: .05em;
}

/* ============================================================
   CARRITO DE BOLETOS
   ============================================================ */
.cart-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #198754, #0d6efd);
    color: #fff;
    border: none;
    box-shadow: 0 6px 24px rgba(13,110,253,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    z-index: 1050;
    animation: fabPulse 2s ease infinite;
}
.cart-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(13,110,253,.55);
}
.cart-fab .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: .75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badgeBounce .3s ease;
}
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(13,110,253,.4); }
    50%      { box-shadow: 0 6px 30px rgba(13,110,253,.6); }
}
@keyframes badgeBounce {
    0%   { transform: scale(0); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Cart offcanvas override */
#offcanvasCarrito .offcanvas-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
}
.cart-item {
    background: #f8f9fa;
    border-radius: .75rem;
    padding: .75rem;
    margin-bottom: .5rem;
    position: relative;
    transition: all .2s;
}
.cart-item:hover { background: #e9ecef; }
.cart-item-remove {
    position: absolute;
    top: .4rem;
    right: .5rem;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1rem;
    opacity: .6;
    transition: opacity .15s;
}
.cart-item-remove:hover { opacity: 1; }
.cart-item-pronosticos {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: .35rem;
}
.cart-item-pronosticos .badge { font-size: .65rem; }

/* ============================================================
   FOOTER — Siempre sticky bottom
   ============================================================ */
.footer-principal {
    background: #1a1d23;
    color: #d1d5db;
    flex-shrink: 0;
    margin-top: auto;
}
.footer-principal .text-muted {
    color: #9ca3af !important;
}

/* ============================================================
   QUINELA SWITCHER — Pill selector para múltiples quinielas
   ============================================================ */
.quinela-switcher {
    padding: .65rem 1rem;
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.quinela-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border-radius: 2rem;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: all .2s;
    white-space: nowrap;
}
.quinela-pill:hover {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}
.quinela-pill.active {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(26,26,46,.25);
}
.quinela-pill.active .quinela-pill-price {
    background: rgba(255,255,255,.2);
    color: #fbbf24;
}
.quinela-pill-price {
    padding: .1rem .4rem;
    border-radius: 1rem;
    font-size: .7rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #059669;
}
@media (max-width: 576px) {
    .quinela-pill { font-size: .75rem; padding: .35rem .65rem; }
}

/* ── Filter row — select de quinielas en boletos/participantes ── */
.quinela-filter-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.quinela-filter-label {
    font-size: .85rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}
.quinela-filter-select {
    max-width: 260px;
    font-weight: 600;
    border-radius: .5rem;
    border-color: #d1d5db;
}
.quinela-filter-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}
@media (max-width: 576px) {
    .quinela-filter-row { flex-direction: column; align-items: stretch; gap: .4rem; }
    .quinela-filter-select { max-width: 100%; }
}

/* ============================================================
   TARJETAS DE QUINIELAS (lista)
   ============================================================ */
.card-quinela-lista {
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
    border-radius: .75rem;
    overflow: hidden;
}
.card-quinela-lista:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,.15) !important;
}

/* ============================================================
   RESPONSIVE — Mobile-first optimizations
   ============================================================ */

/* Tablets and below */
@media (max-width: 768px) {
    .jornada-hero .d-flex { flex-direction: column; gap: .75rem !important; }
    .jornada-hero .ms-auto { margin-left: 0 !important; text-align: left !important; }
    .jornada-hero h2 { font-size: 1.3rem; }

    .card-apostador .card-body { padding: 1rem !important; }
    .card-apostador .row { gap: .5rem; }

    /* CTA Mis Boletos */
    .mis-boletos-btn { padding: .75rem 1rem; gap: .75rem; }
    .mis-boletos-icon { font-size: 1.6rem; }
    .mis-boletos-titulo { font-size: .95rem; }

    /* Cart FAB position adjustment */
    .cart-fab { bottom: 1rem; right: 1rem; width: 54px; height: 54px; font-size: 1.3rem; }

    /* Quantity selector — stack vertically on mobile */
    .cantidad-boletos-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .5rem !important;
    }
    .cantidad-boletos-wrapper .input-group { max-width: 100% !important; }

    /* Action buttons full width on mobile */
    .d-flex.gap-2.flex-column.flex-sm-row .btn {
        font-size: .95rem;
        padding: .65rem 1rem;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .jornada-hero { padding: .75rem !important; border-radius: .75rem !important; }
    .jornada-hero h2 { font-size: 1.1rem; }
}

/* Desktop enhancements */
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
