/* Variables CSS para consistencia */
:root {
    /* Nueva Paleta "Ocean Breeze" - Moderna y Armoniosa */
    --primary-color: #0EA5E9;      /* Sky Blue - Azul cielo vibrante */
    --primary-dark: #0284C7;       /* Blue 600 - Azul más profundo */
    --secondary-color: #06B6D4;    /* Cyan - Cian fresco */
    --accent-color: #F59E0B;       /* Amber - Ámbar cálido */
    --success-color: #10B981;      /* Emerald - Esmeralda */
    --danger-color: #EF4444;       /* Red - Rojo moderno */
    --warning-color: #F59E0B;      /* Amber - Ámbar */
    --info-color: #3B82F6;         /* Blue - Azul información */

    /* Grises modernos */
    --light-bg: #F8FAFC;           /* Slate 50 */
    --card-bg: #FFFFFF;            /* Blanco puro */
    --border-color: #E2E8F0;       /* Slate 200 */
    --text-primary: #0F172A;       /* Slate 900 - Texto principal más contrastante */
    --text-secondary: #64748B;     /* Slate 500 - Texto secundario */
    --text-muted: #94A3B8;         /* Slate 400 - Texto deshabilitado */

    /* Sombras mejoradas */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

    /* Configuración general */
    --border-radius: 16px;         /* Bordes más redondeados */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 70px;
    
    /* Variables para navbar con nueva paleta */
    --navbar-bg: rgba(15, 23, 42, 0.95);     /* Slate 900 con transparencia */
    --navbar-bg-hover: rgba(15, 23, 42, 0.98);
    --navbar-accent: #F59E0B;                /* Accent color como acento */
    --navbar-border: rgba(255, 255, 255, 0.15);

    /* Gradientes de la nueva paleta */
    --gradient-primary: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    --gradient-secondary: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%);
    --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

body {
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 50%, #0284C7 100%);
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding-top: var(--header-height);
    color: var(--text-primary);
}

/* Navbar Superior Mejorada */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--navbar-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--navbar-border);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: var(--transition);
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(14, 165, 233, 0.1) 0%,
        rgba(6, 182, 212, 0.1) 100%);
    pointer-events: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: white !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.navbar-brand:hover {
    transform: translateY(-1px);
    color: var(--navbar-accent) !important;
    text-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.navbar-nav {
    position: relative;
    z-index: 1;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(14, 165, 233, 0.1) 0%,
        rgba(245, 158, 11, 0.1) 100%);
    opacity: 0;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    transform: scaleX(1);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    opacity: 1;
}

.navbar-nav .nav-link:hover {
    color: var(--navbar-accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.navbar-nav .nav-link.active {
    color: var(--navbar-accent) !important;
    background: rgba(14, 165, 233, 0.2);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

/* (Revertido) Se elimina mapeo global de la paleta a componentes Bootstrap */

/* Dropdown mejorado */
.dropdown-menu {
    background: var(--navbar-bg-hover);
    border: 1px solid var(--navbar-border);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    margin-top: 0.15rem; /* más pegado */
    transform: translateY(1px); /* opcional para sutil desplazamiento */
}


.dropdown-menu .dropdown-item {
    color: rgba(255,255,255,0.9);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 0.25rem;
    transition: var(--transition);
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(14, 165, 233, 0.2);
    color: var(--navbar-accent);
    transform: translateX(4px);
}

.dropdown-divider {
    border-color: var(--navbar-border);
}

/* Botón de usuario mejorado */
.btn-outline-light {
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 25px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.btn-outline-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn-outline-light:hover::before {
    left: 100%;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--navbar-accent);
    color: var(--navbar-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Navbar toggler personalizado */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.navbar-toggler:hover {
    background: rgba(255,255,255,0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Contenido principal */
.content {
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

.main-container {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin: 20px;
    padding: 0;
    overflow: visible; /* ✅ Deja que se expanda el dropdown */

}

/*.header-section {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}*/

.header-section {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: visible; /* ✅ Deja que se expanda el dropdown */
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}


.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" fill-opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" fill-opacity="0.1"/><circle cx="50" cy="10" r="1" fill="white" fill-opacity="0.1"/><circle cx="10" cy="50" r="1" fill="white" fill-opacity="0.1"/><circle cx="90" cy="30" r="1" fill="white" fill-opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-section h2 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.course-name {
    color: #fef5e7;
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.content-section {
    padding: 2rem;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 2rem;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Contenedores de contenido modernos */
.content-container {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Mensajes Flash Mejorados */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Botones modernos */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-modern {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--gradient-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: white;
}

.btn-warning {
    background: var(--gradient-accent);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706, #B45309);
    color: white;
}

/* Formularios modernos */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.form-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.form-body {
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h5::before {
    content: '▶';
    color: var(--primary-color);
    font-size: 0.8rem;
}

.form-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 1.5rem 0;
}

/* Tarjetas modernas */
/*.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}*/
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card-body:has(.dropdown) {
    overflow: visible !important;
}



.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.modern-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.asignatura-box {
    margin-bottom: 1.5rem;
}

.asignatura-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asignatura-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.delete-btn {
    background: var(--danger-color);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    text-decoration: none;
}

.delete-btn:hover {
    background: #e53e3e;
    transform: scale(1.1);
    color: white;
}

/* Tablas modernas */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table td {
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tr:hover {
    background: rgba(14, 165, 233, 0.05);
}

/* Paginación mejorada */
.pagination {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin: 1rem 0;
}

.pagination .page-item .page-link {
    color: var(--primary-color);
    font-weight: 500;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.pagination .page-item .page-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-secondary);
    background-color: var(--light-bg);
    border-color: var(--border-color);
}

/* Bootstrap Select personalizado */
.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) {
    width: 100%;
}

.bootstrap-select .dropdown-toggle {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    background: white;
    transition: var(--transition);
}

.bootstrap-select .dropdown-toggle:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Drop targets mejorados */
.drop-target {
    min-height: 80px;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 1rem;
    transition: var(--transition);
    background: #fafafa;
}

.drop-target:empty::before {
    content: '🎯 Arrastra aquí los temas';
    color: var(--text-secondary);
    font-style: italic;
    display: block;
    text-align: center;
    font-size: 0.9rem;
}

.drop-target.highlight {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    border-color: var(--success-color);
    border-style: solid;
    transform: scale(1.02);
}

.drop-target-temas {
    background: linear-gradient(135deg, #ebf8ff, #bee3f8);
    border: 2px dashed var(--info-color);
    border-radius: var(--border-radius);
    min-height: 320px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.temas-zone-label {
    background: var(--info-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

/* Elementos de tema mejorados */
.tema-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tema-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: var(--transition);
}

.tema-item:hover::before {
    transform: scaleY(1);
}

.tema-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-color: var(--primary-color);
}

.tema-item:active {
    cursor: grabbing;
    transform: rotate(5deg) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.tema-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.05);
}

.tema-numero {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.tema-titulo {
    color: var(--text-primary);
    font-weight: 500;
}

.tema-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Instrucciones mejoradas */
.instructions {
    background: linear-gradient(135deg, #fef5e7, #fed7aa);
    border: 1px solid #f6ad55;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #744210;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instructions::before {
    content: '💡';
    font-size: 1.2rem;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

/* Efectos de hover globales */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: var(--transition);
}

/* Iconos con efectos */
.bi {
    transition: var(--transition);
}

.nav-link:hover .bi {
    transform: scale(1.1);
}

body {
    overflow-x: hidden; /* evitar scroll horizontal, pero permitir elementos flotantes */
    position: relative;
}

html, body {
    height: 100%;
}


/* Responsive */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    
    .main-container {
        margin: 10px;
    }
    .dropdown-menu.show {
    z-index: 1059 !important;
}
}


/* 🛠 Fixes para dropdowns y modales cortados */
.card,
.card-body,
.content-container,
.main-container,
.header-section,
.content {
    overflow: visible !important;
}

/* Asegura visibilidad de dropdowns */
.dropdown-menu {
    z-index: 1059 !important;
}

/* Por si se encuentra dentro de .table-responsive o contenedores con overflow */
.table-responsive,
.container,
.row {
    overflow: visible !important;
}

.card-body {
    position: relative;
    overflow: visible !important;
}

.content-container {
    /* overflow: hidden; ← QUÍTALO o cámbialo a: */
    overflow: visible;
}


/* ===== MEJORAS MODERNAS PARA LA INTERFAZ ===== */

/* 1. SIDEBAR MEJORADO - Layout de dos columnas más dinámico */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

/* 2. CARDS CON GLASSMORPHISM Y MICRO-ANIMACIONES */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.8), 
        transparent);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* 3. SECCIÓN DE ASIGNATURAS MÁS VISUAL */
.subjects-section {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.subjects-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.subjects-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.subjects-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.subjects-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 4. FORMULARIO DE ASIGNATURA MEJORADO */
.form-modern {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-section-modern {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.section-header:hover {
    background: rgba(14, 165, 233, 0.05);
}

.section-toggle {
    width: 24px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    transition: all 0.3s ease;
}

.section-toggle.collapsed {
    transform: rotate(-90deg);
}

.section-title-modern {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 5. INPUTS MODERNOS CON EFECTOS */
.input-modern {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-modern input,
.input-modern select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    outline: none;
}

.input-modern input:focus,
.input-modern select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    transform: translateY(-2px);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.input-modern input:focus + .input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

/* 6. BOTONES CON EFECTOS MODERNOS */
.btn-modern-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 1rem 2rem;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}

.btn-modern-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-modern-primary:hover::before {
    left: 100%;
}

.btn-modern-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.4);
}

.btn-modern-primary:active {
    transform: translateY(-1px);
}

/* 7. SECCIÓN DE TEMAS CON DISEÑO MODERNO */
.themes-section {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.themes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.themes-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.themes-counter {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* 8. ZONA DE DROP MEJORADA */
.drop-zone-modern {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    opacity: 0.5;
}

.drop-zone-modern.drag-over {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border-color: var(--success-color);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(72, 187, 120, 0.2);
}

.drop-zone-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.drop-zone-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.drop-zone-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* 9. ITEMS DE TEMA MEJORADOS */
.theme-item-modern {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.theme-item-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.theme-item-modern:hover::before {
    transform: scaleY(1);
}

.theme-item-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.theme-item-modern:active {
    cursor: grabbing;
    transform: rotate(2deg) scale(1.05);
}

.theme-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 1rem;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.theme-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.theme-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* 10. ALERTAS MODERNAS */
.alert-modern {
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.alert-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.alert-modern.alert-warning {
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.1) 0%, 
        rgba(255, 183, 77, 0.1) 100%);
    color: #e67e22;
}

.alert-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.alert-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 11. MEJORAS RESPONSIVE */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .subjects-section,
    .themes-section {
        padding: 1.5rem;
    }
    
    .drop-zone-modern {
        padding: 2rem 1rem;
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .glass-card,
    .subjects-section,
    .themes-section {
        border-radius: 16px;
        padding: 1rem;
    }
    
    .drop-zone-modern {
        padding: 1.5rem 1rem;
        min-height: 200px;
    }
    
    .drop-zone-icon {
        font-size: 3rem;
    }
    
    .drop-zone-text {
        font-size: 1.1rem;
    }
}

/* 12. ANIMACIONES ADICIONALES */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out;
}

/* 13. EFECTOS DE CARGA */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 14. MEJORAS DE ACCESIBILIDAD */
.focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 15. TEMA OSCURO (BONUS) - DESACTIVADO POR PETICIÓN DE USUARIO
@media (prefers-color-scheme: dark) {
    .glass-card {
        background: rgba(26, 32, 44, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-modern,
    .themes-section {
        background: #2d3748;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .input-modern input,
    .input-modern select {
        background: #4a5568;
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .theme-item-modern {
        background: #2d3748;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .theme-text {
        color: #e2e8f0;
    }
}
*/

/* ===== FIX PARA RECUPERAR EL CONTRASTE DEL CONTENEDOR ===== */

/* 1. OPCIÓN SIMPLE - Solo cambiar el fondo del main-container */
.main-container {
    background: #ffffff; /* ✅ Blanco puro en lugar de gris claro */
    border-radius: var(--border-radius);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05); /* ✅ Sombra mejorada */
    margin: 20px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.05); /* ✅ Borde sutil */
}

/* 2. OPCIÓN PREMIUM - Efecto glassmorphism */
.main-container-glass {
    background: rgba(255, 255, 255, 0.95); /* ✅ Blanco semitransparente */
    backdrop-filter: blur(20px); /* ✅ Efecto cristal */
    border-radius: var(--border-radius);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset; /* ✅ Sombra premium */
    margin: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* Añadir textura sutil al fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 4. MEJORAR EL CONTRASTE DE LA SECCIÓN DE CONTENIDO */
.content-section {
    padding: 2rem;
    background: #ffffff; /* ✅ Asegurar fondo blanco */
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* 5. SEPARAR VISUALMENTE EL HEADER DEL CONTENIDO */
.header-section {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: visible;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    margin-bottom: 1px; /* ✅ Separación sutil */
}

/* 6. OPCIÓN CREATIVA - Contenedor con efecto de elevación */
.elevated-container {
    background: #ffffff;
    border-radius: 24px; /* ✅ Bordes más redondeados */
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05); /* ✅ Múltiples sombras */
    margin: 30px; /* ✅ Más espacio */
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* Añadir brillo sutil en la parte superior */
.elevated-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.8), 
        transparent);
    z-index: 1;
}

/* 7. MEJORA PARA DISPOSITIVOS MÓVILES */
@media (max-width: 768px) {
    .main-container,
    .main-container-glass,
    .elevated-container {
        margin: 10px;
        border-radius: 20px;
    }
    
    .content-section {
        padding: 1.5rem;
    }
}

/* 8. VARIANTE CON GRADIENTE SUTIL */
.gradient-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--border-radius);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.08);
    margin: 20px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* 9. OPCIÓN MINIMALISTA PERO EFECTIVA */
.clean-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin: 24px;
    padding: 0;
    border: 1px solid #e2e8f0;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.clean-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

/* 10. PARA USAR INMEDIATAMENTE - Reemplaza tu clase actual */
.main-container-fixed {
    background: #ffffff !important; /* ✅ Fuerza el blanco */
    border-radius: var(--border-radius);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.02); /* ✅ Sombra en capas */
    margin: 20px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

 .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.1));
            border: 1px solid rgba(14, 165, 233, 0.2);
            border-radius: 16px;
            padding: 1.5rem;
            text-align: center;
            transition: all 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
        }

        .stat-number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 0.5rem;
        }

        .stat-label {
            color: var(--text-secondary);
            font-size: 0.9rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-secondary);
        }

        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        .empty-state-text {
            font-size: 1.2rem;
            margin-bottom: 2rem;
        }

         .section-title-modern {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .section-title-modern::before {
            content: '';
            width: 6px;
            height: 2.5rem;
            background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
            border-radius: 3px;
        }
                    .section-title-modern {
                font-size: 1.5rem;
            }
 .table-container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
            border: 1px solid rgba(0, 0, 0, 0.05);
            overflow: hidden;
        }

        .table-modern {
            margin: 0;
            background: transparent;
        }

        .table-modern thead th {
            background: linear-gradient(135deg, #f8fafc, #e2e8f0);
            border-bottom: 2px solid var(--border-color);
            font-weight: 600;
            color: var(--text-primary);
            padding: 1.5rem 1rem;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .table-modern tbody td {
            padding: 1.5rem 1rem;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            vertical-align: middle;
            font-size: 0.95rem;
        }

        .table-modern tbody tr {
            transition: all 0.3s ease;
        }

        .table-modern tbody tr:hover {
            background: rgba(14, 165, 233, 0.05);
            transform: translateX(2px);
        }

/* Force navbar visibility on desktop to resolve conflicts */
@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}
