/* ================================================
   Calendario Header - Estilos
   ================================================ */

/* Mostrar/Ocultar versiones desktop y móvil */
.calendar-desktop-only {
    display: block !important;
}

.calendar-mobile-only {
    display: none !important;
}

@media (max-width: 1024px) {
    .calendar-desktop-only {
        display: none !important;
    }

    .calendar-mobile-only {
        display: block !important;
    }
}

/* Botón para abrir */
.calendar-header-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.calendar-header-btn:hover {
    background: #f5f5f5;
    color: #c19b76;
}

.calendar-header-btn i {
    color: #c19b76;
}

.calendar-desktop-only .calendar-header-btn i {
    color: #ffffff;
}

.calendar-desktop-only .calendar-header-btn {
    color: #ffffff;
}

.calendar-desktop-only .calendar-header-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.calendar-desktop-only .calendar-header-btn:hover i {
    color: #333;
}

/* Modal */
.calendar-header-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calendar-header-modal.active {
    display: flex !important;
}

#calendar-header-modal {
    display: none !important;
}

#calendar-header-modal.active {
    display: flex !important;
}

@media (max-width: 768px) {
    .calendar-header-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .calendar-header-widget {
        max-width: 320px;
        width: 90%;
        padding: 12px;
    }

    .calendar-header-grid {
        gap: 2px;
    }

    .dia {
        min-height: 30px;
        font-size: 11px;
    }

    .day-header {
        padding: 4px 0;
        font-size: 10px;
    }

    .calendar-header-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .calendar-header-notice {
        font-size: 10px;
        padding: 8px 10px;
    }

    .calendar-header-nav {
        margin-bottom: 8px;
    }

    .calendar-header-month-year {
        font-size: 11px;
    }

    .calendar-header-month-year span:first-child {
        font-size: 12px;
    }

    .calendar-nav-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

.calendar-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.calendar-header-widget {
    position: relative;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    z-index: 10000;
    max-height: 85vh;
    overflow-y: auto;
}

.calendar-header-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.calendar-header-close:hover {
    background: #f5f5f5;
    color: #333;
}

.calendar-header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-header-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 32px;
}

.calendar-header-title i {
    color: #c19b76;
}

/* Anuncio del calendario */
.calendar-header-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0f8ff;
    border-left: 4px solid #2196F3;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #1976D2;
}

.calendar-header-notice i {
    color: #2196F3;
    margin-top: 2px;
    flex-shrink: 0;
}

.calendar-header-notice p {
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}

.calendar-header-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Navegación */
.calendar-header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.calendar-header-month-year {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    flex: 1;
    white-space: nowrap;
}

.calendar-header-month-year span {
    display: block;
}

.calendar-header-month-year span:first-child {
    font-size: 14px;
    font-weight: 700;
}

.calendar-header-month-year span:last-child {
    font-size: 11px;
    color: #666;
}

.calendar-nav-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #c19b76;
    color: white;
    border-color: #c19b76;
}

/* Grid del calendario */
.calendar-header-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 12px;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
}

.days-container {
    display: contents;
}

.dia {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    min-height: 35px;
}

.dia.vacio {
    cursor: default;
    background: transparent;
}

.dia.hoy {
    border: 1px solid #c19b76;
    font-weight: 700;
}

.dia.no-disponible {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.dia.disponible {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
    cursor: pointer;
}

.dia.disponible:hover {
    background: #c8e6c9;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.dia.reservada {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.dia.preReserva {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

/* Leyenda */
.calendar-header-legend {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: 12px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    display: block;
}

.legend-color.disponible {
    background: #e8f5e9;
    border: 1px solid #81c784;
}

.legend-color.reservada {
    background: #ffebee;
    border: 1px solid #ef5350;
}

.legend-color.preReserva {
    background: #fff3e0;
    border: 1px solid #ffb74d;
}

.legend-text {
    flex: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    /* Mostrar calendario en móvil y tablet */
    .calendar-header-btn {
        display: flex !important;
        color: #c19b76 !important;
    }

    .calendar-header-btn span {
        color: #c19b76 !important;
    }

    .calendar-header-modal {
        display: none !important;
    }

    .calendar-header-modal.active {
        display: flex !important;
    }

    #calendar-header-btn {
        display: flex !important;
        color: #c19b76 !important;
    }

    #calendar-header-btn span {
        color: #c19b76 !important;
    }

    #calendar-header-modal {
        display: none !important;
    }

    #calendar-header-modal.active {
        display: flex !important;
    }
    .calendar-header-widget {
        max-width: 95%;
        width: 95%;
        padding: 16px 12px;
        max-height: 80vh;
    }

    .calendar-header-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }

    .calendar-header-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .calendar-header-notice {
        font-size: 11px;
        padding: 10px 12px;
        gap: 8px;
    }

    .calendar-header-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .calendar-header-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
    }

    .calendar-header-month-year {
        font-size: 13px;
        flex: 1;
    }

    .calendar-header-month-year span:first-child {
        font-size: 14px;
    }

    .calendar-header-month-year span:last-child {
        font-size: 11px;
    }

    .calendar-nav-btn {
        padding: 6px 10px;
        font-size: 14px;
        background: #f5f5f5;
    }

    .calendar-header-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        font-size: 12px;
    }

    .day-header {
        text-align: center;
        font-weight: 600;
        color: #666;
        padding: 6px 0;
        font-size: 11px;
        border-bottom: 1px solid #e0e0e0;
    }

    .dia {
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 500;
        padding: 4px;
        border-radius: 4px;
        border: 1px solid transparent;
    }

    .calendar-header-legend {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 10px;
        border-top: 1px solid #e0e0e0;
        margin-top: 10px;
    }

    .legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        color: #666;
    }

    .legend-color {
        width: 14px;
        height: 14px;
        border-radius: 2px;
    }
}
