:root {
    --primary-color: #d32f2f;
    --secondary-color: #ffc107;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --header-text: #ffffff;
    --pill-bg: rgba(255, 255, 255, 0.15);
    --modal-bg: #ffffff;
    --divider-color: #eee;
    --input-border: #f0f0f0;
    --input-bg: #fcfcfc;
    --surface-color: #ffffff;
    --quote-title-color: #666;
    --quote-body-color: #444;
}

[data-theme="dark"] {
    --primary-color: #f44336;
    --secondary-color: #ffca28;
    --text-color: #e0e0e0;
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.95);
    --header-text: #ffffff;
    --pill-bg: rgba(255, 255, 255, 0.1);
    --modal-bg: #1e1e1e;
    --divider-color: #333;
    --input-border: #444;
    --input-bg: #2a2a2a;
    --surface-color: #242424;
    --quote-title-color: #bbb;
    --quote-body-color: #eee;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    text-align: center;

    /* Smooth Load optimization */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.ready .app-container {
    opacity: 1;
    transform: translateY(0);
}

header {
    background: var(--primary-color);
    color: white;
    padding: 30px 24px;
    /* Tăng padding để thoáng hơn */
    margin: -24px -24px 24px -24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    /* Tạo khoảng cách giữa các khối chính */
}

.header-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    /* Khoảng cách giữa tiêu đề và ngày */
}

header h1 {
    font-family: 'Playfair Display', serif;
    color: white;
    margin: 0;
    text-transform: uppercase;
    font-size: 1.6rem;
    letter-spacing: 2px;
}

.date-display {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.header-actions-fixed {
    margin-top: 5px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.nav-pill-group {
    display: inline-flex;
    background: var(--pill-bg);
    padding: 5px;
    border-radius: 50px;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.btn-pill {
    background: transparent;
    border: none;
    color: var(--header-text);
    padding: 0 22px;
    height: 44px;
    /* Standard touch target */
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;  /* Khoảng cách icon ↔ chữ */
    transition: all 0.2s;
}



#lang-toggle {
    min-width: 50px;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px 0 0 50px;
    padding: 10px 15px;
    font-weight: 800;
}

#btn-today {
    border-radius: 0;
}

.btn-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-pill svg {
    stroke: white;
    stroke-width: 2.5;
    opacity: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.day-cell.is-holiday .solar-num,
.day-cell.is-holiday .lunar-num {
    color: #d32f2f;
}

.zodiac-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.zodiac-dot.good {
    background: #d32f2f;
    box-shadow: 0 0 5px rgba(211, 47, 47, 0.3);
}

.zodiac-dot.bad {
    background: #000;
}

/* Discovery Modal Compact Layout */
.discovery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 5px;
}

@media (min-width: 600px) {
    .discovery-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.info-card-compact {
    padding: 12px;
    border-radius: 12px;
    border-left: 4px solid var(--border-color, #ddd);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card-compact h3 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card-compact p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    color: #555;
}

.calendar-bloc {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 20px;
    margin: 0 16px 24px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

/* Month View Styles */
#month-view-modal .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 95vh;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    border: none;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Thanh "Quay về" — bar riêng phía trên red header, không đè lên nút < > */
.modal-back-bar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid #f1f1f1;
    flex-shrink: 0;
}

#close-month-view.modal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 10px;
    background: #fff5f5;
    color: var(--primary-color);
    border: 1px solid #fbd5d5;
    border-radius: 22px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

#close-month-view.modal-back-btn:hover {
    background: #ffe5e5;
}

#close-month-view.modal-back-btn:active {
    background: #ffd5d5;
    transform: scale(0.97);
}

#close-month-view.modal-back-btn svg {
    flex-shrink: 0;
    stroke: var(--primary-color);
}

@media (max-width: 480px) {
    .modal-back-bar {
        padding: 8px 12px;
    }
    #close-month-view.modal-back-btn {
        padding: 6px 12px 6px 8px;
        font-size: 0.85rem;
    }
}

.month-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Bỏ border-radius vì giờ .modal-back-bar ở phía trên đã có rounded top */
    border-radius: 0;
    flex-shrink: 0;
}

.header-title-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title-nav h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.nav-arrow {
    background: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #4caf50;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.month-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 30px;
}

.month-controls select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.month-grid-container {
    padding: 10px;
    background: white;
    overflow-y: auto;
    flex-grow: 1;
}

.weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.weekday-header div:last-child {
    color: #d32f2f;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #e0e0e0;
    gap: 1px;
    border-bottom: 1px solid #ddd;
}

.day-cell {
    background: white;
    aspect-ratio: 1 / 1;
    padding: 4px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    overflow: hidden;
}

.day-cell:hover {
    background: #f5f5f5;
}

.day-cell.today {
    background: #fff3e0 !important;
    box-shadow: inset 0 0 0 2px #ffb74d;
}

.day-cell.other-month {
    background: #fafafa;
}

.day-cell.other-month span {
    opacity: 0.4;
}

.solar-num {
    position: absolute;
    top: 3px;
    left: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.day-cell:nth-child(7n) .solar-num {
    color: #d32f2f;
}

/* Chấm zodiac trong ô lịch — absolute position. Scope vào .day-cell
   để không đè lên legend ở footer (legend dùng inline-block). */
.day-cell .zodiac-dot {
    position: absolute;
    top: 6px;
    left: 28px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.lunar-num {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.7rem;
    color: #888;
    font-weight: 500;
}

.can-chi-label {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.6rem;
    color: #777;
    white-space: nowrap;
}

.holiday-label {
    position: absolute;
    bottom: 3px;
    left: 2px;
    right: 2px;
    text-align: center;
    font-size: 0.6rem;
    color: #d32f2f;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-cell.is-holiday .solar-num {
    color: #d32f2f;
}

.nav-container {
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    padding: 10px 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nav-btn:hover {
    opacity: 0.8;
}

.bloc-header {
    flex: 1;
    padding: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.bloc-split {
    display: flex;
    position: relative;
    padding: 50px 10px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--divider-color);
    /* Cần để chứa ảnh background + scrim */
    overflow: hidden;
    isolation: isolate;
    min-height: 380px;
}

/* === ẢNH BACKGROUND CỦA KHỐI NGÀY === */
.bloc-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.bloc-bg-image[data-loaded="false"] {
    opacity: 0;
}

/* Scrim — gradient NHẸ để giữ ảnh tươi, dựa vào text-shadow dày để text vẫn đọc rõ.
   Tối đa 20% ở chân — chỉ "vén nhẹ" để mắt không bị mỏi. */
.bloc-split.has-landmark-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(0, 0, 0, 0.15) 0%,
            rgba(0, 0, 0, 0.03) 25%,
            rgba(0, 0, 0, 0.03) 55%,
            rgba(0, 0, 0, 0.15) 85%,
            rgba(0, 0, 0, 0.20) 100%);
    z-index: 1;
    pointer-events: none;
}

/* === ĐỔI MÀU CHỮ KHI CÓ ẢNH NỀN === */
/* Tất cả text trong bloc-split sang trắng + viền + bóng để nổi trên MỌI ảnh */
.bloc-split.has-landmark-bg .split-side {
    position: relative;
    z-index: 2;
}

.bloc-split.has-landmark-bg .solar-day,
.bloc-split.has-landmark-bg .lunar-day {
    color: #fff;
    /* 4-điểm stroke đen mảnh + soft glow đậm */
    text-shadow:
        -1.5px -1.5px 0 rgba(0, 0, 0, 0.7),
        1.5px -1.5px 0 rgba(0, 0, 0, 0.7),
        -1.5px 1.5px 0 rgba(0, 0, 0, 0.7),
        1.5px 1.5px 0 rgba(0, 0, 0, 0.7),
        0 6px 18px rgba(0, 0, 0, 0.55);
}

.bloc-split.has-landmark-bg .side-label,
.bloc-split.has-landmark-bg .solar-month-year,
.bloc-split.has-landmark-bg .lunar-month-info,
.bloc-split.has-landmark-bg .week-display,
.bloc-split.has-landmark-bg .holiday-text {
    color: #fff !important;
    opacity: 1;
    font-weight: 700;
    /* Halo 4 lớp + viền 1px sắc nét — đọc rõ trên cả nền sáng (gradient yếu) */
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.9),
        1px -1px 0 rgba(0, 0, 0, 0.9),
        -1px 1px 0 rgba(0, 0, 0, 0.9),
        1px 1px 0 rgba(0, 0, 0, 0.9),
        0 2px 6px rgba(0, 0, 0, 0.85),
        0 0 16px rgba(0, 0, 0, 0.55);
}

/* Holiday text nổi vàng nhẹ thay vì đỏ — đỏ trên ảnh nhiều màu khó đọc */
.bloc-split.has-landmark-bg .holiday-text {
    color: #FFD54F !important;
}

/* Dải gạch giữa 2 cột (dương / âm) đổi sang trắng đặc + bóng cho rõ trên ảnh */
.bloc-split.has-landmark-bg .solar-side {
    border-right: 2px dashed rgba(255, 255, 255, 0.75);
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.35);
}

/* Nút prev/next nổi trên ảnh */
.bloc-split.has-landmark-bg .side-nav-btn {
    z-index: 5;
    background: rgba(255, 255, 255, 0.92);
    border-color: transparent;
}

.split-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    min-width: 0;
}

.solar-side {
    border-right: 2px dashed var(--divider-color);
}

.side-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.solar-day {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    /* Fix line-height to reserve space */
    min-height: 6rem;
    /* Support skeleton look */
    color: var(--primary-color);
    margin-bottom: 15px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.solar-month-year {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.lunar-day {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    /* Fix line-height to reserve space */
    min-height: 6rem;
    /* Support skeleton look */
    color: #4A148C;
    margin-bottom: 15px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.lunar-month-info {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.holiday-text {
    font-size: 0.9rem;
    color: #e53935;
    font-weight: 700;
    min-height: 1.4rem;
    text-align: center;
    padding: 0 10px;
}

.side-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--divider-color);
    background: var(--modal-bg);
    color: var(--primary-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
}

.side-nav-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.side-nav-btn.prev {
    left: -15px;
}

.side-nav-btn.next {
    right: -15px;
}

/* --- Mobile Responsive Fixes --- */
@media (max-width: 480px) {

    .solar-day,
    .lunar-day {
        font-size: 4.5rem;
        /* Sửa lỗi số đè lên nhau */
    }

    .side-nav-btn {
        width: 38px;
        height: 38px;
    }

    .side-nav-btn.prev {
        left: -8px;
    }

    .side-nav-btn.next {
        right: -8px;
    }

    .bloc-split {
        gap: 10px;
        padding: 40px 6px;
    }

    /* Mỗi cột chỉ ~180px trên mobile — co text phụ để khỏi xuống 2-3 dòng */
    .solar-month-year,
    .lunar-month-info {
        font-size: 0.78rem;
        line-height: 1.3;
        padding: 0 4px;
    }

    .week-display {
        font-size: 0.7rem;
        line-height: 1.3;
        padding: 0 4px;
    }

    .side-label {
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        margin-bottom: 12px;
    }

    /* Số ngày to vẫn giữ ấn tượng nhưng nhỏ lại 1 chút cho gọn */
    .solar-day,
    .lunar-day {
        font-size: 5rem;
        min-height: 5rem;
        margin-bottom: 10px;
    }

    /* Fix Month View Modal for mobile */
    .month-header {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        padding: 15px 10px;
    }

    .header-title-nav h2 {
        font-size: 1.1rem;
    }

    .month-controls {
        margin-right: 0;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .month-controls select {
        padding: 4px 6px;
        font-size: 0.85rem;
    }

    #btn-view-month {
        font-size: 0.8rem;
        padding: 4px 10px !important;
    }

    #month-view-modal .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    /* Optimize Grid Cells for mobile */
    .solar-num {
        font-size: 0.9rem;
        top: 2px;
        left: 4px;
    }

    .lunar-num {
        font-size: 0.6rem;
        top: 2px;
        right: 4px;
    }

    .can-chi-label {
        font-size: 0.5rem;
        bottom: 14px;
    }

    .holiday-label {
        font-size: 0.5rem;
        bottom: 2px;
    }

    .day-cell .zodiac-dot {
        top: 4px;
        left: 20px;
        width: 4px;
        height: 4px;
    }

    .weekday-header {
        font-size: 0.7rem;
        padding: 4px 0;
    }
}

@media (max-width: 360px) {

    .solar-day,
    .lunar-day {
        font-size: 3.5rem;
    }

    .side-nav-btn.prev {
        left: -5px;
    }

    .side-nav-btn.next {
        right: -5px;
    }

    .side-nav-btn svg {
        width: 18px;
        height: 18px;
    }
}

.bloc-footer-info {
    padding: 25px;
    background: var(--surface-color);
    border-top: 1px solid var(--divider-color);
    text-align: left;
    font-size: 0.9rem;
}

.day-status {
    color: #555;
    line-height: 1.8;
}

.day-status strong {
    color: var(--primary-color);
    font-weight: 700;
}

.quote-container {
    padding: 0 16px;
    margin-bottom: 24px;
    perspective: 1000px;
}

.quote-banner {
    /* Glassmorphism: nền bán trong + blur backdrop để thấy gì phía sau */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: slideUpFade 0.6s ease-out;
}

[data-theme='dark'] .quote-banner {
    background: rgba(40, 40, 40, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.2), transparent);
}

.quote-icon {
    font-size: 1.2rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

#quote-title {
    flex: 1;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--quote-title-color);
    text-align: left;
}

.collapse-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.quote-banner.collapsed .collapse-btn {
    transform: rotate(-90deg);
}

.quote-body {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s;
    padding: 0 16px 16px 16px;
}

.quote-banner.collapsed .quote-body {
    max-height: 0;
    padding-bottom: 0;
}

#daily-quote {
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 500;
    color: var(--quote-body-color);
    line-height: 1.5;
    text-align: left;
    margin: 0;
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    height: 44px;
    /* Standard touch target */
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn.primary {
    background: var(--primary-color);
    color: #fff;
}

.btn.secondary {
    background: var(--secondary-color);
    color: #333;
}

/* Modal Style */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--modal-bg);
    color: var(--text-color);
    margin: 10% auto;
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.month-header .close-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    color: white;
    font-size: 24px;
    opacity: 0.8;
    margin-left: 0;
}

.month-header .close-btn:hover {
    opacity: 1;
    color: white;
}

.scrollable {
    overflow-y: auto;
    max-height: 60vh;
    text-align: left;
    white-space: pre-line;
    line-height: 1.6;
    margin-top: 20px;
    padding-right: 10px;
}

/* Search Form Style */
.search-form {
    margin-top: 20px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #666;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-color);
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    background: var(--surface-color);
}

.divider {
    margin: 15px 0;
    font-size: 0.75rem;
    color: #999;
    font-weight: 700;
    position: relative;
    text-align: center;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #eee;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.lunar-inputs,
.solar-inputs-group {
    display: flex;
    gap: 8px;
}

.lunar-inputs input,
.solar-inputs-group input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.app-footer {
    margin-top: 20px;
    padding-bottom: 20px;
    text-align: center;
}

#footer-credit {
    font-size: 0.75rem;
    color: #888;
    opacity: 0.8;
    margin: 0;
    font-style: italic;
    letter-spacing: 0.2px;
}

.footer-links {
    margin: 8px 0 0;
    font-size: 0.72rem;
    color: #999;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* ── WEEK DISPLAY ── */
.week-display {
    font-size: 0.85rem;
    color: #43a047; /* Vibrant Green */
    opacity: 1;
    margin-top: 6px;
    font-weight: 700;
    line-height: 1.4;
}

/* ── HOLIDAY BANNER ── */
.holiday-banner {
    margin: 20px auto 0;
    max-width: 600px;
    /* Glassmorphism — đồng nhất với quote-banner */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: fadeIn 0.5s ease-out;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme='dark'] .holiday-banner {
    background: rgba(40, 40, 40, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.holiday-banner .icon { font-size: 1.4rem; }
.holiday-banner .text { font-size: 0.95rem; font-weight: 600; color: var(--primary-color); }
.holiday-banner .days { font-size: 0.9rem; color: var(--text-color); opacity: 0.8; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .holiday-banner { margin: 15px 20px 0; padding: 10px 15px; flex-direction: column; gap: 4px; text-align: center; }
}

/* ========== SWIPE / NAV TRANSITION ANIMATIONS ========== */
/* GPU acceleration cho mọi element animated → khử flicker trên iOS Safari */
.split-side,
.bloc-bg-image,
#month-grid {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-perspective: 1000;
    perspective: 1000;
}

.swipe-out-left,
.swipe-out-right,
.swipe-in-right,
.swipe-in-left {
    will-change: transform, opacity;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.swipe-out-left  { animation: swipeOutLeft  0.16s ease-out forwards; }
.swipe-out-right { animation: swipeOutRight 0.16s ease-out forwards; }
.swipe-in-right  { animation: swipeInRight  0.20s ease-out; }
.swipe-in-left   { animation: swipeInLeft   0.20s ease-out; }

@keyframes swipeOutLeft {
    from { transform: translate3d(0, 0, 0); opacity: 1; }
    to   { transform: translate3d(-24px, 0, 0); opacity: 0; }
}
@keyframes swipeOutRight {
    from { transform: translate3d(0, 0, 0); opacity: 1; }
    to   { transform: translate3d(24px, 0, 0); opacity: 0; }
}
@keyframes swipeInRight {
    from { transform: translate3d(24px, 0, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes swipeInLeft {
    from { transform: translate3d(-24px, 0, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0); opacity: 1; }
}
