/**
 * assets/css/schedule.css
 * Dolphins Swim School - Sistema de Pizarra Dinámica
 */

:root {
    --hour-width: 80px;      /* Columna de tiempo */
    --dock-width: 300px;     /* Ancho del Banquillo */
    --grid-border: #dee2e6;
    --row-height: 85px;      /* Altura base para 30 minutos */
}

/* 1. LAYOUT PRINCIPAL */
.schedule-main-layout {
    display: flex;
    height: calc(100vh - 150px);
    overflow: hidden;
    background-color: #fff;
    border: 1px solid var(--grid-border);
    border-radius: 8px;
}

/* 2. ÁREA DE ALBERCA CON SCROLL */
.pool-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    background: #fff;
}

/* 3. EL GRID DE 4 COLUMNAS (Hora + 3 Carriles) */
.pool-grid {
    display: grid;
    grid-template-columns: var(--hour-width) 1fr 1fr 1fr;
    width: 100%;
    min-width: 900px;
}

/* 4. ENCABEZADOS STICKY */
.grid-header {
    background-color: #f8f9fa;
    padding: 15px 5px;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid var(--grid-border);
    border-right: 1px solid var(--grid-border);
    position: sticky; 
    top: 0;
    z-index: 100;
}

/* 5. ETIQUETAS DE TIEMPO */
.time-label {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    background: #fdfdfd;
    border-bottom: 1px solid #eee;
    border-right: 2px solid var(--grid-border);
    height: var(--row-height);
    position: sticky;
    left: 0;
    z-index: 30;
}

/* 6. CELDAS DE CARRIL (SOPORTE PARA SPAN) */
.grid-cell {
    border-right: 1px solid var(--grid-border);
    border-bottom: 1px solid var(--grid-border);
    min-height: var(--row-height); /* Altura mínima de 30 min */
    padding: 5px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 7. BURBUJAS DE CLASE (CRECIMIENTO DINÁMICO) */
.class-bubble {
    border-radius: 8px;
    padding: 10px;
    color: #333;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 6px solid transparent;
    background-color: white;
    
    /* Importante: Ocupa todo el espacio que el grid-cell le de (span) */
    width: 100%;
    height: 100%; 
    
    cursor: grab;
    position: relative;
    z-index: 10;
    transition: transform 0.1s ease;
}

/* Clase para 1 Hora: El grid-cell ya tiene el span, esto asegura el visual */
.h-200 {
    min-height: calc((var(--row-height) * 2) - 10px);
}

/* 8. CONTROLES DE AJUSTE (Overlay) */
.class-bubble:hover .class-controls-overlay {
    display: flex;
}

.class-controls-overlay {
    display: none;
    position: absolute;
    right: 5px;
    top: 5px;
    gap: 3px;
    z-index: 50;
}

.btn-lane-adj {
    background: rgba(255,255,255,0.95);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-lane-adj:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* 9. COLORES POR NIVEL */
.bubble-basic         { background-color: #e8f5e9; border-left-color: #2e7d32; }
.bubble-intermediate  { background-color: #e3f2fd; border-left-color: #1565c0; }
.bubble-advanced      { background-color: #ffebee; border-left-color: #c62828; }
.bubble-adults        { background-color: #fff8e1; border-left-color: #f9a825; }
.bubble-first         { background-color: #f3e5f5; border-left-color: #7b1fa2; }

/* 10. CHIPS DE ALUMNOS (MODIFICADO PARA PERMITIR CLIC) */
.student-dropzone {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.student-chip {
    background: white;
    border-radius: 12px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    border: 1px solid #eee;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    /* Base para transición */
    transition: all 0.2s ease;
}

/* --- NUEVAS REGLAS PARA HACERLOS CLICKEABLES --- */
.student-chip.student-trigger {
    pointer-events: auto !important; /* Fuerza que el clic pase */
    cursor: pointer !important;      /* Manita de clic */
    position: relative;
    z-index: 100; /* Asegura que esté por encima de la burbuja arrastrable */
}

/* Efecto Hover para confirmar interactividad */
.student-chip.student-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    background-color: #f8f9fa;
    border-color: #0d6efd;
}

/* 11. EL BANQUILLO (Fijo) */
.banquillo-container {
    width: var(--dock-width);
    height: 100%;
    background-color: #f8f9fa;
    border-left: 2px solid var(--grid-border);
    display: flex;
    flex-direction: column;
}