/* ==========================================================================
   CSS principal - Portafolio Académico UNMSM
   Estética: Clinical Glass (Frosted Glassmorphism, Dark Teal/Cyan Accent)
   ========================================================================== */

:root {
    /* Paleta de Colores HSL Curada */
    --bg-base: hsl(224, 25%, 9%);
    --bg-surface: rgba(15, 23, 42, 0.45);
    --bg-surface-hover: rgba(30, 41, 59, 0.6);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-focus: rgba(0, 229, 255, 0.25);
    
    --primary: hsl(188, 100%, 45%); /* Cyan Clínico */
    --primary-glow: rgba(0, 229, 255, 0.15);
    --primary-hover: hsl(188, 100%, 55%);
    
    --secondary: hsl(162, 90%, 40%); /* Esmeralda Quirúrgico */
    --secondary-glow: rgba(16, 185, 129, 0.15);
    
    --accent-purple: hsl(265, 85%, 60%);
    --accent-purple-glow: rgba(139, 92, 246, 0.15);

    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(215, 20%, 65%);
    --text-muted: hsl(215, 15%, 45%);
    
    --sidebar-width: 260px;
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset de Estilos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Efectos de Brillo del Fondo */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: -1;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    background-color: var(--primary);
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    background-color: var(--secondary);
}

/* Contenedor Principal (Flexbox) */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar de Vidrio Esmerilado */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 30, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-base);
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.brand-text h2 {
    font-size: 1.15rem;
    letter-spacing: 1px;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Menú de Navegación */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 1.15rem;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
    border-color: var(--border-glass);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: var(--border-glass-focus);
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.05);
}

.nav-item.active i {
    transform: scale(1.1);
}

.sidebar-footer {
    margin-top: auto;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-info h4 {
    font-size: 0.85rem;
}

.user-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Área de Contenido Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Header Superior */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.page-title h1 {
    font-size: 2rem;
    background: linear-gradient(120deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Buscador Glass */
.search-box {
    position: relative;
    width: 360px;
}

.search-box i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1.2rem 0.8rem 2.75rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
    background: rgba(15, 23, 42, 0.6);
}

/* Tarjetas Estilo Clinical Glass */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.75rem;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Tarjeta de Bienvenida */
.welcome-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
    border: 1px solid rgba(6, 182, 212, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    overflow: hidden;
}

.welcome-text h2 {
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.welcome-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 700px;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.welcome-buttons {
    display: flex;
    gap: 1rem;
}

.welcome-illustration {
    font-size: 5rem;
    color: var(--primary);
    opacity: 0.15;
    transform: rotate(-10deg);
}

/* Botones Premium */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), hsl(188, 100%, 35%));
    color: var(--bg-base);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Grid de Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.icon-blue {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.icon-teal {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.icon-green {
    background: rgba(52, 211, 153, 0.1);
    color: hsl(150, 80%, 45%);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.stat-data h3 {
    font-size: 1.65rem;
    line-height: 1.2;
}

.stat-data p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Grid del Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.recent-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-info { background: rgba(0, 229, 255, 0.15); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--secondary); }
.badge-warning { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.recent-item:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-icon {
    font-size: 1.1rem;
    color: var(--primary);
}

.item-info h4 {
    font-size: 0.85rem;
    font-weight: 550;
}

.item-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Vistas de Contenido */
.content-view {
    display: none;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.content-view.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header h2 {
    font-size: 1.75rem;
}

.view-header p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

/* Grid de Cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.course-header i {
    font-size: 2.25rem;
    opacity: 0.85;
}

.course-card h3 {
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.course-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.75rem;
}

.course-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.course-stats {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

.course-stat-item {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Filtros y Biblioteca */
.filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 550;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: var(--border-glass-focus);
}

/* Tabla de Recursos */
.resources-table-container {
    overflow-x: auto;
    padding: 0.5rem;
}

.resources-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.resources-table th, .resources-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.resources-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
}

.resources-table td {
    font-size: 0.9rem;
}

.resources-table tr:last-child td {
    border-bottom: none;
}

.resource-title-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.resource-title-cell h4 {
    font-weight: 550;
}

.resource-title-cell p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.resource-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* Espacio de Profesores */
.profesores-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.info-card p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.check-list li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--secondary);
}

.quote-box {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary);
    padding: 1.25rem;
    border-radius: 0 12px 12px 0;
    margin-top: 1.5rem;
}

.quote-box p {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.quote-box cite {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Modales Premium */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 650px;
    position: relative;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

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

.modal-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.modal-header h2 {
    font-size: 1.45rem;
}

.modal-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-body {
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.modal-body h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1.25rem;
}

/* Personalización del Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsividad */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
        align-items: center;
    }
    
    .brand-text, .nav-item span, .user-info {
        display: none;
    }
    
    .brand {
        margin-bottom: 2rem;
    }
    
    .nav-item {
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 2rem;
    }
    
    .dashboard-grid, .profesores-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .welcome-illustration {
        display: none;
    }
}

/* ==========================================================================
   Estilos de Vista Previa de Documentos (Iframe/Pre)
   ========================================================================== */
.modal-content.modal-preview {
    max-width: 950px;
    width: 95%;
}

.modal-content.modal-preview .modal-body {
    max-height: 70vh;
    height: 60vh;
    padding-right: 0;
    overflow-y: hidden;
}

.document-viewer {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background: rgba(10, 15, 30, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.document-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.preview-loader {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    z-index: 1;
    pointer-events: none;
}

.preview-loader i {
    font-size: 2.25rem;
    color: var(--primary);
    animation: fa-spin 1.2s linear infinite;
}

.txt-preview {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    border-radius: 12px;
    overflow-y: auto;
    white-space: pre-wrap;
    text-align: left;
    border: 1px solid var(--border-glass);
}

/* ==========================================================================
   Estilos Agregados: Selector de Ciclos
   ========================================================================== */
.cycle-tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.cycle-tabs-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cycle-tabs-label i {
    color: var(--primary);
}

.cycle-tabs {
    display: flex;
    gap: 0.5rem;
}

.cycle-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.cycle-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.cycle-tab.active {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

/* ==========================================================================
   Detalle de Asignatura (Curso)
   ========================================================================== */
.course-detail-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.5) 0%, rgba(10, 15, 30, 0.6) 100%);
    border: 1px solid var(--border-glass);
    padding: 2rem;
    position: relative;
}

.course-detail-title-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.course-title-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-base);
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
}

.course-title-text h2 {
    font-size: 1.85rem;
    line-height: 1.2;
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.course-title-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.15rem;
}

.course-detail-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 900px;
}

.course-tabs-container {
    background: rgba(10, 15, 30, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 0.4rem;
    border: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
}

.course-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
}

.course-tab {
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.course-tab i {
    font-size: 1rem;
}

.course-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.02);
}

.course-tab.active {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: var(--border-glass-focus);
}

.course-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.course-tab-content.active {
    display: block;
}

/* ==========================================================================
   Sección de Referencias NANDA-NOC-NIC
   ========================================================================== */
.references-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

.reference-search-card, .reference-books-card {
    height: 100%;
}

.reference-search-card h3, .reference-books-card h3 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.nanda-results-list {
    max-height: 250px;
    overflow-y: auto;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nanda-result-item {
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.nanda-result-item:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.nanda-result-item h4 {
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.nanda-result-item p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.nanda-expanded-detail {
    padding: 1rem;
    background: rgba(10, 15, 30, 0.45);
    border: 1px solid var(--primary);
    border-radius: 10px;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.1);
}

.nanda-expanded-detail h4 {
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.25rem;
}

.nanda-detail-section {
    margin-top: 0.75rem;
}

.nanda-detail-section h5 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.nanda-detail-section p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Galería de Esquemas Anatómicos
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.02);
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-focus);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.15);
}

.gallery-img-wrap {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-img-wrap i {
    font-size: 3rem;
    color: var(--text-muted);
}

.gallery-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-img-wrap img {
    transform: scale(1.08);
}

.gallery-info {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.gallery-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.gallery-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Simuladores Clínicos (Estética Neón Clinical Glass)
   ========================================================================== */
.simulation-panel {
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.8) 0%, rgba(5, 8, 16, 0.9) 100%);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 16px;
    padding: 1.5rem;
    color: hsl(188, 100%, 75%);
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 229, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.simulation-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    z-index: 10;
    pointer-events: none;
    opacity: 0.45;
}

.simulation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 229, 255, 0.2);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.simulation-header h3 {
    color: var(--primary);
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--primary-glow);
}

.simulation-status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.simulation-status-badge.stable {
    color: var(--secondary);
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
    text-shadow: 0 0 5px var(--secondary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.simulation-status-badge.critical {
    color: #ea4444;
    border-color: #ea4444;
    background: rgba(234, 68, 68, 0.1);
    text-shadow: 0 0 5px #ea4444;
    box-shadow: 0 0 10px rgba(234, 68, 68, 0.2);
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.simulation-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

.simulation-screen-wrapper {
    background: #040810;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    position: relative;
}

.simulation-screen {
    width: 100%;
    height: 240px;
    display: block;
    background: #020408;
    border-radius: 8px;
}

.simulation-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sim-control-group {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sim-control-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.sim-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-sim {
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    text-align: center;
}

.btn-sim:hover {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
}

.btn-sim.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.sim-numeric-readouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.numeric-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}

.numeric-card label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.numeric-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: monospace;
    text-shadow: 0 0 10px currentColor;
}

/* Clases específicas para el simulador de presión */
.bp-pump-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    height: 100%;
}

.bp-bulb {
    width: 60px;
    height: 90px;
    background: radial-gradient(circle at 35% 35%, #475569 0%, #1e293b 80%, #0f172a 100%);
    border-radius: 30px 30px 40px 40px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    transition: transform 0.1s ease;
}

.bp-bulb:active {
    transform: scale(0.92);
}

.bp-bulb-screw {
    width: 20px;
    height: 12px;
    background: #64748b;
    border: 1px solid #475569;
    border-radius: 3px;
    position: absolute;
    bottom: -15px;
    left: 20px;
    cursor: pointer;
}

.bp-valve-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
    margin-top: 1rem;
}

/* Peachímetro y Simulador de Bioquímica */
.beaker-container {
    width: 100%;
    height: 220px;
    background: rgba(255,255,255,0.01);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.beaker {
    width: 120px;
    height: 160px;
    border: 3px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 15px 15px;
    position: relative;
    overflow: hidden;
    background: transparent;
    z-index: 2;
}

.beaker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(transparent, #cbd5e1);
    opacity: 0.2;
}

.beaker-liquid {
    width: 100%;
    height: 50%;
    background: rgba(14, 165, 233, 0.25);
    position: absolute;
    bottom: 0;
    left: 0;
    transition: height 0.5s ease, background 0.8s ease;
}

.ph-sensor-probe {
    width: 14px;
    height: 130px;
    background: linear-gradient(90deg, #64748b, #334155);
    border-radius: 4px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 5;
    transition: transform 0.5s ease;
}

.ph-sensor-probe::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2px;
    width: 10px;
    height: 12px;
    background: rgba(0, 229, 255, 0.4);
    border: 1px solid var(--primary);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 8px var(--primary);
}

@media (max-width: 992px) {
    .references-layout, .simulation-grid {
        grid-template-columns: 1fr;
    }
}

/* Grid de Laboratorios y Simuladores Directos */
.laboratorios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.lab-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    height: 100%;
    transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.lab-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-focus);
    box-shadow: 0 8px 30px rgba(0, 229, 255, 0.08);
}

.lab-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lab-card-header i {
    font-size: 2rem;
    opacity: 0.9;
}

.lab-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.lab-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.lab-card .btn {
    margin-top: auto;
    width: 100%;
    justify-content: center;
}

/* ==========================================================================
   Estilos Avanzados para los 4 Nuevos Simuladores
   ========================================================================== */

/* 1. Semiología e IAPP */
.torso-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 400px;
    margin: 0 auto;
    background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.torso-svg-wrapper {
    position: relative;
    width: 280px;
    height: 380px;
}

.semiologia-hotspot {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.2);
    border: 2px solid var(--primary);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--primary);
}

.semiologia-hotspot:hover, .semiologia-hotspot.active {
    background: rgba(0, 229, 255, 0.6);
    border-color: #ffffff;
    box-shadow: 0 0 20px #00e5ff, 0 0 30px #00e5ff;
    transform: translate(-50%, -50%) scale(1.25);
}

/* 2. Espectrofotometría */
.spectro-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

.spectro-chamber {
    background: #020408;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cuvette-rack {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    background: rgba(255,255,255,0.02);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.cuvette-item {
    width: 30px;
    height: 90px;
    border: 2px solid #94a3b8;
    border-top: none;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.cuvette-item:hover, .cuvette-item.selected {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    transform: translateY(-4px);
}

.cuvette-fluid {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 0 0 4px 4px;
    transition: all 0.3s ease;
}

/* 3. Valoración Pupilar */
.eyes-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #030712;
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    border: 1px solid var(--border-glass);
    position: relative;
    overflow: hidden;
}

.clinical-eye {
    width: 140px;
    height: 100px;
    background: #ffffff;
    border-radius: 50% / 50%;
    position: relative;
    overflow: hidden;
    border: 3px solid #1e293b;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.clinical-iris {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #0284c7 30%, #0369a1 70%, #0c4a6e 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.9);
}

.clinical-pupil {
    width: 30px;
    height: 30px;
    background: #000000;
    border-radius: 50%;
    box-shadow: inset 0 0 5px rgba(255,255,255,0.4);
    transition: width 0.15s ease, height 0.15s ease;
}

.flashlight-tool {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(254, 240, 138, 0.3);
    border: 2px solid #fef08a;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 100;
    box-shadow: 0 0 40px #fef08a, 0 0 80px #fef08a;
    display: none;
}

/* 4. Dosificación e Infusión */
.infusion-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 1.5rem;
}

.drip-chamber-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #020408;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    padding: 1.5rem;
}

.drip-chamber {
    width: 45px;
    height: 160px;
    border: 3px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
}

.drip-nozzle {
    width: 8px;
    height: 18px;
    background: rgba(255,255,255,0.4);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 2px 2px;
}

.drip-fluid-bottom {
    width: 100%;
    height: 35px;
    background: rgba(255,255,255,0.15);
    border-top: 2px solid rgba(255,255,255,0.4);
    position: absolute;
    bottom: 0;
    left: 0;
}

.falling-drop {
    width: 6px;
    height: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    animation: dropFall 1s infinite linear;
    display: none;
}

@keyframes dropFall {
    0% {
        top: 18px;
        opacity: 1;
        transform: translateX(-50%) scaleY(1);
    }
    80% {
        top: 115px;
        opacity: 1;
        transform: translateX(-50%) scaleY(1.2);
    }
    100% {
        top: 125px;
        opacity: 0;
        transform: translateX(-50%) scale(1.5);
    }
}

/* ==========================================================================
   ESTILOS: ACORDEONES SEMANALES DE RECURSOS
   ========================================================================== */
.semana-acordeon {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.semana-acordeon:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.05);
}

.semana-acordeon.active {
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 4px 25px rgba(0, 229, 255, 0.08);
}

.semana-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
    background: rgba(30, 41, 59, 0.3);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.semana-header:hover {
    background: rgba(30, 41, 59, 0.5);
}

.semana-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.semana-title-wrap h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
}

.semana-badge {
    background: rgba(0, 229, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
}

.semana-icon-toggle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.semana-acordeon.active .semana-icon-toggle {
    transform: rotate(180deg);
    color: var(--primary);
}

.semana-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid transparent;
}

.semana-acordeon.active .semana-content {
    max-height: 2000px; /* Suficiente para albergar listas grandes */
    border-top: 1px solid var(--border-glass);
}

.semana-content-inner {
    padding: 0.5rem;
}

/* Ajustes de las tablas dentro del acordeón */
.semana-content .resources-table {
    margin: 0;
    border: none;
    background: transparent;
}

.semana-content .resources-table tr {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.semana-content .resources-table tr:last-child {
    border-bottom: none;
}


/* ==========================================================================
   ESTILOS: SIMULADOR DE ESTUDIO (NOTEBOOKLM)
   ========================================================================== */
.estudio-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .estudio-container {
        grid-template-columns: 1fr;
    }
}

.estudio-sidebar {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.5);
}

.modalidad-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modalidad-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.25s, background-color 0.25s, box-shadow 0.25s;
}

.modalidad-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.4);
}

.modalidad-card.active {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.06);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.modalidad-card .mode-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    transition: color 0.25s;
}

.modalidad-card.active .mode-icon {
    color: var(--primary);
}

.modalidad-card .mode-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.15rem;
}

.modalidad-card .mode-info p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* Área de interacción del Test */
.estudio-test-area {
    min-height: 400px;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.estudio-pane {
    display: none;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.35s ease;
}

.estudio-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Vistas Específicas */
.welcome-pane-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.features-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.features-badges span {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Spinner de carga tipo IA */
.loading-spinner-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
}

.clinical-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 229, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear, pulseGlow 1.5s infinite ease-in-out;
    margin-bottom: 1.5rem;
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 0 0 25px rgba(0, 229, 255, 0.5); }
}

.loading-spinner-wrap h4 {
    font-size: 1rem;
    color: white;
    font-weight: 500;
}

.loading-spinner-wrap p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Pane del Cuestionario Activo */
.quiz-header {
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 1.25rem 0.75rem;
    background: rgba(30, 41, 59, 0.15);
}

.quiz-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.quiz-doc-title {
    color: var(--primary);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.quiz-counter {
    color: var(--text-secondary);
    font-family: monospace;
}

.quiz-progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.quiz-question-box {
    padding: 1.5rem 1.25rem 1rem;
}

.quiz-question-box h4 {
    font-size: 1.05rem;
    line-height: 1.5;
    color: white;
    font-weight: 500;
}

.quiz-options-list {
    padding: 0 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.quiz-option-btn {
    text-align: left;
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.quiz-option-btn:hover:not([disabled]) {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(30, 41, 59, 0.55);
    color: white;
    transform: translateX(4px);
}

.quiz-option-btn .opt-letter {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.quiz-option-btn.correct {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: var(--secondary) !important;
    color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.quiz-option-btn.correct .opt-letter {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--secondary);
    color: #10b981;
}

.quiz-option-btn.incorrect {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.quiz-option-btn.incorrect .opt-letter {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.quiz-explanation-box {
    margin: 0 1.25rem 1.25rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass-focus);
    animation: slideDown 0.3s ease;
}

.quiz-explanation-box h5 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-explanation-box h5.correct-title {
    color: var(--secondary);
}

.quiz-explanation-box h5.incorrect-title {
    color: #ef4444;
}

.quiz-explanation-box p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

@keyframes slideDown {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Vista de Resultados */
.results-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.score-circle-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 1.25rem;
}

.score-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 7;
}

.score-fill-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 282.6; /* 2 * PI * r (r=45) */
    stroke-dashoffset: 282.6;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    font-family: monospace;
}

.score-lbl {
    font-size: 0.55rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: -2px;
}

.results-summary-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.results-summary-cards .res-card {
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    min-width: 100px;
}

.results-summary-cards .res-card .num {
    font-size: 1.15rem;
    font-weight: bold;
    display: block;
    color: white;
    font-family: monospace;
}

.results-summary-cards .res-card .lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.results-recommendation-box {
    animation: fadeIn 0.5s ease;
}

/* Agregado del botón de cuestionario rápido en las tablas */
.quiz-quick-btn {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.quiz-quick-btn:hover {
    background: var(--primary);
    color: #0f172a;
    border-color: var(--primary);
}


