/* 1. Fuente Montserrat Importada */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    --brand-red: #c0392b;
    --text-dark: #333333;
    --white: #FFFFFF;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
}

/* =========================================
   NAVBAR (HEADER)
   ========================================= */
.navbar {
    height: 90px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: relative;
    z-index: 100;
}

.logo-img {
    height: 50px;
    width: auto;
    max-width: 200px;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links-text {
    display: flex;
    gap: 25px;
}

.nav-links-text a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links-text a:hover {
    color: var(--brand-red);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-nav-red {
    background-color: var(--brand-red);
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
    box-shadow: 0 2px 5px rgba(192, 57, 43, 0.3);
}

.btn-nav-outline {
    background-color: transparent;
    color: var(--brand-red) !important;
    border: 2px solid var(--brand-red);
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-nav-outline:hover {
    background-color: var(--brand-red);
    color: white !important;
}


.btn-login-outline {
    padding: 10px 20px;
    border: 2px solid var(--brand-red);
    color: var(--brand-red) !important;
    background-color: transparent;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-login-outline:hover {
    background-color: var(--brand-red);
    color: white !important;
}

/* =========================================
   HERO BANNER (SIMPLE Y PERFECTO)
   ========================================= */
.hero-banner {
    background: url("../img/fondo_final.210316657523.jpg");
    background-size: cover;
    background-position: center left;
    height: 85vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
}

.hero-content {
    max-width: 780px;
    width: 100%;
    color: white;
    padding-top: 2rem;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    max-width: 700px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* BOTONES */
.hero-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.btn-start {
    background-color: white;
    color: var(--brand-red) !important;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    white-space: nowrap;
    transition: transform 0.2s;
}

.btn-start:hover {
    transform: translateY(-3px);
}

.btn-info, .btn-outline {
    background-color: rgba(160, 30, 20, 0.8);
    color: white !important;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255, 0.4);
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-info:hover, .btn-outline:hover {
    background-color: #801010;
    border-color: white;
}

/* =========================================
   PÁGINA DE CONTACTO
   ========================================= */
.contact-header {
    background: linear-gradient(rgba(0,0,0, 0.4), rgba(0,0,0, 0.4)),
                url("../img/universidad_vertical.36ca7539ac45.png");
    background-size: cover;
    background-position: center;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.header-subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
}

.contact-body {
    padding: 4rem 5%;
    background-color: white;
}

.contact-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.form-column {
    flex: 1.2;
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-submit {
    width: 100%;
    background-color: var(--brand-red);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: 0 2px 5px rgba(192, 57, 43, 0.3);
}

.btn-submit:hover {
    background-color: #a93226;
}

.info-column {
    flex: 0.8;
}

.info-box {
    background-color: #f0f6fa;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e1eaf0;
}

.info-item {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    color: #333;
    font-size: 0.95rem;
}

.info-item i {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-top: 2px;
}

.info-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.info-item a:hover {
    color: #2c71b6;
}

.map-wrapper {
    margin-top: 1rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
}

/* =========================================
   PÁGINA DE LOGIN
   ========================================= */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.login-side-image {
    flex: 1;
    background: url("../img/estudiantes_login.edfbda92b3ad.png");
    background-size: cover;
    background-position: center;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .login-side-image {
        display: block;
    }
}

.overlay-login {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    padding-left: 10%;
}

.quote-container h2 {
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.brand-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-side-form {
    flex: 1;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.form-container-centered {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    color: var(--brand-red);
    font-size: 2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.input-login {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-login-red {
    width: 100%;
    padding: 15px;
    background-color: var(--brand-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s;
}

.btn-login-red:hover {
    background-color: #a93226;
}

.login-footer-links {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}

.forgot-pass {
    display: block;
    margin-bottom: 1rem;
    color: #666;
    text-decoration: underline;
}

.signup-text a {
    color: var(--text-dark);
    font-weight: bold;
    text-decoration: none;
}

.signup-text a:hover {
    text-decoration: underline;
}

/* =========================================
   ESTILOS DEL DASHBOARD (INTRANET)
   ========================================= */

.dashboard-body {
    background-color: #f4f7f6;
    height: 100vh;
    overflow: hidden;
}

.dashboard-wrapper {
    display: flex;
    height: 100%;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: white;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 10;
}

.sidebar-logo {
    color: var(--brand-red);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    background-color: #f0f0f0;
    color: var(--brand-red);
    font-weight: 700;
}

.sidebar-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.avatar-circle {
    width: 35px;
    height: 35px;
    background-color: var(--brand-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.logout-link {
    color: #999;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.logout-link:hover {
    color: var(--brand-red);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.dashboard-header {
    margin-bottom: 2.5rem;
}

.welcome-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.welcome-text p {
    color: #666;
    font-size: 1rem;
}

/* =========================================
   WIDGETS DEL DASHBOARD
   ========================================= */

.widgets-container {
    max-width: 1000px;
}

/* --- GRID CENTRAL --- */
/* --- Bloque A: El Grid del Alumno --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 2rem;
    margin-bottom: 3rem;
}

.next-activity-widget {
    background: linear-gradient(135deg, var(--brand-red) 0%, #a93226 100%);
    border-radius: 15px;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 20px rgba(192, 57, 43, 0.2);
}
.next-activity-widget h3, .next-activity-widget p {
    color: white !important;
}

.card-white {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

/* --- CURSOS RECIENTES --- */
.section-title {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

/* --- ESTILOS DASHBOARD PROFESOR (KPI y Listas) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-info span { color: #666; font-size: 0.9rem; }
.kpi-info h3 { font-size: 2rem; margin: 5px 0 0 0; color: var(--text-dark); }

.kpi-icon {
    width: 50px; height: 50px;
    background-color: #f0f0f0; color: #666;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.kpi-icon.red { background-color: #fadbd8; color: var(--brand-red); }

.course-row {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1rem; padding: 1.2rem;
}
.course-icon-lg {
    width: 50px; height: 50px; background: #eee; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #555;
}
.course-details { flex: 1; }
.course-details h4 { margin: 0; font-size: 1rem; }
.course-details p { margin: 5px 0 0 0; font-size: 0.85rem; color: #777; }

.btn-red-outline {
    border: 1px solid var(--brand-red); background: white; color: var(--brand-red);
    padding: 8px 15px; border-radius: 5px; font-weight: 600; cursor: pointer;
}
.btn-red-outline:hover { background: var(--brand-red); color: white; }

.activity-list { list-style: none; padding: 0; }
.activity-list li { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.activity-list .time { font-size: 0.8rem; color: #999; font-weight: 600; }
.activity-list p { margin: 3px 0 0 0; font-size: 0.95rem; }

/* --- ESTILOS COMPARTIDOS (Botones, Tablas) --- */
.btn-red-sm {
    background: var(--brand-red); color: white;
    padding: 8px 20px; border-radius: 6px; text-decoration: none;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none;
}
.btn-red-sm:hover { background: #a93226; }

.btn-large-red {
    background-color: var(--brand-red);
    color: white;
    border: none;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.2);
    transition: transform 0.2s;
    display: flex; justify-content: center; align-items: center; gap: 10px;
}
.btn-large-red:hover { transform: translateY(-2px); background-color: #a93226; }

.btn-white {
    background: white; border: 1px solid #ddd; color: #555; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-white:hover { background: #f9f9f9; border-color: #ccc; }

/* Tabla Administrativa */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 15px 20px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
}

.admin-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 0.95rem;
}
.admin-table tr:hover { background-color: #fcfcfc; }

/* Status Badges */
.badge-active {
    background-color: #e8f8f5; color: #27ae60;
    padding: 5px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 700;
    border: 1px solid #d1f2eb;
}
.badge-inactive {
    background-color: #fdedec; color: #c0392b;
    padding: 5px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 700;
    border: 1px solid #fadbd8;
}

.btn-icon {
    background: white; border: 1px solid #ddd; border-radius: 5px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #555; transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--brand-red); color: var(--brand-red); }

.btn-page {
    border: 1px solid #eee; background: white; width: 30px; height: 30px; border-radius: 4px; cursor: pointer;
}
.btn-page.active { background: var(--brand-red); color: white; border-color: var(--brand-red); }

/* --- ESTILOS MODAL (Pop-up) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s;
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
}
.modal-header h3 { margin: 0; color: #333; font-size: 1.3rem; }
.close-btn { font-size: 1.5rem; cursor: pointer; color: #999; }
.close-btn:hover { color: #333; }

.input-modal {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px;
    font-family: 'Inter', sans-serif; font-size: 0.95rem; margin-top: 5px;
    box-sizing: border-box;
}

.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px; margin-top: 2rem;
}

.btn-cancel {
    background: #6c757d; color: white; border: none; padding: 10px 20px;
    border-radius: 6px; font-weight: 700; cursor: pointer;
}
.btn-confirm {
    background: var(--brand-red); color: white; border: none; padding: 10px 20px;
    border-radius: 6px; font-weight: 700; cursor: pointer;
}
.btn-confirm:hover { background: #a93226; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ESTILOS DE MIS CURSOS (PROFESOR) --- */
.prof-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.prof-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.prof-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.prof-card-icon {
    width: 60px; height: 60px;
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.prof-card-body { width: 100%; margin-bottom: 2rem; }

.prof-card-title {
    font-size: 1.25rem; font-weight: 700; color: #2c3e50;
    margin: 0 0 8px 0; line-height: 1.3;
}

.prof-card-subtitle {
    font-size: 0.85rem; color: #666; background: #f1f3f5;
    padding: 4px 10px; border-radius: 20px; font-weight: 600;
    display: inline-block;
}

.prof-card-id {
    margin-top: 10px; font-size: 0.8rem; color: #999; font-family: monospace;
}

.prof-card-footer { width: 100%; margin-top: auto; }

.btn-outline-red {
    width: 100%; padding: 12px;
    border: 2px solid var(--brand-red);
    color: var(--brand-red); background: transparent;
    border-radius: 8px; font-weight: 700; cursor: pointer;
    transition: all 0.2s; text-align: center; display: block;
}

.btn-outline-red:hover { background: var(--brand-red); color: white; }

/* --- ESTILOS MENÚ DESPLEGABLE (Dropdown Tuerca) --- */
.dropdown-menu {
    display: none;
    position: absolute; right: 0; top: 100%;
    background-color: white; min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    z-index: 10; border-radius: 8px; padding: 8px 0;
    margin-top: 5px; border: 1px solid #eee;
}

.dropdown-menu.show { display: block; animation: fadeIn 0.2s; }

.dropdown-menu a {
    color: #333; padding: 10px 16px; text-decoration: none;
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; transition: background 0.2s;
}

.dropdown-menu a:hover { background-color: #f8f9fa; }

.dropdown-menu a.text-danger { color: #c0392b; }
.dropdown-menu a.text-danger:hover { background-color: #fdedec; }

.dropdown-divider {
    height: 1px; margin: 6px 0; overflow: hidden; background-color: #e9ecef;
}

/* --- ESTILOS MODAL MATERIAL (Tarjetas de Selección) --- */
.material-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px; margin: 20px 0;
}

.material-option-card {
    background: white; border: 2px solid #eee; border-radius: 10px;
    padding: 1.5rem 0.5rem; text-align: center; cursor: pointer;
    transition: all 0.2s; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
}

.material-option-card:hover { border-color: #ccc; transform: translateY(-2px); }

.material-option-card.selected {
    border-color: var(--brand-red);
    background-color: #fff5f5;
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.15);
}

.material-icon { font-size: 2rem; color: var(--brand-red); }
.material-title { font-weight: 700; font-size: 0.9rem; color: #333; }

/* --- ESTILOS MODAL PDF (Drag & Drop) --- */
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background-color: #fafafa;
    color: #666;
    margin-top: 15px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.file-upload-area:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.file-upload-icon {
    font-size: 3rem;
    color: #999;
    margin-bottom: 10px;
}

/* Ocultamos el input real feo */
.file-input-hidden {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --- COLORES DE ICONOS DE MATERIAL --- */
.mat-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mat-pdf { background: #fff0f0; color: #c0392b; }
.mat-exercise { background: #e8f6f3; color: #16a085; }
.mat-quiz { background: #fff8e1; color: #f39c12; }

/* --- ESTILOS EDITOR DE EVALUACIONES (Split View) --- */

/* Contenedor principal del modal dividido */
.assessment-layout {
    display: flex;
    height: 600px; /* Altura fija para permitir scroll interno */
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Sidebar Izquierda (Lista de preguntas) */
.assessment-sidebar {
    width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.question-item-sidebar {
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s;
}

.question-item-sidebar:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.question-item-sidebar.active {
    border-left: 4px solid var(--brand-red);
    font-weight: 700;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-add-question {
    width: 100%;
    margin-top: 1rem;
    padding: 12px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-weight: 600;
    background: transparent;
    transition: all 0.2s;
}
.btn-add-question:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: #fff5f5;
}

/* Área de Edición Derecha */
.assessment-editor {
    flex: 1; /* Ocupa el resto */
    padding: 2rem;
    overflow-y: auto;
    background-color: white;
}

/* Grid de Alternativas (A, B, C, D) */
.alternatives-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.alt-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alt-input-group input[type="radio"] {
    transform: scale(1.2);
    cursor: pointer;
    accent-color: var(--brand-red);
}

/* --- ESTILOS EDITOR QUILL (TEXTO ENRIQUECIDO) --- */
.modal-content.assessment-modal-content {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    border: none;
}

.assessment-layout {
    display: flex;
    height: 100%;
    background-color: #f8f9fa;
}

/* --- Sidebar Izquierda --- */
.assessment-sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-header-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.question-item-sidebar {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.question-item-sidebar:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.question-item-sidebar.active {
    background-color: #fff0f0;
    color: var(--brand-red);
    border-color: #fecaca;
}

.btn-add-question {
    width: 100%;
    margin-top: 1rem;
    padding: 12px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-weight: 600;
    background: transparent;
    transition: all 0.2s;
}
.btn-add-question:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: #fff5f5;
}

/* --- Área de Edición Derecha --- */
.assessment-editor {
    flex: 1;
    padding: 2rem 2.5rem;
    background-color: #fff;
    overflow-y: auto;
}

.form-label-bold {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 8px;
}

.input-modern, .input-alt {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.2s;
    font-family: inherit;
}
.input-modern:focus, .input-alt:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}
.input-title-lg {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 14px 16px;
}

.question-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2.5rem 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}
.question-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}
.question-number-badge {
    color: var(--brand-red);
}

.editor-wrapper-pro {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}
.editor-wrapper-pro:focus-within {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}
.ql-toolbar.ql-snow {
    border: none !important;
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 15px !important;
}
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem;
}
.ql-editor {
    padding: 15px;
    min-height: 120px;
}

.alternatives-section {
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 0.5rem;
}
.alt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.alt-row:focus-within {
     border-color: var(--brand-red);
}
.radio-custom {
    transform: scale(1.3);
    accent-color: var(--brand-red);
    cursor: pointer;
}
.alt-letter {
    font-weight: 800;
    color: #64748b;
    min-width: 24px;
    text-align: center;
}
.input-alt {
    border: none;
    padding: 8px;
    background: transparent;
}
.input-alt:focus {
    box-shadow: none;
    border: none;
}

.modal-footer.pro-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2.5rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
    z-index: 10;
}

/* =========================================================
   AGREGADOS FINALES (LO QUE FALTABA)
   ========================================================= */

/* Botón Eliminar Pregunta (Ancho completo, texto visible) */
.btn-delete-question {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #fee2e2;
    color: #dc2626;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    height: auto; 
    width: auto;
}
.btn-delete-question:hover {
    background-color: #fef2f2;
    border-color: #dc2626;
}

/* Botón Cancelar Oscuro */
.btn-cancel-pro {
    background-color: #64748b;
    color: #ffffff !important;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-cancel-pro:hover {
    background-color: #475569;
    transform: translateY(-1px);
}

/* Notificación Flotante (Toast) */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-icon {
    width: 20px;
    height: 20px;
    background-color: #27ae60;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.toast-text {
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Estado del botón "Guardado" */
.btn-saved-state {
    background-color: #27ae60 !important;
    border-color: #27ae60 !important;
    color: white !important;
    pointer-events: none;
}

/* =========================================================
   🛡️ AJUSTES DE SEGURIDAD VISUAL (BÚNKER)
   ========================================================= */

/* Asegura que ninguna imagen subida por un usuario rompa el contenedor */
.q-text img, .feedback-content img, .tip-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 10px 0;
}

/* Evita que palabras exageradamente largas rompan las tablas o tarjetas */
.main-content, .card-white, .modal-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Mejora la visibilidad del foco para accesibilidad */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(192, 57, 43, 0.5);
    outline-offset: 2px;
}

/* Estilo para el scrollbar (Opcional, lo hace ver más Pro) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-red);
}

/* =========================================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ========================================================= */

/* --- Hamburger Menu Button (hidden by default, shown on mobile) --- */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}

/* --- Sidebar Overlay (for mobile sidebar toggle) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}
.sidebar-overlay.active {
    display: block;
}

/* --- Sidebar Toggle Button (inside dashboard pages) --- */
.sidebar-toggle {
    display: none;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-dark);
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== TABLET (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 3%;
    }
    .nav-links-text {
        gap: 15px;
    }
    .nav-links-text a {
        font-size: 0.85rem;
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
    .main-content {
        padding: 2rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .contact-grid {
        gap: 2rem;
    }
    .assessment-layout {
        flex-direction: column;
        height: auto;
    }
    .assessment-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 200px;
    }
    .assessment-editor {
        padding: 1.5rem;
    }
}

/* ===== TABLET PORTRAIT / SMALL TABLET (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* --- Navbar responsive --- */
    .navbar {
        height: 70px;
        padding: 0 4%;
    }
    .hamburger-btn {
        display: block;
    }
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        gap: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        z-index: 100;
        animation: fadeIn 0.3s;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-links-text {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .nav-links-text a {
        font-size: 1.05rem;
        padding: 8px 0;
    }
    .nav-buttons {
        flex-direction: column;
        width: 100%;
    }
    .nav-buttons a {
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    .logo-img {
        height: 40px;
    }

    /* --- Sidebar responsive --- */
    .sidebar {
        position: fixed;
        top: 0; left: -280px;
        height: 100vh;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 1.5rem 1rem;
    }
    .sidebar.active {
        left: 0;
    }
    .sidebar-toggle {
        display: flex;
        margin-bottom: 1rem;
    }
    .sidebar-logo {
        margin-bottom: 1.5rem;
    }

    /* --- Dashboard body --- */
    .dashboard-body {
        height: auto;
        overflow: auto;
    }
    .dashboard-wrapper {
        flex-direction: column;
        height: auto;
    }

    /* --- Main Content --- */
    .main-content {
        padding: 1.2rem;
        height: auto;
        overflow-x: hidden;
        overflow-y: visible;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* --- Hide public navbar on admin dashboard pages --- */
    .dashboard-wrapper ~ .navbar,
    .navbar:has(~ .dashboard-wrapper) {
        display: none;
        visibility: hidden;
    }

    /* --- Admin page headers responsive --- */
    .admin-page-header h1,
    .main-content > div > h1,
    .main-content > header > h1 {
        font-size: 1.3rem !important;
        line-height: 1.3;
    }

    /* --- Tables: horizontal scroll wrapper --- */
    .card-white:has(> table),
    .card-white:has(> .admin-table),
    .card-white:has(> .users-table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Hero Banner --- */
    .hero-banner {
        height: auto;
        min-height: 80vh;
        padding: 2rem 5%;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-buttons a {
        padding: 14px 20px;
        font-size: 0.95rem;
        text-align: center;
        white-space: normal;
    }

    /* --- Contact Page --- */
    .contact-header {
        height: 250px;
    }
    .header-title {
        font-size: 2rem;
    }
    .contact-grid {
        flex-direction: column;
        gap: 2rem;
    }
    .form-column, .info-column {
        flex: none;
        width: 100%;
    }

    /* --- Dashboard Grids --- */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .kpi-info h3 {
        font-size: 1.6rem;
    }
    .kpi-info span {
        font-size: 0.8rem;
    }
    .prof-course-grid {
        grid-template-columns: 1fr;
    }

    /* --- Tables responsive --- */
    .admin-table, .users-table, .ensayos-table {
        font-size: 0.82rem;
    }
    .admin-table th, .admin-table td,
    .users-table th, .users-table td {
        padding: 10px 8px;
        word-break: break-word;
    }

    /* --- Modals responsive --- */
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: 90vh;
        overflow-y: auto;
    }
    .material-options-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* --- Side Panel responsive --- */
    .side-panel {
        width: 100vw;
        right: -100vw;
    }
    .side-panel.active {
        right: 0;
    }

    /* --- Alternatives Grid --- */
    .alternatives-grid {
        grid-template-columns: 1fr;
    }

    /* --- Profile form --- */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .profile-card {
        padding: 20px !important;
    }
}

/* ===== MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
    .navbar {
        height: 60px;
    }
    .nav-menu {
        top: 60px;
    }
    .logo-img {
        height: 35px;
    }
    .hero-banner {
        height: auto;
        min-height: 70vh;
        padding: 1.5rem 4%;
    }
    .hero-content {
        padding-top: 1rem;
    }
    .hero-title {
        font-size: 1.7rem;
        line-height: 1.15;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .hero-buttons a {
        text-align: center;
        padding: 13px 18px;
        font-size: 0.9rem;
        white-space: normal;
        border-radius: 8px;
    }
    .contact-header {
        height: 200px;
        padding: 0 1rem;
    }
    .header-title {
        font-size: 1.6rem;
    }
    .header-subtitle {
        font-size: 0.95rem;
    }
    .contact-body {
        padding: 2rem 4%;
    }
    .main-content {
        padding: 1rem;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .card-white {
        padding: 1rem;
    }
    .welcome-text h1 {
        font-size: 1.5rem;
    }
    .section-title {
        font-size: 1rem;
    }
    .modal-content {
        padding: 1.5rem;
        border-radius: 8px;
    }
    .material-options-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-logo {
        font-size: 1.2rem;
    }
    .quote-container h2 {
        font-size: 1.5rem;
    }
    .brand-overlay {
        font-size: 0.9rem;
        bottom: 20px;
        left: 20px;
    }

    /* Fix table overflow on mobile */
    .card-white {
        overflow-x: auto;
    }

    /* Admin table columns: hide less important ones on very small screens */
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        display: none;
    }

    /* Better modal sizing on small phones */
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        padding: 1rem;
    }
    .modal-header h3 {
        font-size: 1rem;
    }

    /* Right drawer on mobile */
    .right-drawer-content {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }
}