/**
 * Variables CSS Personalizables por Entidad
 * Generado dinámicamente desde la base de datos
 */

:root {
    /* Colores Principales */
    --color-primary: #0891b2;
    --color-primary-dark: #06748e;
    --color-primary-light: #09aed5;
    --color-secondary: #185f6d;
    --color-secondary-dark: #134c57;
    --color-accent: #67e8f9;
    
    /* Fondos */
    --color-background: #1a1a2e;
    --color-background-light: #2d2d4a;
    
    /* Textos */
    --color-text: #e0e0f0;
    --color-text-muted: #a0a0c0;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-danger: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    --gradient-secondary: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    
    /* Alias para compatibilidad con archivos antiguos */
    --primary-color: var(--color-primary);
    --secondary-color: var(--color-secondary);
    --accent-color: var(--color-accent);
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 15px 40px rgba(8, 145, 178, 0.4);
    
    /* Bordes */
    --border-radius-sm: 10px;
    --border-radius-md: 20px;
    --border-radius-lg: 30px;
    --border-radius-full: 50px;
    
    /* Espaciado */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
}

/* Clases Utilitarias con Colores Dinámicos */
.bg-primary {
    background: var(--gradient-primary) !important;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.text-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-light {
    color: var(--color-text) !important;
}

.text-muted {
    color: var(--color-text-muted) !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-full);
    padding: 14px 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 60px rgba(8, 145, 178, 0.6);
}

.card-glass {
    background: var(--color-background-light);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Partículas animadas */
.particle {
    background: rgba(8, 145, 178, 0.6);
    box-shadow: 0 0 10px rgba(8, 145, 178, 0.4);
}

/* Formularios */
.form-control-themed {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control-themed:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.2);
    outline: none;
}

.form-control-themed::placeholder {
    color: var(--color-text-muted);
}

/* Alertas */
.alert-themed {
    border-radius: var(--border-radius-md);
    padding: 12px 15px;
    backdrop-filter: blur(10px);
}

.alert-info-themed {
    background: rgba(8, 145, 178, 0.15);
    border: 1px solid rgba(8, 145, 178, 0.3);
    color: #09aed5;
}

/* Animaciones */
@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-primary);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 25px 80px rgba(8, 145, 178, 0.6);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   MÓDULO: CONSULTAS E INSCRIPCIONES
   ============================================================================ */

/* Page Header */
.page-header {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
}

.page-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
}

.stat-card.primary {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
}

.stat-card.primary .icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.primary .value,
.stat-card.primary .label {
    color: white;
}

.stat-card.success {
    background: var(--gradient-success, linear-gradient(135deg, #28a745 0%, #1e7e34 100%));
}

.stat-card.success .icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.success .value,
.stat-card.success .label {
    color: white;
}

.stat-card.warning {
    background: var(--gradient-warning, linear-gradient(135deg, #ffc107 0%, #e0a800 100%));
}

.stat-card.warning .icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.warning .value,
.stat-card.warning .label {
    color: white;
}

.stat-card.danger {
    background: var(--gradient-danger, linear-gradient(135deg, #dc3545 0%, #c82333 100%));
}

.stat-card.danger .icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.danger .value,
.stat-card.danger .label {
    color: white;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
}

.stat-card .label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Card */
.filter-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 30px;
    margin-bottom: 25px;
}

.filter-card h5 {
    color: #0891b2;
    font-weight: bold;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Data Table Card */
.data-table-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.data-table thead {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
    color: white;
}

.data-table thead th {
    border: none;
    padding: 15px 10px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.data-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-container h5,
.chart-container h6 {
    color: #0891b2;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0891b2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   MÓDULO: CONTROL DE ASISTENCIAS
   ============================================================================ */

body.asistencias-module {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
    min-height: 100vh;
}

.main-container {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.header-section {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.header-section h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.header-section .subtitle {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.header-section .btn-action {
    background: white;
    border: none;
    color: #0891b2;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header-section .btn-action:hover {
    background: #f8f9fa;
    color: #06748e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.config-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.day-checkbox input[type="checkbox"] {
    display: none;
}

.day-checkbox label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    background: white;
}

.day-checkbox input:checked + label {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
    color: white;
    border-color: #0891b2;
    transform: scale(1.05);
}

.day-checkbox label:hover {
    border-color: #0891b2;
    transform: scale(1.02);
}

.tabla-asistencias {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.tabla-asistencias thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tabla-asistencias th {
    background: var(--gradient-primary, linear-gradient(135deg, #0891b2 0%, #06748e 100%));
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
}

.tabla-asistencias th:first-child {
    border-top-left-radius: 10px;
    min-width: 200px;
    text-align: left;
    padding-left: 15px;
}

.tabla-asistencias th:last-child {
    border-top-right-radius: 10px;
}

.tabla-asistencias td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.tabla-asistencias tbody tr:hover {
    background-color: #f8f9fa;
}

.deportista-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.deportista-foto {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0891b2;
}

.deportista-info {
    text-align: left;
}

.deportista-nombre {
    font-weight: 600;
    color: #333;
    display: block;
}

.deportista-edad {
    font-size: 0.85rem;
    color: #6c757d;
}

.asistencia-cell {
    cursor: pointer;
    min-width: 45px;
    height: 45px;
    transition: all 0.2s;
    user-select: none;
}

.asistencia-cell:hover {
    transform: scale(1.1);
}

.asistencia-cell.presente {
    background-color: #28a745;
    color: white;
    font-weight: bold;
}

.asistencia-cell.ausente {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
}

.asistencia-cell.sin-registro {
    background-color: #e9ecef;
    color: #6c757d;
}

.leyenda {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.leyenda-cuadro {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.estadisticas-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stats-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.stats-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deportista-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.deportista-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-left: 4px solid #0891b2;
}

.deportista-card.alerta-grave {
    border-left-color: #dc3545;
}

.deportista-card.alerta-moderada {
    border-left-color: #ffc107;
}

.deportista-card.estado-bueno {
    border-left-color: #28a745;
}

.deportista-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ================================================================
   MÓDULO: FORMULARIO DE INSCRIPCIÓN A ESCUELAS DEPORTIVAS
   ================================================================ */

/* Contenedor principal del formulario */
.form-container {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Encabezado del formulario */
.form-header {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.form-header i {
    color: white;
    opacity: 0.9;
}

.form-header h1 {
    font-size: 2rem;
    font-weight: bold;
    margin: 15px 0 10px 0;
    color: white;
}

.form-header p {
    font-size: 1.1rem;
    margin: 0;
    color: rgba(255,255,255,0.9);
}

/* Cuerpo del formulario */
.form-body {
    padding: 40px 30px;
}

/* Badge de información */
.info-badge {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196F3;
    padding: 15px 20px 15px 55px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    line-height: 1.6;
    color: #1565C0;
    text-align: justify;
    position: relative;
}

.info-badge i {
    color: #2196F3;
    font-size: 1.5rem;
    position: absolute;
    left: 20px;
    top: 15px;
}

.info-badge strong {
    color: #1976D2;
}

/* ============================================================================
   TÍTULOS - CONFIGURACIÓN CORRECTA
   Bootstrap maneja el color por defecto (#212529 oscuro)
   Solo agregamos mejoras visuales sin romper el comportamiento
   ============================================================================ */

/* Sombra sutil para TODOS los títulos (mejora visual) */
h1, h2, h3, h4, h5, h6 {
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Títulos sobre fondos oscuros EXPLÍCITOS - COLOR BLANCO con sombra más fuerte */
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-secondary h1, .bg-secondary h2, .bg-secondary h3, .bg-secondary h4, .bg-secondary h5, .bg-secondary h6,
.bg-success h1, .bg-success h2, .bg-success h3, .bg-success h4, .bg-success h5, .bg-success h6,
.bg-danger h1, .bg-danger h2, .bg-danger h3, .bg-danger h4, .bg-danger h5, .bg-danger h6,
.bg-info h1, .bg-info h2, .bg-info h3, .bg-info h4, .bg-info h5, .bg-info h6,
.navbar h1, .navbar h2, .navbar h3, .navbar h4, .navbar h5, .navbar h6,
.navbar-dark h1, .navbar-dark h2, .navbar-dark h3, .navbar-dark h4, .navbar-dark h5, .navbar-dark h6,
.header-section h1, .header-section h2, .header-section h3, .header-section h4, .header-section h5, .header-section h6 {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Títulos con clases text-white explícitas */
.text-white, .text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6 {
    color: #ffffff !important;
}

/* Títulos de sección */
.section-title {
    background: var(--gradient-primary);
    color: white !important;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.section-title i {
    font-size: 1.3rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Etiquetas de formulario */
.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

/* Campos de formulario */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Área de subida de archivos */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #0891b2;
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-area.active {
    border-color: #0891b2;
    background: rgba(102, 126, 234, 0.1);
}

.file-upload-area i {
    font-size: 2.5rem;
    color: #0891b2;
    margin-bottom: 10px;
}

.file-upload-area .upload-text {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.file-upload-area .upload-hint {
    font-size: 0.85rem;
    color: #adb5bd;
}

/* Sistema de wrapper para archivos (oculta input nativo) */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.file-upload-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 150px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #0891b2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.file-upload-label i {
    font-size: 2.5rem;
    color: #0891b2;
    margin-bottom: 10px;
    display: block;
}

.file-upload-label strong {
    font-size: 1rem;
    color: #495057;
    display: block;
    margin-bottom: 5px;
}

.file-upload-label small {
    font-size: 0.85rem;
    color: #6c757d;
    display: block;
}

/* Vista previa de archivos */
.file-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #495057;
    display: none;
    border-left: 3px solid #0891b2;
}

.file-preview.active {
    display: block;
}

.file-preview i {
    margin-right: 5px;
}

/* Vista previa de imagen */
.preview-container {
    margin-top: 15px;
    text-align: center;
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    border: 3px solid #0891b2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.preview-filename {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.preview-filename i {
    color: #0891b2;
}

/* Botón de eliminar archivo */
.btn-remove-file {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Checkbox de términos */
.checkbox-terms {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #dee2e6;
    cursor: pointer;
    margin-top: 0.2rem;
}

.form-check-input:checked {
    background-color: #0891b2;
    border-color: #0891b2;
}

.form-check-label {
    margin-left: 8px;
    cursor: pointer;
    user-select: none;
    line-height: 1.6;
    color: #495057;
}

.form-check-label a {
    color: #0891b2;
    text-decoration: none;
    font-weight: 600;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* Botón de envío */
.btn-submit-form {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.btn-submit-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-submit-form:disabled {
    background: #6c757d;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Spinner de carga */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.active {
    display: flex;
}

.spinner-content {
    text-align: center;
    color: white;
}

.spinner-content .spinner-border {
    width: 4rem;
    height: 4rem;
}

.spinner-content p {
    margin-top: 20px;
    font-size: 1.2rem;
    color: white;
}

/* Display de edad */
.age-display {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
    border-radius: 6px;
    font-weight: 600;
    color: #2e7d32;
}

/* Mensajes de validación */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Estilos responsive */
@media (max-width: 768px) {
    .form-container {
        margin: 20px;
        border-radius: 15px;
    }
    
    .form-header {
        padding: 30px 20px;
    }
    
    .form-header h1 {
        font-size: 1.5rem;
    }
    
    .form-body {
        padding: 25px 20px;
    }
    
    .section-title {
        font-size: 1.1rem;
        padding: 10px 15px;
    }
    
    .btn-submit-form {
        width: 100%;
        padding: 12px 20px;
    }
}

/* ================================================================
   MÓDULO: POBLACIÓN BENEFICIADA - BOTONES DE ZONA
   ================================================================ */

/* Grupo de botones de filtro de zona */
.btn-group[role="group"] .btn {
    transition: all 0.3s ease;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-width: 1px;
    font-weight: 400;
}

/* Asegurar mismo tamaño para btn-sm */
.btn-group .btn-sm {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Botón "Todas" - Primary */
.btn-group .btn-primary,
.btn-group .btn-outline-primary {
    border-color: #0891b2 !important;
}

.btn-group .btn-outline-primary {
    color: #0891b2 !important;
    background: transparent !important;
}

.btn-group .btn-outline-primary:hover,
.btn-group .btn-outline-primary:focus {
    color: white !important;
    background: #0891b2 !important;
    border-color: #0891b2 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-group .btn-primary {
    color: white !important;
    background: #0891b2 !important;
    border-color: #0891b2 !important;
}

.btn-group .btn-primary:hover,
.btn-group .btn-primary:focus {
    color: white !important;
    background: #06748e !important;
    border-color: #06748e !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Botón "Urbana" - Info */
.btn-group .btn-info,
.btn-group .btn-outline-info {
    border-color: #17a2b8 !important;
}

.btn-group .btn-outline-info {
    color: #17a2b8 !important;
    background: transparent !important;
}

.btn-group .btn-outline-info:hover,
.btn-group .btn-outline-info:focus {
    color: white !important;
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.btn-group .btn-info {
    color: white !important;
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
}

.btn-group .btn-info:hover,
.btn-group .btn-info:focus {
    color: white !important;
    background: #138496 !important;
    border-color: #117a8b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

/* Botón "Rural" - Success */
.btn-group .btn-success,
.btn-group .btn-outline-success {
    border-color: #28a745 !important;
}

.btn-group .btn-outline-success {
    color: #28a745 !important;
    background: transparent !important;
}

.btn-group .btn-outline-success:hover,
.btn-group .btn-outline-success:focus {
    color: white !important;
    background: #28a745 !important;
    border-color: #28a745 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-group .btn-success {
    color: white !important;
    background: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-group .btn-success:hover,
.btn-group .btn-success:focus {
    color: white !important;
    background: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Asegurar que los iconos siempre sean blancos cuando el botón está activo */
.btn-group .btn-primary i,
.btn-group .btn-info i,
.btn-group .btn-success i {
    color: white !important;
}

/* Iconos con color del borde cuando está outline */
.btn-group .btn-outline-primary i {
    color: #0891b2 !important;
}

.btn-group .btn-outline-info i {
    color: #17a2b8 !important;
}

.btn-group .btn-outline-success i {
    color: #28a745 !important;
}

/* Al hacer hover, los iconos también se vuelven blancos */
.btn-group .btn-outline-primary:hover i,
.btn-group .btn-outline-info:hover i,
.btn-group .btn-outline-success:hover i {
    color: white !important;
}

/* Eliminar borde entre botones del grupo */
.btn-group .btn:not(:last-child) {
    border-right: 1px solid rgba(255,255,255,0.3);
}

/* Estado activo sin transformación */
.btn-group .btn-primary:active,
.btn-group .btn-info:active,
.btn-group .btn-success:active {
    transform: none;
}

/* ================================================================
   STATS CARDS - RESPONSIVE CON TOGGLE EN MÓVIL
   ================================================================ */

/* Contenedor de estadísticas con toggle */
.stats-section {
    position: relative;
}

/* Botón toggle para móvil (oculto por defecto) */
.stats-toggle-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: 600;
    transition: all 0.3s ease;
}

.stats-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.stats-toggle-btn i {
    margin-right: 8px;
}

/* En móvil: ocultar stats por defecto y mostrar botón */
@media (max-width: 768px) {
    .stats-toggle-btn {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .stats-container {
        display: none;
        animation: slideDown 0.3s ease-out;
    }
    
    .stats-container.show {
        display: block !important;
    }
    
    /* Ajustar tamaño de cards en móvil */
    .stats-card {
        margin-bottom: 15px;
    }
    
    .stats-number,
    .stat-number {
        font-size: 1.8rem !important;
    }
    
    .stats-label,
    .stat-label {
        font-size: 0.85rem !important;
    }
}

/* Animación de apertura */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Backdrop cuando stats están abiertas en móvil */
.stats-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .stats-backdrop.show {
        display: block;
    }
}
