/* ==========================================================================
   ESTILOS PREMIUM CALENDARIO INTERACTIVO (MITAD FONDO / MITAD SÓLIDO)
   ========================================================================== */
body {
    margin: 0;
    padding: 0;
    background-color: #1b203a; /* Color sólido base inferior */
    font-family: 'Montserrat', sans-serif;
}

.anual-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(rgba(24, 26, 38, 0.90), rgba(24, 26, 38, 0.90)), 
                url('https://unsplash.com') no-repeat center top;
    background-size: 100% 900px; /* Imagen arropada exclusivamente en la parte alta */
}

.anual-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 20px;
}

.anual-header {
    text-align: center;
    margin-bottom: 40px;
}

.anual-title {
    font-family: 'Playfair Display', serif;
    font-size: 52px;
    color: #ffffff;
    margin-bottom: 8px;
}

/* BOTONERA OVALADA SUPERIOR */
.control-panel-bar {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.toggle-group {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px;
    border-radius: 30px;
    display: inline-flex;
}

.control-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn.active {
    background-color: #f4eee1;
    color: #1a1d24;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* 🟥 REJILLA MAESTRA: 3 COLUMNAS X 4 FILAS */
.months-master-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.month-card-box {
    background-color: rgba(20, 23, 36, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 22px;
    backdrop-filter: blur(4px);
}

.month-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    text-align: center;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.month-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px 0;
    text-align: center;
}

.month-day-name {
    font-weight: 700;
    color: #a5acbc;
    font-size: 12px;
    text-transform: uppercase;
}

.month-day-number {
    font-weight: 500;
    color: #e2e8f0;
    height: 38px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    position: relative;
}

.month-day-number.empty { visibility: hidden; }

.month-day-number.today-highlight {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* DÍA CON LUNA NUEVA (INTERACTIVO) */
.month-day-number.has-luna {
    cursor: pointer;
    font-weight: 700;
    border: 1px dashed #00d2ff;
}

.month-day-number.has-luna:hover {
    background-color: rgba(0, 210, 255, 0.15);
}

.day-dots-container {
    width: 5px;
    height: 5px;
    background-color: #00d2ff; /* Puntito celeste debajo del número */
    border-radius: 50%;
    margin-top: 2px;
}

/* --- 4. VISOR INFERIOR COLOR SÓLIDO PLANO --- */
.aliyah-text-viewer-section {
    background-color: #1b203a; 
    padding: 50px 0 70px 0;
    text-align: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

#viewer-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    color: #ffffff;
    margin: 0 0 25px 0;
}

.viewer-body-box {
    background-color: #141724; /* Caja oscura interna */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 40px;
    max-width: 850px;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

#viewer-content-text {
    font-size: 16px;
    line-height: 1.8;
    color: #cbd5e1;
    text-align: justify;
}

/* --- RESPONSIVE EN CELULARES --- */
@media (max-width: 850px) {
    .anual-wrapper { background-size: 100% 1900px; }
    .months-master-grid { grid-template-columns: 1fr; gap: 20px; } /* 1 Columna en celular */
    .viewer-body-box { width: 90%; padding: 25px 20px; }
    .anual-title { font-size: 36px; }
}

/* --- CONFIGURACIÓN DE ICONOS DE LUNA DENTRO DEL DÍA --- */
.month-day-number {
    position: relative;
    height: 44px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.day-num-text {
    font-size: 14px;
    z-index: 2;
}

/* El icono de la luna se posiciona abajo a la derecha de forma sutil */
.day-moon-icon {
    font-size: 10px;
    position: absolute;
    bottom: 2px;
    right: 4px;
    z-index: 3;
}

.month-day-number.has-luna {
    background-color: rgba(0, 210, 255, 0.04);
    border: 1px solid rgba(0, 210, 255, 0.25) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-day-number.has-luna:hover {
    background-color: rgba(0, 210, 255, 0.15);
    transform: scale(1.06);
}

/* ==========================================================================
   VENTANA EMERGENTE MODAL FLOTANTE (ESTILO PREMIUM CANVA)
   ========================================================================== */
.modal-back-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(12, 14, 23, 0.85); /* Fondo oscuro translúcido que difumina la parte de atrás */
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Clase que activa la aparición del modal */
.modal-back-overlay.modal-active {
    opacity: 1;
    visibility: visible;
}

.modal-card-body {
    background-color: #141724; /* Tono oscuro idéntico a tus visores */
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(-30px);
    transition: transform 0.3s ease;
}

.modal-back-overlay.modal-active .modal-card-body {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover { color: #ffffff; }

.modal-icon-header {
    font-size: 45px;
    margin-bottom: 15px;
}

#modal-titulo-mes {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 5px;
}

.modal-date-sub {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #00d2ff; /* Color celeste relacional */
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

#modal-desc-texto {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #cbd5e1;
    text-align: justify;
    margin: 0;
}

/* --- ICONO DE CUMPLEAÑOS DENTRO DEL DÍA --- */
.month-day-number.has-cumple {
    background-color: rgba(255, 0, 127, 0.04);
    border: 1px solid rgba(255, 0, 127, 0.3) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.month-day-number.has-cumple:hover {
    background-color: rgba(255, 0, 127, 0.12);
    transform: scale(1.06);
}

/* Indicador de pastel/cumpleaños en la esquina */
.day-cake-icon {
    font-size: 10px;
    position: absolute;
    bottom: 2px;
    left: 4px;
    z-index: 3;
}

/* --- ELEMENTOS DE LA FOTO DENTRO DEL MENSAJE FLOTANTE (MODAL) --- */
.modal-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
    display: block;
    border: 3px solid #ff007f;
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.3);
}

/* Ajustes de color dinámico para subtítulos del modal */
.modal-date-sub.color-cumple { color: #ff007f !important; }
.modal-date-sub.color-luna { color: #00d2ff !important; }

/* ==========================================================================
   OPTIMIZACIÓN DE COMPRESIÓN MÓVIL (REEMPLAZAR AL FINAL DE estilos-calendario-anual.css)
   ========================================================================== */

/* --- CORRECCIÓN DE BORDES GENERAL --- */
.anual-container {
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
    padding: 0 12px; /* Pequeño colchón de aire para evitar desbordes */
    box-sizing: border-box !important;
}

.month-card-box {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px !important; /* Reducido sutilmente para dar más espacio a los días */
}

.month-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 8px 2px !important; /* Ajuste elástico compacto */
    width: 100% !important;
    box-sizing: border-box !important;
}

.month-day-number {
    width: 100% !important;
    height: 38px !important;
    box-sizing: border-box !important;
}

/* --- ADAPTABILIDAD RESPONSIVE POR ETAPAS EN MÓVILES --- */
@media (max-width: 990px) {
    .months-master-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 Columnas en Tablets */
        gap: 20px !important;
    }
    .anual-title { 
        font-size: 38px !important; 
    }
}

@media (max-width: 650px) {
    /* 🟩 BLOQUE CRÍTICO: Compresión total para pantallas de Celulares */
    .months-master-grid {
        grid-template-columns: 1fr !important; /* Una sola columna vertical fluida */
        gap: 25px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .anual-title {
        font-size: 30px !important; /* Título equilibrado */
    }

    .control-panel-bar {
        flex-direction: column !important; /* Apila las botoneras ovaladas */
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .toggle-group {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .control-btn {
        width: 50% !important; /* Los botones usan la mitad de su barra en celulares */
        text-align: center !important;
        padding: 10px 10px !important;
        font-size: 12px !important; /* Letra compacta para que no se desborde */
    }

    .month-day-name {
        font-size: 11px !important; /* Cabeceras Do, Lu, Ma más compactas */
    }

    .day-num-text {
        font-size: 12px !important; /* Números un poco más pequeños */
    }

    .day-moon-icon, .day-cake-icon {
        font-size: 11px !important; /* Iconos grandes pero proporcionales a la celda móvil */
        bottom: 1px !important;
    }

    /* Modal emergente centrado elástico */
    .modal-card-body {
        width: 95% !important;
        padding: 30px 15px !important;
    }
    
    .user-birthday-row {
        flex-direction: column !important; /* Apila la foto arriba del nombre en pantallas mini */
        text-align: center !important;
        gap: 10px !important;
    }
}

/* --- CONFIGURACIÓN DE CASILLEROS PARA FIESTAS HEBREAS --- */
.month-day-number.has-fiesta {
    background-color: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.month-day-number.has-fiesta:hover {
    background-color: rgba(139, 92, 246, 0.15);
    transform: scale(1.06);
}

/* Icono de la trompeta/shofár abajo en el medio */
.day-fiesta-icon {
    font-size: 14px;
    position: absolute;
    bottom: 1px;
    z-index: 3;
}

/* Color complementario para el subtítulo de la ventana flotante */
.modal-date-sub.color-fiesta { color: #8b5cf6 !important; }

/* --- INDICADOR FLOTANTE INTERMEDIO DE LA CUENTA DEL OMER --- */
.omer-bridge-badge {
    position: absolute;
    top: -10px; /* Desplazamiento exacto hacia la línea superior */
    right: -10px; /* Posicionamiento en el intermedio del día siguiente */
    background-color: #eab308; /* Tono dorado/fuego bíblico */
    color: #1a1d24;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 800;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.45);
    border: 1px solid #ffffff;
}

/* Evita que los bordes de los meses corten el círculo dorado flotante */
.month-card-box, .month-days-grid {
    overflow: visible !important; 
}

/* --- ICONOS INTERMEDIOS DE PÉSAJ Y JAMATZOT --- */
.pesaj-bridge-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #e2e8f0; /* Color gris claro/blanco */
    color: #1a1d24;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.2);
    border: 1px solid #475569;
}

.hamatzot-bridge-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #b45309; /* Tono tostado/pan */
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    z-index: 11;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.4);
    border: 1px solid #ffffff;
}

/* ==========================================================================
   ICONOS INTERMEDIOS VESPERTINOS Y COMPUESTOS (CUENTA DEL OMER / FIESTAS)
   ========================================================================== */

/* Viñeta general para eventos simples de fiestas en la tarde */
/* ==========================================================================
   BLINDAJE DE INTERACTIVIDAD VESPERTINA (REEMPLAZAR EN estilos-calendario-anual.css)
   ========================================================================== */
.fiesta-bridge-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #8b5cf6;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    width: 22px;  /* Sutilmente más grande para facilitar el toque táctil */
    height: 22px; /* Sutilmente más grande para facilitar el toque táctil */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 🟩 PUNTOS CRÍTICOS DE TRABAJO EN EL NAVEGADOR: */
    z-index: 999 !important;      /* Eleva el icono por encima de cualquier número solar */
    cursor: pointer !important;   /* Muestra la mano interactiva inmediatamente */
    pointer-events: auto !important; /* Fuerza al navegador a capturar el clic en esta capa */
    
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
    border: 1px solid #ffffff;
    transition: transform 0.15s ease-in-out;
}

.fiesta-bridge-badge:hover {
    transform: scale(1.2); /* Crece sutilmente al pasar el mouse para avisar que es cliqueable */
}


/* Variaciones de color para viñetas específicas */
.fiesta-bridge-badge.bg-pesaj { background-color: #e2e8f0; color: #1a1d24; border-color: #475569; }
.fiesta-bridge-badge.bg-hamatzot { background-color: #b45309; color: #ffffff; font-size: 9px; width: auto; padding: 0 6px; border-radius: 10px; }
.fiesta-bridge-badge.bg-omer { background-color: #eab308; color: #1a1d24; font-size: 9px; }

/* 🟩 ICONO COMPUESTO: Cuando coinciden 2 o más eventos la misma tarde */
.fiesta-bridge-badge.bg-composite {
    background: linear-gradient(135deg, #eab308, #8b5cf6); /* Destello dorado y morado */
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    animation: pulse-glow 2s infinite;
    border-color: #ffffff;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

/* --- INDICADOR FLOTANTE EXCLUSIVO PARA ROSH JODESH NISÁN --- */
.fiesta-bridge-badge.bg-nisan {
    background-color: #141724; /* Círculo oscuro profundo */
    color: #00d2ff; /* Luna nueva en color celeste brillante */
    border-color: #00d2ff; /* Borde celeste */
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 210, 255, 0.5);
}

/* ==========================================================================
   FORMATO ESFÉRICO REDONDO PARA LA SEMANA DE SUCOT (ESTILO OMER)
   ========================================================================== */
.fiesta-bridge-badge.bg-sucot-round {
    background-color: #06b6d4; /* Tono cian/agua exclusivo para las cabañas */
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 800;
    width: 22px;  /* Geometría circular perfecta idéntica al Omer */
    height: 22px; /* Geometría circular perfecta idéntica al Omer */
    border-radius: 50%;
    display: flex;
    flex-direction: column; /* Apila el icono arriba y el número abajo */
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 15;
    box-shadow: 0 2px 6px rgba(6, 182, 212, 0.45);
    border: 1px solid #ffffff;
}

/* Ajuste micro de tamaño para que el emoji de la tienda quepa dentro del círculo */
.sucot-mini-icon {
    font-size: 8px;
    margin-bottom: 1px;
}

.sucot-mini-num {
    font-size: 8px;
    font-weight: 800;
}

/* ==========================================================================
   CENTRADO DE ALIYOT DIARIAS (ESTILO SECCIÓN PARASHOT)
   ========================================================================== */

/* Contenedor secundario para centrar la Aliyá dentro del casillero */
.parasha-center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Esfera concéntrica para los días de la semana (Domingo a Viernes) */
.aliya-round-center {
    background-color: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(6, 182, 212, 0.4);
    transition: all 0.2s ease-in-out;
}

.month-day-number:hover .aliya-round-center {
    background-color: #06b6d4;
    color: #141724;
    transform: scale(1.1);
}

/* Esfera premium dorada exclusiva para el Sábado de Shabat */
.aliya-round-shabat {
    background-color: #f59e0b;
    color: #141724;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
