/* Contenedor del Calendario */
.bbv-calendar-container {
    max-width: var(--bbv-cal-max-width, 800px);
    margin: 20px auto;
    font-family: var(--bbv-font-family, sans-serif);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Cabecera del Calendario */
.bbv-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bbv-primary-color, #007bff);
    color: #fff;
    padding: 15px 20px;
}

.bbv-calendar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    flex: 1 1 auto;
    text-align: center;
    line-height: 1.2;
}

.bbv-cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.3s;
}

.bbv-cal-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.bbv-cal-nav-arrow {
    font-size: 1.05rem;
    line-height: 1;
}

/* Cuadrícula */
.bbv-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #eee;
    gap: 1px;
    border: 1px solid #eee;
}

.bbv-cal-day-name {
    background-color: #f8f9fa;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
}

.bbv-cal-day {
    background-color: #fff;
    min-height: var(--bbv-cal-min-height, 100px);
    aspect-ratio: var(--bbv-cal-aspect-ratio, auto);
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Previene que la cuadrícula se estire con contenido largo */
}

.bbv-cal-day.empty {
    background-color: #f9f9f9;
}

.bbv-cal-day.today {
    background-color: #eef5ff;
}

.bbv-cal-day.today .bbv-cal-day-num {
    background-color: var(--bbv-primary-color, #007bff);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bbv-cal-day-num {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    align-self: flex-end;
}

/* Eventos en el calendario */
.bbv-cal-event {
    background-color: var(--bbv-primary-color, #007bff);
    color: #fff;
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    margin: 2px auto;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, opacity 0.3s;
}

.bbv-cal-event:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Modal del Calendario */
.bbv-calendar-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.bbv-calendar-modal-content {
    background-color: var(--bbv-bg-color, #ffffff);
    color: var(--bbv-text-color, #333333);
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: bbvFadeIn 0.3s ease;
}

.bbv-calendar-modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.bbv-calendar-modal-close:hover,
.bbv-calendar-modal-close:focus {
    color: #333;
    text-decoration: none;
}

/* Contenido de WordPress dentro del Modal */
.bbv-modal-wp-content {
    margin-top: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.bbv-modal-wp-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

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

@media (max-width: 768px) {
    .bbv-cal-day {
        min-height: var(--bbv-cal-min-height, 80px);
    }
    .bbv-cal-day-name {
        font-size: 0.75rem;
        padding: 5px;
    }
    .bbv-calendar-modal-content {
        margin: 10% auto;
        padding: 20px;
    }
}

/* En móvil mostramos solo las flechas para mantener el mes centrado y sin desfase */
@media (max-width: 600px) {
    .bbv-calendar-header {
        padding: 12px 10px;
        gap: 8px;
    }
    .bbv-cal-nav-text {
        display: none;
    }
    .bbv-cal-nav {
        min-width: 42px;
        padding: 8px 0;
        font-size: 1.1rem;
        gap: 0;
    }
    .bbv-cal-nav-arrow {
        font-size: 1.25rem;
    }
    .bbv-calendar-header h3 {
        font-size: 1.05rem;
    }
}
