/* =============================================================
   СУЧАСНИЙ ВІДЖЕТ КАЛЕНДАРЯ
============================================================= */

/* Батьківський контейнер */
.calendar-widget {
    max-width: 100%;
    overflow: hidden;
    font-family: var(--font-head, sans-serif);
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.06); 
    box-sizing: border-box;
}

/* Шапка (місяць + рік) */
.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.month-year-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.month-name {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

.year-number {
    font-size: 12px;
    font-weight: 700;
    color: #757575;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Кнопки навігації (стрілочки) */
.month-header .nav-link {
    background: #f4f7f5;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 18px;
    line-height: 1; 
    padding: 0 0 2px 0; 
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}
.month-header .nav-link:hover {
    background: var(--va-green, #66b384);
    color: #fff;
    transform: scale(1.05);
}

/* Таблиця календаря (на всю ширину) */
.calendar-table {
    width: 100%;
    margin: 0;
    table-layout: fixed; 
    border-collapse: collapse;
}

/* Заголовок днів тижня */
.week-days th {
    padding: 8px 0;
    text-transform: uppercase;
    font-weight: 700;
    color: #757575;
    font-size: 13px;
    text-align: center;
}

.sunday-week-day, .sunday-current-week-day, .current-week-day { 
    background: transparent !important; 
    border: none !important;
}
.current-week-day { color: var(--va-green, #66b384) !important; }

/* Клітинки календаря */
.calendar-table td {
    text-align: center;
    padding: 4px 0;
    vertical-align: middle;
    cursor: pointer;
}

/* Коло з датою (ОПТИМІЗОВАНО) */
.day-number {
    display: flex; 
    align-items: center;
    justify-content: center;
    width: 30px;  
    height: 30px;
    border-radius: 50%;
    background-color: transparent;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1; 
    padding: 0;
    margin: 0 auto;
    transition: transform 0.2s, background-color 0.2s;
    position: relative; 
    z-index: 1;
    box-sizing: border-box;
}

.calendar-table td:hover .day-number:not(.current-day-number) {
    background-color: #f4f7f5;
    color: var(--va-green, #66b384);
    transform: scale(1.15); 
}

/* Відмітка свята (Червона крапка) */
.holiday-day::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #ff5252; 
    border-radius: 50%;
    /* Міняємо анімацію лише на прозорість або фон, щоб не вантажити процесор */
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Поточний день (Сьогодні) */
.current-day-number,
.sunday-current-day {
    background-color: var(--va-green, #66b384) !important;
    color: #fff !important;
    font-weight: 800;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 179, 132, 0.4); 
    transform: scale(1.05);
}
.current-day-number.holiday-day::after { background-color: #fff; }

.selected-day .day-number:not(.current-day-number) {
    background-color: #fff;
    color: var(--va-green, #66b384);
    border: 2px solid var(--va-green, #66b384);
    box-sizing: border-box;
    transform: scale(1.1);
}

/* Блок списку свят при кліку */
#holiday-details {
    display: none;
    margin-top: 20px; 
    padding: 15px;
    background: #f9fbfb;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}
#holiday-details.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

#holiday-details.active .holiday-item { padding-left: 0; text-align: center; }
#holiday-details.active .holiday-item::before { display: none; }

.holiday-separator {
    border: none;
    height: 1px;
    background-color: rgba(0,0,0,0.06);
    margin: 8px 0;
}

.holiday-title a { color: var(--va-green, #66b384); text-decoration: none; font-weight: 700; }
.holiday-title a:hover { text-decoration: underline; }

/* =============================================================
   СЛАЙДЕР СВЯТ (СЬОГОДНІ) - НА ВСЮ ШИРИНУ
============================================================= */
.va-holiday-slider {
    position: relative;
    margin: 20px -20px -20px -20px; 
    border-radius: 0 0 20px 20px; 
    overflow: hidden;
}

.va-holiday-slides {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.va-holiday-slide {
    min-width: 100%;
    box-sizing: border-box;
}

/* Пагінація (Крапочки) */
.va-holiday-pagination {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.va-dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

.va-dot.active {
    background-color: #111; 
    border: 1.5px solid #fff; 
    transform: scale(1.3);
}

.holiday-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.holiday-image-container img.holiday-image {
    width: 100%;
    aspect-ratio: 3 / 2; 
    height: auto;
    object-fit: cover;
    display: block;
}

.today-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #ffffff;
    color: #111;
    border-radius: 20px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.holiday-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    padding: 60px 15px 35px 15px; 
    box-sizing: border-box;
    pointer-events: none;
}

.holiday-overlay .holiday-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: left;
    line-height: 1.3;
}
.holiday-overlay .holiday-title a { color: #fff; text-decoration: none; pointer-events: auto; }
.holiday-overlay .holiday-title a:hover { color: var(--va-green, #66b384); text-decoration: underline; }

/* =============================================================
   АДАПТАЦІЯ ДЛЯ 1280px (MacBook та інші ноутбуки)
============================================================= */
@media (max-width: 1280px) {
    .calendar-widget { padding: 15px; } /* Зменшуємо внутрішній відступ */
    
    .day-number { width: 28px; height: 28px; font-size: 13px; } /* Менші кружки */
    .week-days th { font-size: 11px; padding: 6px 0; }
    
    .month-header .nav-link { width: 28px; height: 28px; font-size: 16px; }
    .month-name { font-size: 14px; }
    .year-number { font-size: 11px; }

    /* Коригуємо розтягнення слайдера під нові падінги (15px) */
    .va-holiday-slider { margin: 15px -15px -15px -15px; }
    
    /* Зменшуємо шрифти в блоках свят */
    .holiday-overlay .holiday-title { font-size: 14px; }
    #holiday-details { font-size: 13px; padding: 12px; }
}

/* =============================================================
   АДАПТАЦІЯ ДЛЯ МОБІЛЬНИХ (до 360px)
============================================================= */
@media (max-width: 360px) {
    .calendar-widget { padding: 12px; }
    .va-holiday-slider { margin: 15px -12px -12px -12px; }
    .day-number { width: 26px; height: 26px; font-size: 12px; }
    .week-days th { font-size: 10px; }
}