/* ==========================================================
   Calendario 2026 – HidroNet
   ========================================================== */

/* ---------- Calendar Container ---------- */
.calendario-section {
    padding: 40px 0 60px;
    background: #fff;
}

.calendario-header {
    background: linear-gradient(135deg, #0a1930 0%, #15295a 100%);
    color: #fff;
    text-align: center;
    padding: 36px 20px 28px;
    border-radius: 18px 18px 0 0;
    position: relative;
    overflow: hidden;
}

.calendario-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 20px;
    background: #fff;
    border-radius: 20px 20px 0 0;
}

.calendario-header h1 {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin: 0 0 4px;
    color: #fff;
    opacity: 0.95;
}

.calendario-header .year-display {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    letter-spacing: 2px;
}

.calendario-body {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 18px 18px;
    padding: 30px 24px 20px;
    box-shadow: 0 8px 32px rgba(10, 25, 48, 0.08);
}

/* ---------- Month Grid ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
}

.month-block {
    min-width: 0;
}

.month-name {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #0a1930;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #0a1930;
}

.month-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.month-table thead th {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    padding: 3px 0;
    color: #0a1930;
    letter-spacing: 0.5px;
}

.month-table thead th.weekend {
    color: #dc2626;
}

.month-table tbody td {
    text-align: center;
    padding: 0;
    vertical-align: middle;
    height: 30px;
}

/* ---------- Day Cell ---------- */
.day-cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #334155;
    border-radius: 50%;
    cursor: default;
    transition: all 0.2s ease;
}

.day-cell.empty {
    pointer-events: none;
}

/* Weekend text styling */
.day-cell.weekend {
    color: #dc2626;
}

/* ---------- Event Indicators (border style) ---------- */
.day-cell.has-event {
    cursor: pointer;
    font-weight: 700;
}

.day-cell.has-event:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Session Cap 1 – Red */
.day-cell.event-cap1 {
    border: 1.5px solid #dc2626;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

/* Session Cap 2 – Green */
.day-cell.event-cap2 {
    border: 1.5px solid #16a34a;
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

/* Session Cap 3 – Yellow */
.day-cell.event-cap3 {
    border: 1.5px solid #eab308;
    background: rgba(234, 179, 8, 0.1);
    color: #a16207;
}

/* Session All Chapters – Dark Blue */
.day-cell.event-todos {
    border: 1.5px solid #1e3a5f;
    background: rgba(30, 58, 95, 0.12);
    color: #1e3a5f;
}

/* Posada – Orange */
.day-cell.event-posada {
    border: 1.5px solid #ea580c;
    background: rgba(234, 88, 12, 0.1);
    color: #c2410c;
}

/* Hidden by toggle */
.day-cell.event-hidden {
    border-color: transparent !important;
    background: transparent !important;
    color: #334155 !important;
    font-weight: 500 !important;
    cursor: default !important;
    transform: none !important;
    box-shadow: none !important;
}

.day-cell.event-hidden.weekend {
    color: #dc2626 !important;
}

/* ---------- Legend / Toggle Controls ---------- */
.calendario-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.25s ease;
    user-select: none;
    border: 2px solid transparent;
}

.legend-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.legend-item.active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.legend-item.inactive {
    opacity: 0.4;
}

.legend-item input[type="checkbox"] {
    display: none;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.legend-item.active .legend-dot {
    transform: scale(1.15);
}

.legend-dot.dot-cap1 {
    background: #dc2626;
}

.legend-dot.dot-cap2 {
    background: #16a34a;
}

.legend-dot.dot-cap3 {
    background: #eab308;
}

.legend-dot.dot-todos {
    background: #1e3a5f;
}

.legend-dot.dot-posada {
    background: #ea580c;
}

.legend-label {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ---------- Event Modal ---------- */
.cal-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 48, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.cal-modal-overlay.show {
    display: flex;
}

.cal-modal {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(10, 25, 48, 0.25);
    animation: scaleIn 0.25s ease;
    overflow: hidden;
}

.cal-modal-header {
    padding: 20px 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cal-modal-header.header-cap1 {
    background: #dc2626;
}

.cal-modal-header.header-cap2 {
    background: #16a34a;
}

.cal-modal-header.header-cap3 {
    background: #b8930a;
}

.cal-modal-header.header-todos {
    background: #1e3a5f;
}

.cal-modal-header.header-posada {
    background: #ea580c;
}

.cal-modal-header h3 {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.cal-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.cal-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.cal-modal-body {
    padding: 20px 24px;
}

.cal-modal-date {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0a1930;
    margin-bottom: 4px;
}

.cal-modal-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
}

.cal-modal-footer {
    padding: 0 24px 20px;
}

.btn-add-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0a1930 0%, #15295a 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-add-calendar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(10, 25, 48, 0.3);
    color: #fff;
}

.btn-add-calendar svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ---------- HidroNet Logo area ---------- */
.calendario-footer-logo {
    text-align: center;
    margin-top: 30px;
}

.calendario-footer-logo img {
    max-width: 140px;
    height: auto;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1200px) {
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px 20px;
    }
}

@media (max-width: 991px) {
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 16px;
    }

    .calendario-header .year-display {
        font-size: 3.5rem;
    }

    .calendario-body {
        padding: 20px 16px 16px;
    }
}

@media (max-width: 576px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .calendario-header {
        padding: 24px 16px 20px;
    }

    .calendario-header h1 {
        font-size: 0.9rem;
        letter-spacing: 4px;
    }

    .calendario-header .year-display {
        font-size: 2.8rem;
    }

    .calendario-legend {
        gap: 8px 12px;
        padding: 14px;
    }

    .legend-item {
        padding: 5px 10px;
    }

    .legend-label {
        font-size: 0.7rem;
    }

    .month-table thead th {
        font-size: 0.55rem;
    }

    .day-cell {
        width: 24px;
        height: 24px;
        font-size: 0.68rem;
    }
}