/* =========================================================
   DISEÑO GOOGLE WORKSPACE (CALIFICACIONES Y ADMIN)
   ========================================================= */

:root {
    --g-bg: #f8f9fa;
    --g-surface: #ffffff;
    --g-border: #dadce0;
    --g-text-main: #202124;
    --g-text-muted: #5f6368;
    --g-blue: #1a73e8;
    --radius: 8px;
}

/* BLOQUEO DEL SCROLL GLOBAL (Esto evita que toda la página se mueva) */
body {
    background-color: var(--g-bg);
    color: var(--g-text-main);
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    overflow-x: hidden; /* Prohibido escrolear la página horizontalmente */
    width: 100vw;
}

/* ---------------------------------------------------
   1. TARJETA PRINCIPAL (ENVUELVE ALUMNO Y TABLA)
   --------------------------------------------------- */
.google-main-card {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Nada sale de esta tarjeta */
    margin-bottom: 24px;
}

/* Cabecera del Alumno (Ahora es interna) */
.alumno-header-interno {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid var(--g-border);
}

.alumno-foto {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid var(--g-border);
    object-fit: cover;
}

.alumno-info h3 {
    margin: 0 0 8px 0 !important;
    font-size: 1.25rem;
    font-weight: 500;
}

.badge { border-radius: 4px; padding: 6px 10px; font-weight: 500; font-size: 0.75rem;}
.bg-info { background: #e8f0fe !important; color: var(--g-blue) !important; }
.bg-secondary { background: #f1f3f4 !important; color: var(--g-text-muted) !important; }

/* ---------------------------------------------------
   2. EL SCROLL BLINDADO DE LA TABLA
   --------------------------------------------------- */
.scroll-wrapper {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block; /* Obligatorio para que funcione el overflow */
    box-sizing: border-box;
}

.google-table {
    width: 100%;
    min-width: 850px; /* Fuerza el ancho interno para activar el scroll */
    border-collapse: collapse;
}

.google-table th, 
.google-table td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid var(--g-border);
    white-space: nowrap; /* Evita que los números salten de línea */
    font-size: 0.875rem;
}

.google-table th {
    color: var(--g-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    background: #f8f9fa;
}

.google-table tbody tr:hover { background-color: #f1f3f4; }

/* ---------------------------------------------------
   3. COLUMNA FIJA ESTILO SHEETS
   --------------------------------------------------- */
.col-fija {
    position: sticky;
    left: 0;
    background-color: var(--g-surface);
    z-index: 2;
    text-align: left !important;
    border-right: 1px solid var(--g-border);
    min-width: 180px;
    max-width: 220px;
    white-space: normal !important; /* Permite saltos de línea solo en la materia */
}
.google-table th.col-fija { z-index: 3; background: #f8f9fa; }
.google-table tbody tr:hover .col-fija { background-color: #f1f3f4; }

/* ---------------------------------------------------
   4. TARJETAS PARA EL PANEL DE ADMINISTRADOR (NUEVO)
   --------------------------------------------------- */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-card {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: var(--g-text-main);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.admin-card:hover {
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    border-color: transparent;
    transform: translateY(-2px);
    color: var(--g-blue);
}

.admin-icon {
    font-size: 2.5rem;
    color: var(--g-blue);
}

/* Responsivo Móvil para Cabecera */
@media (max-width: 576px) {
    .alumno-header-interno { flex-direction: column; text-align: center; }
}

/* Pantalla de bloqueo total */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px); /* Efecto de desenfoque */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.maintenance-content {
    max-width: 500px;
    padding: 2rem;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.maintenance-icon {
    font-size: 4rem;
    color: #f4b400; /* Amarillo Google */
    margin-bottom: 1.5rem;
    /* animation: gear-spin 4s linear infinite; */
}

@keyframes gear-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.maintenance-title {
    font-weight: 700;
    color: #202124;
    margin-bottom: 1rem;
}

/* Contenedor del grupo */
.custom-action-group {
    border: 1px solid #ced4da;
    border-radius: 8px !important;
    overflow: hidden; /* Para que los botones respeten el redondeo */
    background: #fff;
    display: flex;
    align-items: stretch; /* Esto hace que todos midan lo mismo de alto */
}

/* Ajustes específicos para Select2 dentro del grupo */
.custom-action-group .select2-container--default .select2-selection--multiple {
    border: none !important; /* Quitamos el borde propio de select2 */
    min-height: 45px; /* Altura deseada */
    border-radius: 0 !important;
    padding-top: 4px;
}

/* Estilo de los botones laterales */
.btn-action-icon {
    border: none !important; /* Quitamos bordes para que no se dupliquen */
    border-left: 1px solid #ced4da !important; /* Solo línea divisoria */
    border-radius: 0 !important;
    width: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* Colores suaves al pasar el mouse */
#btnBloquearVarios:hover { background-color: #dc3545; color: white; }
#btnDesbloquearVarios:hover { background-color: #198754; color: white; }

/* Quitar el foco azul de bootstrap que rompe la estética */
.custom-action-group:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}

/* --- Contenedor de la Grilla de Bloqueados --- */
.blocked-grid-container {
    max-height: 300px; /* Altura máxima con scroll si hay muchos */
    overflow-y: auto;
    padding: 10px 5px;
}

/* --- Estilo de cada ítem de alumno (Foto Circular) --- */
.blocked-student-item {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    position: relative;
}

.blocked-photo-wrapper {
    width: 65px; /* Tamaño de la foto circular */
    height: 65px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid transparent; /* Borde oculto por defecto */
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.blocked-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la foto no se deforme */
}

/* --- Efecto Hover (Sombra suave) --- */
.blocked-student-item:hover .blocked-photo-wrapper {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

/* --- Estilo cuando el alumno es SELECCIONADO --- */
.blocked-student-item.selected .blocked-photo-wrapper {
    border-color: #1a73e8; /* Azul Google */
    box-shadow: 0 0 0 4px rgba(26,115,232,0.3);
}

/* --- Icono de "Check" integrado en la foto seleccionada (Opcional, muy visual) --- */
.blocked-student-item.selected::after {
    content: "\f058"; /* Icono fa-check-circle */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 0;
    right: 15%; /* Ajusta según el centrado */
    background: white;
    color: #1a73e8;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
}

/* Botón con tamaño fijo y centrado */
.btn-bloquear-fijo {
    width: 50px;
    height: 50px; /* Tamaño cuadrado constante */
    min-width: 50px; /* Evita que se encoja si el texto de al lado presiona */
    border-radius: 12px !important; /* Estilo moderno redondeado */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prohibido encogerse */
}

.btn-bloquear-fijo:hover {
    transform: scale(1.05);
    background-color: #bd2130;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Ajuste para que el Select2 se vea bien al lado del botón */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ced4da !important;
    border-radius: 10px !important;
    min-height: 50px !important; /* Para que iguale la altura inicial del botón */
    padding: 5px !important;
}

/* Si el Select2 crece mucho, este ajuste asegura que el botón no se pegue al borde superior */
.d-flex.align-items-center {
    align-items: center !important; /* Fuerza el centrado vertical constante */
}