/* ========== VARIABLES GLOBALES ========== */
:root {
    --primary-bg: #000000;
    --text-color: #e7e7e7;
    --accent-color: #a7a7a7;
    --federados: #3498db;
    --novatos: #2ecc71;
    --juniors: #f39c12;
    --otros: #9b59b6;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
}

/* ========== RESET Y BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ========== EFECTOS VISUALES ========== */
.image-gradient {
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0.5;
    z-index: -1;
    max-width: 100%;
    height: auto;
}

.layer-blur {
    height: 0;
    width: 30rem;
    position: absolute;
    top: 20%;
    right: 0;
    box-shadow: 0 0 700px 15px white;
    rotate: -30deg;
    z-index: -1;
}

/* ========== HEADER ========== */
header {
    padding: 1rem 5rem;
    z-index: 999;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 3rem;
    font-weight: 300;
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
}

.logo span {
    font-weight: 500;
    margin-left: 0.5rem;
}

.navbar {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list a {
    text-decoration: none;
    color: inherit;
    font-size: 1rem;
    letter-spacing: 0.1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-list a:hover {
    color: var(--accent-color);
}

/* ========== PROFILE MENU ========== */
.profile-container {
    position: relative;
    margin-left: 3rem;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.profile-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #4a6bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1.1rem;
}

.profile-email {
    font-size: 0.9rem;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.profile-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s;
    color: white;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #2c3e50;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-dropdown .dropdown-item {
    width: 100%;
    padding: 0.75rem 1.5rem;
    text-align: left;
    background: none;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.profile-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

/* ========== CONTENT ========== */
.content-wrapper {
    padding: 2rem 5rem;
    color: var(--text-color);
}

/* ========== TABLAS ========== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 100%;
    position: relative;
    background-color: rgba(30, 30, 30, 0.8);
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-color);
}

.table th, .table td {
    padding: 0.75rem;
    vertical-align: middle;
    border: 1px solid #333;
    color: var(--text-color);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #2c3e50;
    color: white;
}

/* ========== COLUMNAS FIJAS ========== */
.columna-fija {
    position: sticky;
    left: 0;
    z-index: 11;
    background-color: rgba(30, 30, 30, 0.95);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.columna-estadisticas {
    position: sticky;
    right: 0;
    z-index: 11;
    background-color: rgba(30, 30, 30, 0.95);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

/* ========== DÍAS ========== */
.dia-semana {
    font-size: 0.9rem;
    font-weight: bold;
}

.dia-numero {
    font-size: 0.75rem;
    opacity: 0.8;
}

.domingo {
    background-color: rgba(108, 117, 125, 0.2) !important;
    color: #6c757d !important;
}

/* ========== BADGES ========== */
.badge-federados {
    background-color: var(--federados) !important;
}

.badge-novatos {
    background-color: var(--novatos) !important;
}

.badge-juniors {
    background-color: var(--juniors) !important;
    color: #212529 !important;
}

.badge-otros {
    background-color: var(--otros) !important;
}

/* ========== ESTADÍSTICAS ========== */
.estadisticas-cell {
    min-width: 100px;
    text-align: center;
}

.total-presente {
    color: var(--success);
    font-weight: bold;
}

.total-ausente {
    color: var(--danger);
    font-weight: bold;
}

/* ========== BOTONES ========== */
.btn-edicion {
    transition: all 0.3s ease;
}

.btn-edicion:hover {
    transform: translateY(-2px);
}

/* ========== DROPDOWNS ========== */
.dropdown-menu {
    background-color: rgba(30, 30, 30, 0.95);
    border: 1px solid #333;
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.dropdown-item.active {
    background-color: var(--accent-color);
    color: var(--primary-bg);
}

/* ========== TARJETAS ========== */
.card {
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid #333;
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-header {
    background-color: #2c3e50;
    border-bottom: 1px solid #333;
    padding: 1rem 1.5rem;
}

/* ========== FORM CONTROLS ========== */
.form-control, .form-select, .form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #444;
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(167, 167, 167, 0.25);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    header {
        padding: 1rem 2rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .nav-list {
        gap: 1.5rem;
    }

    .profile-container {
        margin-left: 1.5rem;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .columna-fija, .columna-estadisticas {
        position: relative;
        left: auto;
        right: auto;
        box-shadow: none;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .navbar {
        width: 100%;
        justify-content: space-between;
    }

    .profile-email {
        display: none;
    }
}

/* ========== SWEETALERT ========== */
.swal2-popup {
    background-color: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid #333 !important;
    color: var(--text-color) !important;
}

/* ========== FORM VISIBILITY ========== */
label {
    color: var(--text-color) !important;
}

.small, .text-muted {
    color: #a7a7a7 !important;
}

/* ========== RADIO BUTTONS ========== */
input[type="radio"] {
    accent-color: var(--success);
}

input[type="radio"]:checked {
    background-color: var(--success);
    border-color: var(--success);
}

/* ========== COLOR NEGRO PARA NOMBRES ========== */
.atleta-nombre {
    color: #000 !important;
}

/* ========== FACTURAS (COMENTADO) ========== */

.factura-card {
    background-color: #ffffff;
    color: #212529;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.factura-card .card-header {
    background-color: #2c3e50;
    color: white;
}

.factura-card .text-dark {
    color: #212529 !important;
}

.factura-card .card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
    padding: 2rem;
}

.factura-card .border-bottom {
    border-color: #e0e0e0 !important;
}

.factura-card .card-header {
    padding: 1.25rem 2rem;
    border-bottom: none;
}

.factura-card p,
.factura-card h5 {
    opacity: 1 !important;
    text-shadow: none !important;
}

.table-responsive .table {
    background-color: white !important;
}

.table-responsive .table td,
.table-responsive .table th {
    color: #000000 !important;
}

.table-responsive .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

.table-responsive .table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.table-responsive .table-dark {
    background-color: #2c3e50 !important;
}

.table-responsive .table-dark th {
    color: white !important;
    border-color: #3a5169 !important;
}


/* ========== ASISTENCIAS CELDA (COMENTADO) ========== */

.asistencia-cell {
    position: relative;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.asistencia-cell .form-check {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.asistencia-cell .form-check-input {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.asistencia-cell i {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}


/* ========== ATLETAS GRID ========== */
.atletas-grid-container {
    width: 100%;
    overflow-x: auto;
}

.atletas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.atleta-card-container {
    display: flex;
    flex-direction: column;
}

.atleta-card {
    position: relative;
    min-height: 320px;
    transition: all 0.3s ease;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.atleta-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.img-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-right: 15px;
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.atleta-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    position: relative;
    /* Se quita cursor: pointer; */
    /* Se quita transform: scale(1.8); */
    border-radius: 50%; /* Cambiado a circular para que coincida con el contenedor */
}

/* Efecto de zoom en la foto al pasar el cursor sobre la tarjeta */
.atleta-card:hover .atleta-foto {
    transform: scale(2); /* Zoom sutil */
}

.foto-placeholder {
    width: 100%;
    height: 100%;
    background: #34495e;
    color: #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: white;
}

.text-muted.small {
    color: #ecf0f1 !important;
    opacity: 0.9;
    font-size: 0.9rem;
}

.stats-container {
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
}

.stat-item:nth-child(1) .stat-value {
    color: #2ecc71;
}

.stat-item:nth-child(2) .stat-value {
    color: #e74c3c;
}

.stat-item:nth-child(3) .stat-value {
    color: #f39c12;
}

/* ========== PAGINACIÓN ========== */
.pagination-custom {
    margin-top: 2rem;
}

.pagination-custom .page-item {
    margin: 0 0.25rem;
}

.pagination-custom .page-link {
    color: #2c3e50;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pagination-custom .page-link:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.pagination-custom .page-item.active .page-link {
    background-color: #2c3e50;
    border-color: #2c3e50;
    color: white;
}

.pagination-custom .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

.pagination-custom .bi {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .atletas-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .img-container {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 576px) {
    .atletas-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== INDICADORES DE JUSTIFICACIÓN ========== */
.indicador-justificacion {
    font-size: 10px !important;
    padding: 2px 5px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
    border: 1px solid white !important;
}

.indicador-justificacion:hover {
    transform: scale(1.2) !important;
    background-color: #f39c12 !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.3) !important;
}

/* Asegurar que las celdas tengan posición relativa para los indicadores */
.asistencia-cell {
    position: relative !important;
}

/* Estilos para el modal de justificación */
.swal2-popup {
    background-color: #ffffff !important;
    color: #333 !important;
    border-radius: 10px !important;
    border: 1px solid #dee2e6 !important;
}

.swal2-title {
    color: #2c3e50 !important;
}

.swal2-confirm {
    background-color: #2c3e50 !important;
}

/* Mejorar visibilidad de botones en modo oscuro */
#iniciarBtn, #guardarBtn {
    font-weight: 500;
    transition: all 0.3s ease;
}

#iniciarBtn:hover, #guardarBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
