/* =================================================================== */
/* ESTILOS GLOBALES Y DE LA PÁGINA DE EVENTOS (INDEX.HTML)             */
/* =================================================================== */

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    /* Fondo con un degradado sutil para mejorar el efecto visual */
    background-image: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, #0f172a 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Animación de aparición gradual para los elementos */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid de eventos */
#events-grid-container {
    display: grid;
    gap: 2.5rem;
    margin-bottom: 4rem;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) { #events-grid-container { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { #events-grid-container { grid-template-columns: repeat(4, 1fr); } }


/* Estilos para las tarjetas de eventos con efecto glassmorphism */
.event-card {
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    background: rgba(30, 41, 59, 0.6); /* Fondo semitransparente */
    backdrop-filter: blur(16px) saturate(180%); /* El efecto de desenfoque clave */
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.125); /* Borde sutil que simula el borde del cristal */
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); /* Sombra para dar profundidad */
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.event-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.25);
}


/* Texto con degradado para la cabecera principal */
.header-gradient-text {
    background: linear-gradient(to right, #60a5fa, #0ea5e9, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sección de autenticación con efecto glassmorphism */
.user-auth-section { position: absolute; top: 1.5rem; right: 1.5rem; z-index: 10; }
.auth-button {
    background-color: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.125);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s;
}
.auth-button:hover { background-color: rgba(71, 85, 105, 0.75); }
#user-profile { display: flex; align-items: center; gap: 1rem; }
#user-name { font-weight: 600; color: #e2e8f0; }


/* ============================================== */
/* ESTILOS PARA LA PÁGINA DEL CRONOGRAMA           */
/* ============================================== */
.cronograma-container {
    background: #0f172a;
}
.screen { display: none; min-height: 100vh; animation: fadeIn 0.5s ease-in-out; }
.screen.active { display: block; }

.main-header { text-align: center; margin-bottom: 50px; color: white; }
.main-header i { font-size: 4rem; margin-bottom: 20px; display: block; color: #38bdf8; text-shadow: 0 0 20px #38bdf8; }
.main-header h1 { font-size: 3rem; font-weight: 700; margin-bottom: 10px; }
.main-header p { font-size: 1.2rem; opacity: 0.8; font-weight: 300; }

.site-footer {
    background: transparent; color: white;
    text-align: center; padding: 1.5rem 1rem;
    width: 100%; margin-top: 40px; font-weight: 300; opacity: 0.6;
}

/* Cuadrícula para las tarjetas de cursos/grados con efecto glassmorphism */
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 40px; }
.course-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 24px;
    padding: 40px 30px; text-align: center; cursor: pointer;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: white;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.course-card:hover { transform: translateY(-10px); border-color: rgba(56, 189, 248, 0.5); }
.course-card h3 { color: #f0f9ff; font-size: 1.5rem; font-weight: 600; }
.course-card p { color: #94a3b8; }
.course-icon {
    width: 70px; height: 70px; margin: 0 auto 20px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.course-icon i { font-size: 2rem; color: white; }

/* Cabecera del cronograma con efecto glassmorphism */
.schedule-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding: 1.25rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}
.schedule-header h1 { color: #f0f9ff; font-size: 1.75rem; font-weight: 600; }
.header-left { display: flex; align-items: center; gap: 20px; }

/* Botones de navegación y acción */
.back-btn, .academic-btn, .event-btn {
    color: white; border: none; padding: 0.75rem 1.25rem; border-radius: 999px;
    cursor: pointer; font-weight: 500; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.back-btn:hover, .academic-btn:hover, .event-btn:hover {
    transform: scale(1.05); /* Efecto de crecimiento al pasar el mouse */
}
.back-btn { background: #ef4444; }
.back-btn:hover { background: #dc2626; }
.academic-btn { background: #22c55e; }
.academic-btn:hover { background: #16a34a; }
.academic-btn.active { background: #facc15; color: #422006; }
.event-btn { background: #6366f1; }
.event-btn:hover { background: #4f46e5; }

/* PANEL ACADÉMICO con efecto glassmorphism */
.academic-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: 20px;
    padding: 1.5rem; margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.5s ease;
}
.academic-panel.hidden { display: none; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(56, 189, 248, 0.2); }
.panel-header h3 { margin: 0; font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; color: #facc15; }
.panel-header .exit-btn {
    background: transparent; border: none; width: 30px; height: 30px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #facc15; opacity: 0.7; font-size: 1.2rem;
    transition: opacity 0.3s ease;
}
.panel-header .exit-btn:hover { opacity: 1; }

/* Formulario para añadir tareas */
.add-task-form h4 { margin: 0 0 1rem 0; font-weight: 600; color: #e2e8f0; }
.add-task-form .form-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.add-task-form .form-group input, .add-task-form .form-group select {
    flex-grow: 1; background-color: rgba(15, 23, 42, 0.8); color: #cbd5e1;
    border: 1px solid #334155; border-radius: 0.5rem;
    padding: 0.6rem 0.8rem; font-size: 1rem; min-width: 150px;
}
.add-task-form .form-group input:focus, .add-task-form .form-group select:focus { outline: none; border-color: #38bdf8; }
.add-task-form .form-group button {
    background: #facc15; color: #422006; border: none; border-radius: 0.5rem;
    padding: 0.6rem 1.2rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem;
    transition: background-color 0.3s ease;
}
.add-task-form .form-group button:hover { background: #f59e0b; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* Cuadrícula del cronograma semanal con efecto glassmorphism */
.schedule-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-top: 20px; }
.day-column {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    padding: 1.5rem; min-height: 400px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}
.day-header { text-align: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(56, 189, 248, 0.2); }
.day-header i { font-size: 1.5rem; color: #38bdf8; margin-bottom: 10px; display: block; }
.day-header h3 { font-size: 1.2rem; font-weight: 600; color: #e2e8f0; }
.tasks-container { display: flex; flex-direction: column; gap: 12px; }

/* Estilos para las tareas individuales */
.task-item {
    background: rgba(15, 23, 42, 0.8); color: #cbd5e1;
    border: 1px solid #334155; border-radius: 10px; padding: 15px;
    position: relative; animation: taskAppear 0.5s ease;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.task-item.completed { background: rgba(5, 150, 105, 0.4); border-color: rgba(16, 185, 129, 0.6); }
.task-text.completed { text-decoration: line-through; color: #9ca3af; }
@keyframes taskAppear { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.task-content { display: flex; align-items: center; gap: 12px; }
.task-checkbox {
    width: 22px; height: 22px; border: 2px solid #475569; border-radius: 5px;
    cursor: pointer; position: relative; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.task-checkbox.checked { background: #10b981; border-color: #10b981; color: white; }
.delete-btn {
    position: absolute;
    top: 5px; right: 5px; background: #ef4444; color: white;
    border: none; border-radius: 50%; width: 24px; height: 24px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 14px; opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}
.task-item:hover .delete-btn { opacity: 1; }
.delete-btn:hover { background: #dc2626; }

/* MODAL DE CONTRASEÑA con efecto glassmorphism */
.modal {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000; animation: modalFadeIn 0.3s ease;
}
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-content {
    background: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 1rem; width: 90%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.125);
    overflow: hidden;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header {
    background: linear-gradient(to right, rgba(14, 165, 233, 0.5), rgba(2, 132, 199, 0.5));
    padding: 1rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { color: #fff; font-size: 1.25rem; font-weight: 600; margin: 0; }
.modal-header .close-btn { background: transparent; border: none; color: rgba(255, 255, 255, 0.7); font-size: 1.5rem; cursor: pointer; transition: color 0.2s ease; line-height: 1; }
.modal-header .close-btn:hover { color: #fff; }
.modal-body { padding: 1.5rem; }
.modal-body p { color: #cbd5e1; margin: 0 0 1rem 0; }
.modal-body input[type="password"] {
    width: 100%; background-color: rgba(15, 23, 42, 0.8); color: #cbd5e1;
    border: 1px solid #334155; border-radius: 0.75rem;
    padding: 0.75rem 1rem; font-size: 1rem; margin-bottom: 1.5rem;
    box-sizing: border-box;
}
.modal-body input[type="password"]:focus { outline: none; border-color: #38bdf8; }
.modal-buttons { display: flex; gap: 1rem; justify-content: flex-end; }
.modal-buttons button { border: none; padding: 0.6rem 1.2rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer; font-size: 0.9rem; transition: background-color 0.3s ease; }
.modal-buttons .confirm-btn { background: #0ea5e9; color: white; }
.modal-buttons .confirm-btn:hover { background: #0284c7; }
.modal-buttons .cancel-btn { background: #334155; color: white; }
.modal-buttons .cancel-btn:hover { background: #475569; }

/* TOAST NOTIFICATIONS con efecto glassmorphism */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 3000; }
.toast {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px; padding: 15px 20px;
    margin-bottom: 10px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #22c55e;
    animation: toastSlideIn 0.5s ease-out forwards;
    display: flex; align-items: center; gap: 10px;
    min-width: 300px; color: #1e293b;
    transition: opacity 0.3s ease;
}
@keyframes toastSlideIn { from { transform: translateX(110%); } to { transform: translateX(0); } }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

/* =================================================================== */
/* ESTILOS PARA LA VENTANA MODAL Y FORMULARIO DE EVENTOS (MEJORADO)    */
/* =================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none; /* Inicia oculto */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInModal 0.4s ease forwards;
}

#create-event-modal.modal-overlay {
    display: flex; /* Se mostrará cuando sea necesario */
}


.modal-content {
    width: 90%;
    max-width: 550px;
    position: relative;
    transform: scale(0.95) translateY(10px);
    animation: zoomInModal 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.event-creator-form {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

.form-title {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    padding: 2rem 2rem 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.event-creator-form input[type="text"],
.event-creator-form input[type="url"],
.event-creator-form input[type="datetime-local"],
.event-creator-form input[type="file"],
.event-creator-form textarea,
.event-creator-form select {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    color: #cbd5e1;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.event-creator-form input:focus,
.event-creator-form textarea:focus,
.event-creator-form select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.form-actions .academic-btn {
    width: 100%;
    background: linear-gradient(to right, #22c55e, #16a34a);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-actions .academic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.25);
}

.form-actions .cancel-btn {
    width: 100%;
    background: #334155;
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-actions .cancel-btn:hover {
    background: #475569;
}

.form-error-message {
    color: #f87171;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    text-align: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}


/* RESPONSIVIDAD */
@media (max-width: 1024px) {
    .schedule-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 768px) {
    .header-gradient-text { font-size: 3rem; }
    .container { padding: 4rem 1rem 1rem 1rem; }
    .schedule-header { flex-direction: column; gap: 1rem; }
    .schedule-header h1 { font-size: 1.5rem; text-align: center; }
}
@media (max-width: 640px) {
    .header-gradient-text { font-size: 2.5rem; line-height: 1.2; }
    .container { padding-top: 5rem; }
    .user-auth-section { top: 0.75rem; right: 0.75rem; }
    .auth-button { padding: 0.5rem 0.8rem; font-size: 0.875rem; }
    #user-name { display: none; }
    .form-actions { flex-direction: column-reverse; }
}

/* ESTILOS PERSONALIZADOS PARA EVENTOS DE FULLCALENDAR */
.fc-daygrid-event {
    background: transparent !important;
    border: none !important;
    padding: 2px 0;
}
.fc-daygrid-event .fc-event-dot { display: none; }
.fc-event-main-card {
    display: flex; align-items: center; padding: 5px;
    width: 100%; overflow: hidden; font-family: 'Inter', sans-serif;
    border-radius: 6px;
    background-color: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}
.fc-event-main-card:hover {
    background-color: #334155;
    transform: scale(1.03);
}
.fc-event-icon {
    flex-shrink: 0; width: 28px; height: 28px; margin-right: 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: white; font-size: 0.9rem;
}
.fc-event-category-academica .fc-event-icon { background-color: #3b82f6; }
.fc-event-category-cultural .fc-event-icon { background-color: #a855f7; }
.fc-event-category-deportiva .fc-event-icon { background-color: #22c55e; }
.fc-event-details { overflow: hidden; white-space: nowrap; }
.fc-event-time { font-weight: 600; font-size: 0.75rem; color: #e2e8f0; }
.fc-event-title {
    color: #94a3b8; font-size: 0.8rem; font-weight: 500;
    text-overflow: ellipsis; overflow: hidden;
}

/* =================================================================== */
/* ESTILOS PARA EL BOTÓN DE SUBIDA DE ARCHIVO PERSONALIZADO            */
/* =================================================================== */

/* Estilos para nuestro nuevo botón (que ahora es la etiqueta <label>) */
.file-upload-label {
    display: block;
    text-align: center;
    padding: 1rem;
    background-color: rgba(15, 23, 42, 0.8);
    color: #94a3b8; /* Un color de texto más sutil */
    border: 2px dashed #334155; /* Borde punteado para indicar que es una zona de carga */
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.file-upload-label:hover {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: #38bdf8;
    color: #e2e8f0;
}

/* Con esta clase ocultamos el input de archivo por defecto (el del ícono gigante) */
.file-upload-hidden {
    display: none;
}

/* =================================================================== */
/* AJUSTE PARA EL BOTÓN DE SUBIR ARCHIVO                               */
/* =================================================================== */

/* Este código arregla el input de tipo "file" para que no sea gigante */
.event-creator-form input[type="file"] {
    background: none; /* Le quitamos el fondo oscuro */
    border: none;     /* Le quitamos el borde */
    padding: 0;       /* ¡Esta es la clave! Eliminamos el padding que lo hacía enorme */
    color: #94a3b8;   /* Ajustamos el color del texto */
    height: auto;     /* Permitimos que tome su altura natural */
}

/* Con esto, le damos un estilo más bonito al botón "Seleccionar archivo" */
.event-creator-form input[type="file"]::file-selector-button {
    background-color: #334155;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-right: 1rem;
    transition: background-color 0.2s;
}

.event-creator-form input[type="file"]::file-selector-button:hover {
    background-color: #475569;
}

/* =================================================================== */
/* SOLUCIÓN DEFINITIVA PARA EL BOTÓN DE SUBIR ARCHIVO                  */
/* =================================================================== */

/* Esta regla FUERZA al input original (el del ícono) a desaparecer */
.file-upload-hidden {
    display: none !important;
}

/* Estilo simple y claro para la etiqueta que funcionará como el nuevo botón */
.file-upload-label {
    display: block;
    text-align: center;
    padding: 0.8rem 1rem;
    background-color: #334155;
    color: white;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-upload-label:hover {
    background-color: #4f46e5;
}