/* ===========================================
   Estilos principales - Quiniela Deportiva ⚽
   =========================================== */

:root {
    --primary-color: #1e3a5f;
    --secondary-color: #28a745;
    --warning-color: #ffc107;
    --local-color: #28a745;
    --empate-color: #ffc107;
    --visitante-color: #dc3545;
}

/* General */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Navbar */
.bg-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c5282 100%);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Header de jornada - Estilo futbolero */
.header-jornada {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a365d 100%);
    position: relative;
    overflow: hidden;
}

.header-jornada .container {
    position: relative;
    z-index: 1;
}

.header-jornada::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom right, transparent 49%, #f5f5f5 50%);
}

/* Decoración del header */
.header-decoration {
    position: relative;
    display: inline-block;
    margin-bottom: -30px;
    z-index: 0;
}

.header-decoration .ball-icon {
    font-size: 4rem;
    animation: bounce-ball 1s ease infinite;
    display: inline-block;
}

.header-decoration .header-logo-icon {
    max-height: 120px;
    max-width: 200px;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    position: relative;
    top: -40px;
    margin-bottom: -40px;
}

/* Título de jornada superpuesto */
.header-jornada h1.display-5 {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

@keyframes bounce-ball {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Tabla de partidos estilo estadio */
.tabla-partidos {
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255,255,255,0.98);
}

.tabla-partidos thead th {
    background: linear-gradient(180deg, #212529 0%, #343a40 100%);
    padding: 8px 5px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
}

.tabla-partidos tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.tabla-partidos tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

.tabla-partidos tbody tr:hover {
    background-color: rgba(40, 167, 69, 0.08);
}

.tabla-partidos tbody td {
    padding: 6px 4px;
    vertical-align: middle;
}

/* Fila de partido */
.partido-row {
    position: relative;
}

/* Card de partidos */
.partidos-card {
    border: none;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.partidos-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--local-color), var(--empate-color), var(--visitante-color));
}

/* Contador regresivo */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px 25px;
    min-width: 80px;
    backdrop-filter: blur(10px);
}

.countdown-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--warning-color);
    line-height: 1;
}

.countdown-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

/* Tabla de partidos */
.partido-row {
    transition: background-color 0.3s ease;
}

.partido-row:hover {
    background-color: #f8f9fa;
}

/* Equipos - Estilo destacado */
.equipo-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 2px;
}

.equipo-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
    transition: transform 0.3s ease, filter 0.3s ease;
    border-radius: 4px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    padding: 2px;
    border: 1px solid #e0e0e0;
}

.equipo-logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.equipo-nombre {
    font-weight: 600;
    font-size: 0.7rem;
    text-align: left;
    color: #333;
    max-width: 80px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

/* Botones de predicción */
.btn-prediccion {
    cursor: pointer;
    display: inline-block;
}

.btn-prediccion input[type="radio"] {
    display: none;
}

.btn-prediccion span {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}

.badge-local {
    background-color: #e8f5e9;
    color: var(--local-color);
    border-color: var(--local-color);
}

.badge-empate {
    background-color: #fff8e1;
    color: #856404;
    border-color: var(--empate-color);
}

.badge-visitante {
    background-color: #ffebee;
    color: var(--visitante-color);
    border-color: var(--visitante-color);
}

.btn-prediccion input[type="radio"]:checked + .badge-local {
    background-color: var(--local-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.btn-prediccion input[type="radio"]:checked + .badge-empate {
    background-color: var(--empate-color);
    color: #212529;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.btn-prediccion input[type="radio"]:checked + .badge-visitante {
    background-color: var(--visitante-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.btn-prediccion:hover span {
    transform: scale(1.03);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.card-header {
    border-bottom: none;
}

/* Botón flotante WhatsApp */
.btn-whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none;
}

.btn-whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Resumen de selección */
#resumenSeleccion {
    max-height: 300px;
    overflow-y: auto;
}

#resumenSeleccion .seleccion-item {
    padding: 5px 10px;
    margin: 3px 0;
    border-radius: 5px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#resumenSeleccion .seleccion-item .badge {
    min-width: 24px;
    font-size: 0.7rem;
}

/* Alertas personalizadas */
.alert-custom {
    border-radius: 10px;
    border: none;
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Animación touch feedback */
.btn-prediccion.touching span {
    transform: scale(0.95);
}

/* Layout de tarjetas para partidos en móvil */
.partido-card-mobile {
    display: none;
}

@media (max-width: 480px) {
    /* Ocultar tabla tradicional */
    .table-desktop-only {
        display: none !important;
    }
    
    /* Mostrar layout de cards */
    .partido-card-mobile {
        display: block;
    }
    
    .partido-card {
        background: #fff;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border: 1px solid #e9ecef;
    }
    
    .partido-card.selected {
        border-color: #28a745;
        background: #f8fff8;
    }
    
    .partido-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }
    
    .partido-card-number {
        font-size: 0.75rem;
        color: #6c757d;
        background: #f0f0f0;
        padding: 2px 8px;
        border-radius: 10px;
    }
    
    .partido-card-teams {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .partido-card-team {
        text-align: center;
        flex: 1;
    }
    
    .partido-card-team img {
        width: 45px;
        height: 45px;
        object-fit: contain;
        margin-bottom: 5px;
    }
    
    .partido-card-team span {
        display: block;
        font-size: 0.8rem;
        font-weight: 600;
        color: #333;
    }
    
    .partido-card-vs {
        font-size: 0.9rem;
        font-weight: bold;
        color: #6c757d;
        padding: 0 15px;
    }
    
    .partido-card-buttons {
        display: flex;
        justify-content: space-around;
        gap: 10px;
    }
    
    .partido-card-buttons .btn-prediccion {
        flex: 1;
        text-align: center;
    }
    
    .partido-card-buttons .btn-prediccion span {
        width: 100%;
        height: 40px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===========================================
   MOBILE RESPONSIVE - Optimizado para móviles
   =========================================== */

/* Tablets y dispositivos medianos (768px - 992px) */
@media (max-width: 992px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        height: 40px !important;
    }
    
    /* Tabla de partidos optimizada */
    .table thead th {
        font-size: 0.8rem;
        padding: 8px 4px;
    }
    
    .equipo-logo {
        width: 40px;
        height: 40px;
    }
    
    .equipo-nombre {
        font-size: 0.8rem;
    }
    
    .btn-prediccion span {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* Cards laterales */
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

/* Móviles (max-width: 768px) */
@media (max-width: 768px) {
    /* Header de jornada */
    .header-jornada {
        padding: 20px 10px 60px 10px !important;
    }
    
    .header-jornada h1 {
        font-size: 1.5rem !important;
    }
    
    .header-jornada p {
        font-size: 0.9rem;
    }
    
    /* Contador regresivo */
    .countdown-container {
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .countdown-item {
        padding: 10px 12px;
        min-width: 55px;
    }
    
    .countdown-number {
        font-size: 1.5rem;
    }
    
    .countdown-label {
        font-size: 0.65rem;
    }
    
    /* Tabla de partidos para móvil */
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .equipo-info {
        gap: 3px;
    }
    
    .equipo-logo {
        width: 32px;
        height: 32px;
    }
    
    .equipo-nombre {
        font-size: 0.7rem;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .btn-prediccion span {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        border-width: 2px;
        border-radius: 6px;
    }
    
    /* Cards */
    .card {
        border-radius: 10px;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    .card-header h4, 
    .card-header h5 {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-footer {
        padding: 12px 15px;
    }
    
    /* Botones */
    .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    /* Footer del card de partidos */
    .card-footer .row {
        text-align: center;
    }
    
    .card-footer .col-md-6 {
        margin-bottom: 10px;
    }
    
    .card-footer .text-end {
        text-align: center !important;
    }
    
    /* WhatsApp flotante */
    .btn-whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* Resumen de selección */
    #resumenSeleccion .seleccion-item {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    /* Modales */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body h4 {
        font-size: 1.1rem;
    }
    
    .modal-body h2 {
        font-size: 1.5rem;
    }
    
    /* Alertas flotantes */
    .alert-floating {
        left: 10px !important;
        right: 10px !important;
        min-width: auto !important;
        font-size: 0.9rem;
    }
    
    /* Formularios */
    .form-control, .form-select {
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .input-group-text {
        padding: 8px 12px;
    }
    
    /* Página de verificar - Solo para input-groups con botón de búsqueda */
    .verificar-input-group {
        flex-direction: column;
    }
    
    .verificar-input-group .form-control {
        border-radius: 0.375rem !important;
        margin-bottom: 10px;
    }
    
    .verificar-input-group .btn {
        border-radius: 0.375rem !important;
        width: 100%;
    }
    
    /* Página de resultados - tabla responsiva */
    .table-hover tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 12px;
        border-bottom: 2px solid #dee2e6;
        align-items: center;
    }
    
    .table-hover:not(.table-admin) thead {
        display: none;
    }
    
    .table-hover:not(.table-admin) td {
        border: none;
        padding: 5px 8px;
    }
    
    /* Verificar quiniela - tabla */
    .table-sm td {
        font-size: 0.85rem;
    }
    
    .table-striped tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        border-bottom: 1px solid #dee2e6;
    }
    
    .table-striped:not(.table-admin) thead {
        display: none;
    }
    
    .table-striped td {
        flex: 1 1 50%;
        border: none;
        padding: 4px 0;
    }
    
    .table-striped td:first-child {
        flex: 0 0 100%;
        font-weight: 600;
        color: #333;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
}

/* Móviles pequeños (max-width: 576px) */
@media (max-width: 576px) {
    /* Navbar */
    .navbar {
        padding: 8px 10px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 35px !important;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    /* Header jornada */
    .header-jornada {
        padding-bottom: 55px !important;
    }
    
    .header-jornada h1 {
        font-size: 1.3rem !important;
    }
    
    /* Contador - Estilo compacto en línea */
    .countdown-container {
        gap: 6px;
        flex-wrap: nowrap;
        margin-bottom: 8px;
    }
    
    /* Tabla partidos - Estilo de card para cada fila */
    .table.table-hover thead {
        display: none;
    }
    
    .table.table-hover tbody {
        display: block;
    }
    
    /* ========================================
       DISEÑO COMPACTO EN LÍNEA - MÓVIL
       Muestra más partidos simultáneamente
       ======================================== */
    
    /* Eliminar padding del contenedor de partidos */
    .partidos-card {
        border-radius: 8px;
    }
    
    .partidos-card .card-header {
        padding: 6px 8px;
    }
    
    .partidos-card .card-header h4 {
        font-size: 0.85rem;
    }
    
    .partidos-card .card-body {
        padding: 0 !important;
        overflow: visible;
    }
    
    .partidos-card .table-responsive {
        padding: 0;
        margin: 0;
        overflow-x: hidden !important;
        overflow-y: visible;
        width: 100%;
    }
    
    .partidos-card .card-footer {
        padding: 6px 8px;
    }
    
    .table.table-hover {
        margin: 0;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed;
    }
    
    .table.table-hover tbody {
        padding: 2px;
        display: block;
        width: 100%;
    }
    
    .table.table-hover .partido-row {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        padding: 4px 2px;
        margin: 0;
        background: #fff;
        border-bottom: 1px solid #dee2e6;
        border-radius: 0;
        gap: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        min-height: 32px;
    }
    
    .table.table-hover .partido-row:nth-child(even) {
        background: #f8f9fa;
    }

    .table.table-hover .partido-row td {
        border: none;
        padding: 2px;
        background: transparent !important;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    /* Orden de elementos en móvil con anchos fijos:
       [L:8%] [Local:34%] [E:8%] [Visitante:34%] [V:8%] = 92% + gaps */
    
    /* Botón Local */
    .partido-row td:nth-child(1) {
        order: 1;
        flex: 0 0 8%;
        max-width: 8%;
    }
    
    /* Equipo Local */
    .partido-row td:nth-child(2) {
        order: 2;
        flex: 0 0 34%;
        max-width: 34%;
        overflow: hidden;
    }
    
    /* Botón Empate (centro) */
    .partido-row td:nth-child(3) {
        order: 3;
        flex: 0 0 8%;
        max-width: 8%;
    }
    
    /* Equipo Visitante */
    .partido-row td:nth-child(4) {
        order: 4;
        flex: 0 0 34%;
        max-width: 34%;
        overflow: hidden;
    }
    
    /* Botón Visitante - extremo derecho */
    .partido-row td:nth-child(5) {
        order: 5;
        flex: 0 0 8%;
        max-width: 8%;
    }
    
    /* Equipos con logo pequeño */
    .equipo-info {
        flex-direction: row !important;
        text-align: left;
        gap: 3px;
        width: 100%;
        overflow: hidden;
        justify-content: flex-start !important;
        align-items: center;
    }
    
    .partido-row td:nth-child(2) .equipo-info {
        justify-content: flex-start !important;
    }
    
    .partido-row td:nth-child(4) .equipo-info {
        justify-content: flex-end !important;
        flex-direction: row-reverse !important;
        text-align: right;
    }
    
    /* Logos pequeños visibles */
    .equipo-logo {
        display: block !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px;
        padding: 1px;
        border-width: 1px;
        flex-shrink: 0;
    }
    
    /* Nombres de equipos */
    .equipo-nombre {
        font-size: 0.5rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.1;
        font-weight: 600;
        color: #333;
        max-width: calc(100% - 26px);
    }
    
    .partido-row td:nth-child(2) .equipo-nombre {
        text-align: left;
    }
    
    .partido-row td:nth-child(4) .equipo-nombre {
        text-align: right;
    }
    
    /* Botones de predicción estilo compacto - Celdas rectangulares */
    .btn-prediccion {
        flex-shrink: 0 !important;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .btn-prediccion span {
        width: 26px !important;
        height: 28px !important;
        min-width: 26px !important;
        font-size: 0.7rem;
        border-width: 1px;
        box-shadow: none;
        font-weight: bold;
        border-radius: 4px !important;
    }
    
    .btn-prediccion input[type="radio"]:checked + span {
        transform: none !important;
    }
    
    /* Ocultar VS decorativo en móvil */
    .partido-row::after {
        display: none !important;
    }
    
    /* Quitar efectos de hover/transform en móvil */
    .tabla-partidos tbody tr:hover {
        transform: none;
    }
    
    /* Cards de datos */
    .col-lg-4 {
        margin-top: 20px;
    }
    
    /* Botones footer card */
    .card-footer .btn {
        display: inline-block;
        width: auto;
        padding: 4px 10px;
        font-size: 0.75rem;
        margin-bottom: 0;
    }
    
    .card-footer .row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .card-footer .col-md-6:first-child {
        font-size: 0.8rem;
    }
    
    /* Footer */
    footer {
        padding: 15px 10px !important;
        font-size: 0.8rem;
    }
    
    /* Página resultados */
    .table-responsive table td,
    .table-responsive table th {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
    
    /* Badges más pequeños */
    .badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    /* Login */
    .card-body.p-5 {
        padding: 25px !important;
    }
    
    /* Asegurar que el contenedor de partidos ocupe el ancho correcto */
    .partidos-card {
        margin-left: -5px;
        margin-right: -5px;
        border-radius: 8px;
    }
    
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* Móviles extra pequeños (max-width: 400px) */
@media (max-width: 400px) {
    /* Contenedor más ajustado */
    .container {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    
    .partidos-card {
        margin-left: -2px;
        margin-right: -2px;
    }
    
    /* Logos más pequeños */
    .equipo-logo {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px;
    }
    
    /* Nombres muy compactos */
    .equipo-nombre {
        font-size: 0.55rem;
    }
    
    /* Botones de predicción más pequeños */
    .btn-prediccion span {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        font-size: 0.55rem;
    }
    
    /* Botones con tamaño fijo */
    .partido-row td:nth-child(1),
    .partido-row td:nth-child(3),
    .partido-row td:nth-child(5) {
        flex: 0 0 20px !important;
    }
    
    /* Fila de partido más compacta */
    .table.table-hover .partido-row {
        padding: 2px 2px;
        gap: 2px;
        min-height: 26px;
    }
    
    /* Encabezado de la card de partidos */
    .partidos-card .card-header h4 {
        font-size: 0.75rem;
    }
    
    .partidos-card .card-header .badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    .partidos-card .card-header {
        padding: 6px 8px;
    }
}

/* ==========================================
   Estilos del Panel de Administración
   ========================================== */

.admin-sidebar {
    min-height: 100vh;
    width: 250px;
    min-width: 250px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #1a365d 100%);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 5px 10px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-sidebar .nav-link i {
    width: 25px;
}

.stat-card {
    border-radius: 15px;
    border: none;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.table-admin th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.badge-estado {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

/* Preview de logo */
.logo-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Switch toggle personalizado */
.form-switch .form-check-input {
    width: 50px;
    height: 25px;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
}

/* ===========================================
   ADMIN PANEL MOBILE - Estilos responsivos
   =========================================== */

/* Sidebar móvil */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px !important;
        z-index: 1050;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }
    
    .admin-sidebar.show {
        left: 0;
    }
    
    /* Overlay para cerrar sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Contenido principal sin sidebar */
    .flex-grow-1 {
        width: 100% !important;
    }
    
    /* Header admin móvil */
    .admin-header-mobile {
        display: flex !important;
    }
    
    /* Stats cards en móvil */
    .stat-card .card-body {
        padding: 15px;
    }
    
    .stat-card .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    /* Tablas admin responsivas */
    .table-admin {
        font-size: 0.85rem;
    }
    
    .table-admin th,
    .table-admin td {
        padding: 10px 8px;
    }
    
    /* Botones de acción más pequeños */
    .btn-group-sm .btn {
        padding: 4px 8px;
    }
}

@media (max-width: 768px) {
    /* Stats en 2 columnas */
    .row.g-4 .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .stat-card .card-body {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-card .stat-icon {
        margin: 0 0 10px 0 !important;
    }
    
    /* Tablas admin en móvil */
    .table-responsive {
        margin: 0 -15px;
        width: calc(100% + 30px);
    }
    
    /* Ocultar columnas menos importantes */
    .table-admin .d-none-mobile {
        display: none !important;
    }
    
    /* Modal admin */
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    /* Botones acción en tabla */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 35px;
    }
    
    /* Cards de equipos */
    .col-md-4.col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    /* Header admin */
    header.bg-white {
        padding: 10px 15px !important;
    }
    
    header .btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    header .dropdown-toggle {
        padding: 6px 10px;
    }
    
    /* Main content */
    main.p-4 {
        padding: 15px !important;
    }
    
    main h2 {
        font-size: 1.3rem;
    }
    
    /* Botón nueva jornada/equipo */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 10px;
    }
    
    .d-flex.justify-content-between .btn {
        width: 100%;
    }
    
    /* Stats en 1 columna */
    .row.g-4 .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Cards de equipos en 1 columna */
    .col-md-4.col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Tablas admin - modo tarjetas */
    .table-admin thead {
        display: none;
    }
    
    .table-admin tbody tr {
        display: block;
        padding: 15px;
        margin-bottom: 10px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }
    
    .table-admin tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table-admin tbody td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 15px;
    }
    
    .table-admin tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        font-size: 0.8rem;
    }
    
    /* Jornada activa card */
    .col-lg-5 {
        order: 1;
    }
    
    .col-lg-7 {
        order: 2;
    }
}

/* Touch friendly */
@media (hover: none) and (pointer: coarse) {
    /* Incrementar áreas táctiles */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .btn-prediccion span {
        min-width: 44px;
        min-height: 44px;
    }
    
    .form-control, .form-select {
        min-height: 44px;
    }
    
    /* Desactivar hover effects */
    .btn:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .btn-whatsapp-float:hover {
        transform: none;
    }
}

/* Orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .header-jornada {
        padding: 10px !important;
    }
    
    .countdown-container {
        gap: 5px;
    }
    
    .countdown-item {
        padding: 5px 10px;
    }
    
    .countdown-number {
        font-size: 1.2rem;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Safe areas para notch en iPhones */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .btn-whatsapp-float {
        bottom: max(15px, env(safe-area-inset-bottom));
        right: max(15px, env(safe-area-inset-right));
    }
    
    .navbar {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}

/* Print styles */
@media print {
    .btn-whatsapp-float,
    .navbar,
    .admin-sidebar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
