/**
 * Estilos Frontend - Villa La Fuente Calendar
 * Versión pública para shortcodes
 */

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.vlf-calendar-public-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   LAYOUT HORIZONTAL (por defecto)
   ============================================ */
.vlf-calendar-public-container.layout-horizontal .vlf-calendar-public-months {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.vlf-calendar-public-container.layout-horizontal .vlf-calendar-public-month {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}

/* ============================================
   LAYOUT VERTICAL
   ============================================ */
.vlf-calendar-public-container.layout-vertical .vlf-calendar-public-months {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.vlf-calendar-public-container.layout-vertical .vlf-calendar-public-month {
    width: 100%;
    max-width: 500px;
}

/* ============================================
   TÍTULO DEL MES
   ============================================ */
.vlf-month-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
    text-transform: capitalize;
}

/* ============================================
   TABLA DEL CALENDARIO
   ============================================ */
.vlf-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.vlf-calendar-table thead th {
    background: #f0f0f1;
    color: #2c3338;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 5px;
    text-align: center;
    border: 1px solid #dcdcde;
}

.vlf-calendar-table tbody td {
    border: 1px solid #dcdcde;
    text-align: center;
    vertical-align: middle;
    height: 50px;
    position: relative;
    padding: 0;
}

/* Día vacío */
.vlf-calendar-table .empty-day {
    background: #f9f9f9;
}

/* ============================================
   NÚMERO DEL DÍA
   ============================================ */
.calendar-day .day-number {
    position: relative;
    z-index: 2;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
    /* Eliminamos el fondo blanco */
}

/* ============================================
   ESTADOS VISUALES - COLORES SÓLIDOS
   ============================================ */

/* Libre (Verde) */
.calendar-day.status-free {
    background: #d4edda;
}

/* Ocupado (Rojo) */
.calendar-day.status-occupied {
    background: #f8d7da;
}

/* ============================================
   ESTADOS VISUALES - DIAGONALES
   ============================================ */

/* Check-in: Verde arriba / Rojo abajo */
.calendar-day.status-check-in {
    background: linear-gradient(
        to bottom right,
        #d4edda 0%,
        #d4edda 49%,
        #f8d7da 51%,
        #f8d7da 100%
    );
}

/* Check-out: Rojo arriba / Verde abajo */
.calendar-day.status-check-out {
    background: linear-gradient(
        to bottom right,
        #f8d7da 0%,
        #f8d7da 49%,
        #d4edda 51%,
        #d4edda 100%
    );
}

/* Entrada y Salida mismo día: Rojo con línea diagonal verde */
.calendar-day.status-both {
    background: 
        linear-gradient(to bottom right, #f8d7da 0%, #f8d7da 44%, #d4edda 44%, #d4edda 56%, #f8d7da 56%, #f8d7da 100%);
}

/* ============================================
   LEYENDA DE COLORES
   ============================================ */
.vlf-calendar-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dcdcde;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    display: inline-block;
}

.legend-text {
    font-size: 14px;
    color: #2c3338;
    font-weight: 500;
}

/* Estados de la leyenda */
.legend-color.status-free {
    background: #d4edda;
}

.legend-color.status-occupied {
    background: #f8d7da;
}

.legend-color.status-check-in {
    background: linear-gradient(
        to bottom right,
        #d4edda 0%,
        #d4edda 49%,
        #f8d7da 51%,
        #f8d7da 100%
    );
}

.legend-color.status-check-out {
    background: linear-gradient(
        to bottom right,
        #f8d7da 0%,
        #f8d7da 49%,
        #d4edda 51%,
        #d4edda 100%
    );
}

.legend-color.status-both {
    background: 
        linear-gradient(to bottom right, #f8d7da 0%, #f8d7da 44%, #d4edda 44%, #d4edda 56%, #f8d7da 56%, #f8d7da 100%);
}

/* ============================================
   RESPONSIVE - TABLETS (max-width: 768px)
   ============================================ */
@media screen and (max-width: 768px) {
    .vlf-calendar-public-container {
        padding: 15px;
    }

    /* Layout horizontal pasa a vertical en tablets */
    .vlf-calendar-public-container.layout-horizontal .vlf-calendar-public-months {
        flex-direction: column;
        align-items: center;
    }

    .vlf-calendar-public-container.layout-horizontal .vlf-calendar-public-month {
        width: 100%;
        max-width: 450px;
    }

    .vlf-month-title {
        font-size: 18px;
    }

    .vlf-calendar-table thead th {
        font-size: 12px;
        padding: 8px 4px;
    }

    .vlf-calendar-table tbody td {
        height: 45px;
    }

    .calendar-day .day-number {
        font-size: 13px;
    }
}

/* ============================================
   RESPONSIVE - MÓVILES (max-width: 480px)
   ============================================ */
@media screen and (max-width: 480px) {
    .vlf-calendar-public-container {
        padding: 10px;
        margin: 10px;
    }

    .vlf-calendar-public-month {
        max-width: 100% !important;
    }

    .vlf-month-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* Ajustar tabla para móviles */
    .vlf-calendar-table thead th {
        font-size: 11px;
        padding: 6px 2px;
    }

    .vlf-calendar-table tbody td {
        height: 40px;
    }

    .calendar-day .day-number {
        font-size: 12px;
        padding: 2px 4px;
    }

    /* Leyenda en columna en móviles */
    .vlf-calendar-legend {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .legend-color {
        width: 25px;
        height: 25px;
    }

    .legend-text {
        font-size: 13px;
    }
}

/* ============================================
   RESPONSIVE - MÓVILES PEQUEÑOS (max-width: 360px)
   ============================================ */
@media screen and (max-width: 360px) {
    .vlf-calendar-table thead th {
        font-size: 10px;
        padding: 5px 1px;
    }

    .vlf-calendar-table tbody td {
        height: 35px;
    }

    .calendar-day .day-number {
        font-size: 11px;
        padding: 1px 3px;
    }

    .vlf-month-title {
        font-size: 15px;
    }
}