/* Hoja de estilos central y Premium - FECHIPE 2026 */

:root {
    --fechipe-navy: #1b263b;
    --fechipe-blue: #0d6efd;
    --fechipe-crimson: #c1121f;
    --fechipe-dark: #0f172a;
    --fechipe-light-gray: #f8fafc;
    --fechipe-border-color: #cbd5e1;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(203, 213, 225, 0.5);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6, .fw-bold {
    font-weight: 700;
    color: var(--fechipe-dark);
}

/* Tarjetas Premium con Glassmorphism */
.card-premium {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Dashboard Stat Cards (Diseño Claro con Letras Oscuras) */
.stat-card {
    border-radius: 12px;
    border: 1px solid var(--fechipe-border-color);
    overflow: hidden;
    color: #1e293b !important;
}

.stat-card h3, .stat-card h4, .stat-card .fw-bold {
    color: #0f172a !important;
}

.stat-card span, .stat-card small, .stat-card .text-white-50 {
    color: #64748b !important;
}

.stat-card .text-white {
    color: #0f172a !important;
}

.stat-card-blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
    border: 1px solid #bfdbfe !important;
}
.stat-card-blue h3, .stat-card-blue i {
    color: #1d4ed8 !important;
}

.stat-card-red {
    background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
    border: 1px solid #fecaca !important;
}
.stat-card-red h3, .stat-card-red i {
    color: #dc2626 !important;
}

.stat-card-dark {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    border: 1px solid #cbd5e1 !important;
}
.stat-card-dark h3, .stat-card-dark i {
    color: #334155 !important;
}

.stat-card-gold {
    background: linear-gradient(135deg, #fffbeb, #fef3c7) !important;
    border: 1px solid #fde68a !important;
}
.stat-card-gold h3, .stat-card-gold i {
    color: #b45309 !important;
}

/* Credencial de Licencia Deportiva Digital */
.credential-container {
    perspective: 1000px;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.credential-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    position: relative;
    overflow: hidden;
}

.credential-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(220,38,38,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.credential-header {
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.credential-photo {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border: 2px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
}

.credential-badge {
    background-color: var(--fechipe-crimson);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Estilo para los botones flotantes de acción en listados */
.btn-action-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Ficha del Escaneo QR */
.ficha-header {
    background: linear-gradient(135deg, var(--fechipe-navy), var(--fechipe-dark));
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 30px;
}
.ficha-body {
    background-color: white;
    border-radius: 0 0 12px 12px;
    border: 1px solid var(--fechipe-border-color);
    border-top: none;
    padding: 30px;
}

/* Layout estructurado con Sidebar Lateral */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 280px;
    background-color: var(--fechipe-dark);
    color: #cbd5e1;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.app-sidebar .sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
    font-weight: 800;
    font-size: 1.25rem;
}

.app-sidebar .sidebar-user {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
    background-color: rgba(30, 41, 59, 0.3);
}

.app-sidebar .sidebar-nav {
    flex-grow: 1;
    padding: 15px 0;
}

.app-sidebar .nav-link {
    color: #94a3b8;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.app-sidebar .nav-link:hover, .app-sidebar .nav-link.active {
    color: white;
    background-color: #1e293b;
    border-left: 4px solid var(--fechipe-blue);
}

.app-sidebar .nav-link i {
    font-size: 1.1rem;
}

.app-main-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.app-header {
    background-color: white;
    border-bottom: 1px solid var(--fechipe-border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.app-main-content {
    flex-grow: 1;
    padding: 30px;
}

.hover-underline:hover {
    text-decoration: underline !important;
}

/* RESPONSIVIDAD MÓVIL (SIDEBAR COLLAPSIBLE Y CREDENCIAL) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Oculto por defecto en la izquierda */
        width: 280px;
        height: 100vh;
        z-index: 1060;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.25);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .app-sidebar.show-sidebar {
        left: 0; /* Mostrar deslizando */
    }
    .app-main-panel {
        width: 100%;
        margin-left: 0;
        padding-top: 70px; /* Dejar espacio para la cabecera fija */
    }
    .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1040;
        padding: 10px 15px;
    }
    .app-main-content {
        padding: 15px;
    }
    /* Mostrar botón de menú hamburguesa y botón de cierre */
    .menu-toggle-btn {
        display: inline-flex !important;
    }
}

.menu-toggle-btn {
    display: none;
}

@media (max-width: 480px) {
    .credential-card {
        padding: 16px;
    }
    .credential-card .credential-photo {
        width: 80px;
        height: 96px;
    }
    .credential-card .fs-6 {
        font-size: 0.85rem !important;
    }
    .credential-card .credential-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .credential-card img[id="res-qr"], .credential-card img[alt="QR"] {
        width: 60px !important;
        height: 60px !important;
    }
    .app-header h5 {
        font-size: 0.95rem !important;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: calc(100vw - 120px);
        margin-bottom: 0;
    }
}

/* Superposición de Fondo Oscuro (Backdrop) para Sidebar en Móviles */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}
