.hidden {
    display: none !important;
}

.hidden-role {
    display: none !important;
}

/* Para asegurarnos de que al cargar la página solo se vea el login */
/*
.view {
    display: none;
}
*/

#view-login {
    display: block; /* Solo el login visible al inicio */
}

/* Variables de color y diseño */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --primary: #d4af37; /* Dorado BJJ */
    --accent: #b22222;  /* Rojo para alertas/bajas */
    --text-main: #e0e0e0;
    --text-dim: #a0a0a0;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- HEADER --- */
header {
    background-color: #000;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#user-display {
    display: flex;          /* Alinea logo y texto en la misma fila */
    align-items: center;    /* Centra verticalmente el logo con el texto */
    gap: 12px;              /* Espacio elegante entre logo y texto */
    
    /* Tus estilos originales */
    font-weight: bold;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Estilo para que el logo no se descontrole */
#user-display img {
    height: 24px;           /* Ajusta según el tamaño de tu cabecera */
    width: auto;
    object-fit: contain;    /* Evita que el logo se deforme */
}

/* --- CONTENEDORES --- */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* --- FORMULARIOS --- */
input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: white;
    font-size: 16px; /* Evita zoom automático en iPhone */
}

button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    transition: transform 0.1s, opacity 0.2s;
}

button:active { transform: scale(0.98); }

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: black;
    margin-top: 10px;
}

.btn-add {
    background: #2e7d32;
    color: white;
    padding: 10px 20px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 12px;
}

.btn-small {
    padding: 5px 12px;
    background: #8f7b3c;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-small:hover {
    filter: brightness(1.2);
}

/* --- GRID DE ALUMNOS (DASHBOARD) --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.grid-list {
    display: grid;
    gap: 15px;
    /* Móvil: 1 columna | Tablet/PC: 2 o 3 columnas */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card-alumno {
    background: var(--bg-card);
    padding: 15px;
    border-left: 5px solid transparent;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px
}

.close-btn:hover {
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* El contenedor que cubre toda la pantalla */
#modal-registro {
    display: none;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fondo oscuro semitransparente */
    display: none; /* Se activa con JS */
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Por encima de las cards */
    backdrop-filter: blur(5px); /* Efecto de desenfoque moderno */
}

/* Cuando el modal tiene una clase para mostrarse */
#modal-registro.modal.active {
    display: flex !important;
}

/* La tarjeta blanca/oscura del formulario */
.modal-content.card {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #444;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto; /* Por si el formulario es largo */
}

select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: white;
}

.info-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 10px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: #2a2a2a;
    border-radius: 6px;
    margin: 10px 0;
    padding: 8px 12px;
    cursor: pointer;
}

.checkbox-container label {
    font-size: 0.9rem;
    color: var(--text-dim);
    cursor: pointer;
    margin:0;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* Efecto para el icono de fuego */
.fire-icon {
    filter: drop-shadow(0 0 5px orange);
    font-size: 1.2rem;
    cursor: help;
}

/* 1. Usuario Activo (No competidor) - Verde */
.border-alta {
    border-left: 5px solid #2ecc71 !important; /* Verde esmeralda */
    background: linear-gradient(145deg, #1e1e1e, #1a251a) !important; 
}

/* 2. Usuario Competidor - Naranja*/
.border-competidor {
    border-left: 5px solid #3498db !important;
    background: linear-gradient(145deg, #1e1e1e, #151a25) !important;
}

/* 3. Usuario de Baja - Rojo */
.border-baja {
    border-left: 5px solid #e74c3c !important; /* Rojo alizarina */
    background: linear-gradient(145deg, #1e1e1e, #251a1a) !important;
    opacity: 0.8;
}

/* Badge para identificar profesores en la lista */
.badge-profesor {
    background: var(--primary);
    color: black;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 10px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-body p {
    margin: 2px 0;
}

.day-column {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 10px;
    min-height: 200px;
    border: 1px solid #333;
}

.day-column h3 {
    text-align: center;
    color: var(--primary);
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.class-card {
    background: #2a2a2a;
    border-left: 4px solid var(--primary);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative; /* Para la X de eliminar */
}

.btn-delete-mini {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.class-time {
    font-weight: bold;
    font-size: 0.85rem;
    color: #aaa;
}

.class-title {
    margin: 5px 0;
    font-weight: bold;
}

.class-prof {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.btn-join {
    background-color: var(--primary); /* El dorado/azul de tu tema */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-top: 8px;
    width: 100%;
    transition: background 0.3s;
}

.btn-join:hover {
    background-color: #2980b9; /* Un tono más oscuro al pasar el ratón */
}

/* Estilo para los nombres de los alumnos */
.enrollment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.alumno-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.no-students {
    color: #666;
    font-style: italic;
}

.enrollment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 5px;
}

.btn-leave {
    background-color: #e67e22; /* Naranja */
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    width: 100%;
    margin-bottom: 8px;
    transition: background 0.3s;
}

.btn-leave:hover {
    background-color: #d35400;
}

/* Opcional: Resaltar la tarjeta si el alumno está dentro */
.card-inscrito {
    border: 1px solid #2ecc71;
    background-color: rgba(46, 204, 113, 0.05);
}

.btn-leave {
    background-color: #e67e22; /* Naranja */
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    width: 100%;
    margin-bottom: 8px;
    transition: background 0.3s;
}

.btn-leave:hover {
    background-color: #d35400;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--belt-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    margin-right: 20px;
    box-shadow: 0 0 15px var(--belt-glow);
}

.badge-fire {
    font-size: 0.7rem;
    background: rgba(255, 69, 0, 0.2);
    color: #ff4500;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #222;
}

.detail-item .label { 
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}
.detail-item .value { color: #ddd; font-weight: 500; }
.detail-item p {
    margin: 0;
    font-size: 1rem;
    color: #ddd;
}

.profile-layout {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: visible;  /* Importante para ver el aura */
}

.profile-main-card {
    background: #121212;
    border: 2px solid var(--belt-color); /* Color del borde dinámico */
    box-shadow: 0 0 20px var(--belt-glow); /* Brillo dinámico */
    transition: all 0.5s ease;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    animation: pulse-glow 3s infinite ease-in-out;
}

/* 1. Definición de Colores por Cinturón */
.belt-blanco { --belt-color: #ffffff; --belt-glow: rgba(255, 255, 255, 0.3); }
.belt-blanco .profile-avatar { color: #333; }
.belt-azul   { --belt-color: #0055ff; --belt-glow: rgba(0, 85, 255, 0.4); }
.belt-morado { --belt-color: #a020f0; --belt-glow: rgba(160, 32, 240, 0.4); }
.belt-marron { --belt-color: #8b4513; --belt-glow: rgba(139, 69, 19, 0.4); }
/* El negro suele llevar detalles en rojo o dorado en BJJ para que destaque */
.belt-negro  { --belt-color: #222222; --belt-glow: rgba(255, 0, 0, 0.5); }

.belt-azul .val-text, .belt-morado .val-text, .belt-marron .val-text {
    color: var(--belt-color);
}

.profile-header-top {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.status-pill {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}
.status-pill.active { background: #2ecc7122; color: #2ecc71; }

/* Grid de Información */
.bjj-stats {
    display: flex;
    justify-content: space-around; /* Reparte el espacio */
    align-items: flex-start;
    flex-wrap: wrap;       /* SI NO CABEN, EL TERCERO BAJA */
    gap: 10px;             /* Espacio entre los bloques */
    width: 100%;
}

.stat-item { 
    flex: 1;               /* Intentan ocupar el mismo espacio */
    min-width: 80px;       /* Para que no se compriman demasiado */
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-item.highlight {
    background: rgba(46, 204, 113, 0.1); /* Verde sutil */
    border-radius: 8px;
    padding: 5px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.stat-card label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 4px;
}

.stat-card .val-text {
    font-weight: bold;
    font-size: 1rem;
}

.asistencias-count {
    color: #2ecc71 !important; /* Verde vibrante */
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
    font-size: 1.2rem !important;
}

.stat-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value { font-weight: bold; font-size: 1rem; color: #fff; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    text-align: left;
    margin-bottom: 25px;
    border-top: 1px solid #222;
    padding-top: 20px;
}

.info-box label { display: block; font-size: 0.7rem; color: #555; }
.info-box span { color: #bbb; font-size: 0.9rem; word-break: break-all; }

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

.badge.competidor { background: #e67e2222; color: #e67e22; border: 1px solid #e67e2244; }
.badge.profesor { background: #9b59b622; color: #9b59b6; border: 1px solid #9b59b644; }

/* 5. Efecto de Brillo Animado (Opcional pero recomendado) */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 15px var(--belt-glow);
        border-color: var(--belt-color);
    }
    50% {
        box-shadow: 0 0 35px var(--belt-glow), 0 0 10px var(--belt-glow);
        border-color: rgba(255, 255, 255, 0.5); /* Un ligero destello en el borde */
    }
    100% {
        box-shadow: 0 0 15px var(--belt-glow);
        border-color: var(--belt-color);
    }
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

#form-create-class input, #form-create-class select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: #222;
    border: 1px solid #444;
    color: white;
    border-radius: 8px;
}

.form-row { display: flex; gap: 10px; }

.btn-save {
    background: #f1c40f; color: black;
    font-weight: bold; border: none; padding: 10px 20px;
    border-radius: 8px; cursor: pointer; flex: 1;
}

.btn-cancel {
    background: transparent; color: #888;
    border: none; cursor: pointer; padding: 10px;
}

/* Estilo para el botón según tu imagen */
.btn-add-class {
    background-color: #1e7232; /* El verde que aparece en tu imagen */
    color: #ffffff; /* Texto blanco puro */
    border: none; /* Sin borde por defecto */
    padding: 10px 20px; /* Espaciado interno generoso para dar "aire" al texto */
    border-radius: 12px; /* Bordes muy redondeados, como en tu imagen */
    font-weight: bold; /* Texto en negrita para mejor legibilidad */
    font-size: 1rem; /* Tamaño de fuente estándar y claro */
    cursor: pointer; /* Cursor de mano al pasar por encima */
    transition: background-color 0.3s ease, transform 0.1s ease; /* Transiciones suaves */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); /* Sombra suave para darle profundidad sobre fondo oscuro */
}

/* Efecto al pasar el ratón por encima (hover) */
.btn-add-class:hover {
    background-color: #268b3f; /* Un verde un poco más claro al pasar el ratón */
    transform: translateY(-2px); /* Pequeña elevación visual */
}

/* Efecto al hacer clic (active) */
.btn-add-class:active {
    transform: translateY(1px); /* Pequeño "hundimiento" al hacer clic */
    box-shadow: 0 2px 3px rgba(0,0,0,0.3); /* Sombra más pegada */
}

#header-actions {
    display: flex;
    justify-content: flex-end; /* Alinea el botón a la derecha */
    margin-bottom: 20px; /* Separa el botón del horario */
    padding: 0 10px; /* Pequeño margen lateral */
}

.modal-title {
    color: #f1c40f;
    font-size: 1.2rem;
    text-align: center;
    margin: 0; /* Limpia márgenes por defecto */
    padding-bottom: 10px;
    border-bottom: 1px solid #333; /* Línea separadora sutil */
    width: 100%;
}

.calendar-grid {
    display: flex;         /* o display: grid; */
    flex-direction: column; /* Para que los días sigan uno debajo de otro */
    gap: 20px;             /* El hueco exacto que quieras entre los días */
    padding: 10px;         /* Opcional: para que no peguen a los bordes de la pantalla */
}

/* Botón de Clase de Prueba */
.btn-trial-class {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%); /* Oro/Naranja */
    /*background:  var(--primary)*/
    color: #000;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 15px;
    width: 100%;
}

.btn-trial-class:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Etiqueta de Clase Llena (Gris/Bloqueado) */
.label-full {
    display: block;
    background-color: #333;
    color: #888;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px dashed #555;
    cursor: not-allowed;
}

/* Esta clase se añadirá cuando el cupo esté al máximo */
.class-card.full {
    border-left: 4px solid #ff4d4d !important; /* Rojo para clase llena */
}

.news-container {
    margin: 10px 20px;
}

.announcement {
    background: #1e1e1e; /* Fondo oscuro como tus tarjetas */
    border-left: 4px solid #ff8c00; /* Naranja como tu botón de desapuntarse */
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.announcement.priority {
    border-left-color: #dc3545; /* Rojo para cosas urgentes */
    background: #2a1515;
}

.announcement-tag {
    font-size: 0.7rem;
    font-weight: bold;
    background: rgba(255, 140, 0, 0.2);
    color: #ff8c00;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 10px;
    display: block; /* Ocupa todo el ancho */
    width: 100%;
    text-align: center; /* Centra el texto */
}

.admin-zone {
    margin: 10px 20px;
    display: flex;
    justify-content: flex-end;
}

.btn-add-news {
    background-color: transparent;
    border: 1px solid #ff8c00;
    color: #ff8c00;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-add-news:hover {
    background-color: #ff8c00;
    color: white;
}

.announcement-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-delete-news {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-delete-news:hover {
    background: #dc3545;
    color: white;
}

.announcement-author {
    display: block;
    margin-top: 8px; /* Espacio respecto al mensaje */
    font-size: 0.85rem;
    color: #bbb; /* Un gris más claro para que sea secundario */
    font-style: italic;
}

.announcement-author span {
    color: #ff8c00; /* Naranja para resaltar el nombre del entrenador */
    font-weight: bold;
    font-style: normal;
}

/* Asegura que el contenido principal tenga su espacio */
.announcement-body {
    display: inline-block;
    margin-left: 5px;
}

#modal-update-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fondo oscuro transparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.modal-edit-user-form {
    background-color: #1a1a1a; /* Gris muy oscuro como tus cards */
    border: 1px solid #d4af37; /* Borde dorado/naranja */
    border-radius: 8px;
    padding: 25px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto; /* Por si el móvil es pequeño */
    box-shadow: 0px 0px 20px rgba(212, 175, 55, 0.2);
}

/* Estilo para cada grupo de etiqueta e input */
.modal-edit-user-form > div {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.modal-edit-user-form label {
    color: #d4af37;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.modal-edit-user-form input, 
.modal-edit-user-form select {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 1rem;
}

.modal-edit-user-form input:focus {
    border-color: #ff8c00;
    outline: none;
}

/* Especial para el checkbox de competidor */
.modal-edit-user-form div label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.modal-edit-user-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #ff8c00;
}

/* Botón de Guardar */
.btn-save {
    background-color: #ff8c00; /* Naranja Lotus */
    color: black;
    font-weight: bold;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-save:hover {
    background-color: #e67e00;
}