/* modulos_diac/static/css/calendar.css */
/* Estilos completos del Calendario Dinámico para Academia ULagos */


:root {
    --ulagos-dark-blue: #003da6;
    --ulagos-blue: #1a5bbf;
    --ulagos-green: #76bc21;
    --ulagos-dark-green: #5a9e1a;
    --ulagos-yellow: #ffd700;
    --ulagos-orange: #ff8c00;
    --ulagos-purple: #9b59b6;
    --ulagos-red: #e74c3c;
}


/* Contenedor principal del dropdown */
.calendar-dropdown {
    position: relative;
    margin-right: 15px;
}

/* Botón del calendario */
.calendar-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.calendar-btn i {
    font-size: 1.1rem;
}

/* Popup del calendario */
.calendar-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: fadeInDown 0.2s ease;
}

.calendar-popup.show {
    display: block;
}

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

/* Cabecera del calendario */
.calendar-header {
    background: linear-gradient(135deg, var(--ulagos-dark-blue) 0%, var(--ulagos-blue) 100%);
    color: white;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.calendar-month-year {
    font-weight: 600;
    font-size: 1rem;
}

/* Días de la semana */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.calendar-weekday {
    padding: 10px 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
}

/* Grid de días */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px;
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
}

.calendar-day:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

/* Día actual (hoy) */
.calendar-day.today {
    background: linear-gradient(135deg, var(--ulagos-blue), var(--ulagos-dark-blue));
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 61, 166, 0.3);
}

/* Día seleccionado */
.calendar-day.selected {
    background: linear-gradient(135deg, var(--ulagos-green), var(--ulagos-dark-green));
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(118, 188, 33, 0.3);
}

.calendar-day.selected::after {
    background: white !important;
}

/* Días con eventos */
.calendar-day.has-event {
    position: relative;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--ulagos-green);
    border-radius: 50%;
}

.calendar-day.today.has-event::after {
    background: white;
    box-shadow: 0 0 0 1px var(--ulagos-blue);
}

/* Días de otros meses */
.calendar-day.other-month {
    color: #adb5bd;
}

.calendar-day.other-month.has-event::after {
    background: #adb5bd;
}

/* Lista de eventos */
.events-list {
    max-height: 250px;
    overflow-y: auto;
    border-top: 1px solid #e9ecef;
    background: #fafbfc;
}

.event-item {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: white;
    transform: translateX(3px);
}

.event-item:last-child {
    border-bottom: none;
}

.event-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.event-date {
    font-size: 0.7rem;
    color: var(--ulagos-blue);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.event-date i {
    font-size: 0.65rem;
}

.event-badge {
    margin-top: 5px;
}

.no-events {
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #adb5bd;
}

.no-events i {
    margin-right: 5px;
    color: var(--ulagos-blue);
}

/* Badges de eventos */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
}

.badge-blue {
    background: var(--ulagos-blue);
    color: white;
}

.badge-green {
    background: var(--ulagos-green);
    color: white;
}

.badge-yellow {
    background: var(--ulagos-yellow);
    color: #333;
}

.badge-orange {
    background: var(--ulagos-orange);
    color: white;
}

.badge-purple {
    background: var(--ulagos-purple);
    color: white;
}

.badge-red {
    background: var(--ulagos-red);
    color: white;
}

/* Notificación toast */
.event-toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.event-toast-notification .toast-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    max-width: 300px;
    border-left: 4px solid var(--ulagos-blue);
}

.event-toast-notification .toast-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-toast-notification .toast-header i {
    color: var(--ulagos-blue);
    font-size: 1.2rem;
}

.event-toast-notification .toast-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.event-toast-notification .toast-date {
    font-size: 0.75rem;
    color: #6c757d;
}

.event-toast-notification .toast-desc {
    font-size: 0.75rem;
    margin-top: 5px;
    color: #6c757d;
}

.event-toast-notification .close-toast {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #adb5bd;
    transition: color 0.2s;
}

.event-toast-notification .close-toast:hover {
    color: #333;
}

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

/* Scrollbar personalizada para la lista de eventos */
.events-list::-webkit-scrollbar {
    width: 5px;
}

.events-list::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

.events-list::-webkit-scrollbar-thumb {
    background: var(--ulagos-blue);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-popup {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 95%;
        margin: 0 auto;
    }
    
    .calendar-btn span {
        display: none;
    }
    
    .calendar-btn {
        padding: 8px 12px;
    }
    
    .calendar-day {
        font-size: 0.7rem;
    }
    
    .event-item {
        padding: 10px;
    }
    
    .event-toast-notification .toast-content {
        max-width: 280px;
        padding: 12px 15px;
    }
}

/* Modo oscuro (opcional - se activa si el sistema lo tiene) */
@media (prefers-color-scheme: dark) {
    .calendar-popup {
        background: #2d2d2d;
    }
    
    .calendar-weekdays {
        background: #3d3d3d;
    }
    
    .calendar-weekday {
        color: #adb5bd;
    }
    
    .calendar-day:hover {
        background: #3d3d3d;
    }
    
    .calendar-day.other-month {
        color: #6c757d;
    }
    
    .events-list {
        background: #353535;
        border-top-color: #444;
    }
    
    .event-item {
        border-bottom-color: #444;
    }
    
    .event-item:hover {
        background: #3d3d3d;
    }
    
    .event-title {
        color: #e9ecef;
    }
    
    .no-events {
        color: #6c757d;
    }
}


/* ============================================ */
/* NUEVO POPUP PARA IMAGEN CON ZOOM */
/* ============================================ */

/* Popup de imagen - Versión que respeta la proporción de la imagen */
.calendar-popup-image {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    display: none;
    overflow: hidden;
}

.calendar-popup-image.show {
    display: block !important;
}

/* Overlay de fondo */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
}

.popup-overlay.show {
    display: block !important;
}

/* Cabecera del popup */
.popup-image-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    z-index: 10;
    pointer-events: none;
}

/* Botón cerrar */
.close-popup-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.close-popup-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Contenedor principal - centra el contenido y respeta proporciones */
.popup-image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper interno - mantiene la proporción de la imagen */
.image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

/* Imagen - mantiene su proporción original */
.popup-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    cursor: default;
    user-select: none;
    transition: none;
}

/* Cuando la imagen está en zoom, cambia el cursor */
.popup-image.zoomed {
    cursor: grab;
}

.popup-image.dragging {
    cursor: grabbing;
}

/* Controles de zoom */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.zoom-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.zoom-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Responsive - Móvil */
@media (max-width: 768px) {
    .calendar-popup-image {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .popup-image {
        max-width: 90vw;
        max-height: 80vh;
    }
    
    .zoom-btn,
    .close-popup-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .calendar-popup-image {
        max-width: 98vw;
        max-height: 90vh;
    }
    
    .popup-image {
        max-width: 95vw;
        max-height: 85vh;
    }
}

/* Feedback visual para scroll zoom */
.popup-image-container.zooming {
    cursor: zoom-in;
    transition: cursor 0.1s ease;
}

/* Mejora la experiencia de scroll */
.calendar-popup-image {
    overscroll-behavior: contain; /* Evita que el scroll se escape al body */
}

/* Indicador de que se puede hacer scroll */
.popup-image-container {
    cursor: default;
}

.popup-image.zoomed:hover {
    cursor: grab;
}

.popup-image.zoomed:active {
    cursor: grabbing;
}