/* ==============================================
   Date Range Picker (Hero & Reusable)
   ============================================== */

.filter-calendar-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.filter-calendar-popup.visible {
    display: flex;
}

.filter-calendar-popup-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    position: relative;
}

.filter-calendar-popup-content.slide-in-right {
    animation: slideInRight 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.filter-calendar-popup-content.slide-out-left {
    animation: slideOutLeft 0.48s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.filter-calendar-popup-content.modal-exiting {
    animation: modalExit 0.92s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    pointer-events: none;
}

.filter-calendar-popup-content.modal-minimizing {
    animation: modalMinimize 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    pointer-events: none;
}

.filter-calendar-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, #c4613c 0%, #f0a67d 100%);
    position: relative;
    z-index: 5;
}

.filter-calendar-popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    flex: 1;
    text-align: center;
}

.filter-calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
    position: relative;
    z-index: 10;
}

.filter-calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.filter-calendar-nav-btn:active {
    transform: scale(0.95);
}

.filter-calendar-nav-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.filter-calendar-popup-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.filter-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.filter-month-calendar {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-month-header {
    background: linear-gradient(135deg, #c4613c 0%, #f0a67d 100%);
    color: #ffffff;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.filter-month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px;
    background: #ffffff;
}

.filter-day-header {
    padding: 8px 4px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-day {
    padding: 10px 4px;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--text-dark);
    font-weight: 500;
}

.filter-day.other-month {
    color: #d1d5db;
    opacity: 0.4;
}

.filter-day.past {
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.5;
}

.filter-day.today {
    background: #dbeafe;
    color: #0f509b;
    font-weight: 700;
    border: 2px solid #0f509b;
}

.filter-day.available {
    background: #f0fdf4;
    color: #166534;
}

.filter-day.available:hover {
    background: #d1fae5;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.filter-day.selected {
    background: #c4613c;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(196, 97, 60, 0.3);
}

.filter-day.in-range {
    background: #fed7aa;
    color: #9a3412;
}

.filter-day.disabled {
    background: #f3f4f6;
    color: #a1a1aa;
    cursor: not-allowed;
    opacity: 0.6;
    text-decoration: line-through;
}

.calendar-date-confirmed,
.calendar-date-highlight {
    position: relative;
}

.calendar-date-confirmed::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    animation: confirmPop 0.45s ease forwards;
    pointer-events: none;
}

.calendar-date-highlight {
    border-color: #dd7447 !important;
    box-shadow: 0 14px 32px rgba(221, 116, 71, 0.28);
    animation: highlightPulse 1.2s ease-out 2;
}

.calendar-transition-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.transition-check {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    box-shadow: 0 18px 50px rgba(16, 185, 129, 0.45);
    transform: scale(0);
    opacity: 0;
}

.calendar-transition-overlay.visible .transition-check {
    animation: checkLock 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.calendar-transition-overlay.fadeout .transition-check {
    animation: checkRelease 0.24s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.calendar-transition-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    z-index: 10003;
}

.calendar-transition-message.visible {
    animation: messageFade 2.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(42px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-46px);
    }
}

@keyframes messageFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -40px);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -8px);
    }
    55% {
        opacity: 1;
        transform: translate(-50%, -8px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}

@keyframes checkLock {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes checkRelease {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.6);
    }
}
@keyframes modalExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes modalMinimize {
    from {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(var(--minimize-translate-x, 0), var(--minimize-translate-y, 0)) scale(0.25);
    }
}

@keyframes confirmPop {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }
    70% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0;
        transform: scale(0.75);
    }
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 16px 36px rgba(221, 116, 71, 0.35);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 10px 22px rgba(221, 116, 71, 0.2);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 14px 32px rgba(221, 116, 71, 0.28);
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .filter-calendar-popup-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .filter-calendar-popup-header {
        padding: 16px 20px;
    }

    .filter-calendar-popup-title {
        font-size: 1rem;
    }

    .filter-calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .filter-calendar-popup-body {
        padding: 12px;
        max-height: calc(100vh - 80px);
    }

    .filter-calendar-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-month-header {
        padding: 10px;
        font-size: 0.9rem;
    }

    .filter-day {
        padding: 8px 2px;
        font-size: 0.85rem;
        min-height: 36px;
    }

    .filter-day-header {
        padding: 6px 2px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .filter-calendar-popup-header {
        padding: 12px 16px;
    }

    .filter-calendar-popup-title {
        font-size: 0.9rem;
    }

    .filter-calendar-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .filter-calendar-popup-body {
        padding: 8px;
    }

    .filter-month-header {
        padding: 8px;
        font-size: 0.85rem;
    }

    .filter-day {
        padding: 6px 2px;
        font-size: 0.8rem;
        min-height: 32px;
    }
}

[data-theme="dark"] .filter-calendar-popup {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .filter-calendar-popup-content {
    background: #2c3e50;
}

[data-theme="dark"] .filter-calendar-popup-header {
    background: linear-gradient(135deg, #1e293b 0%, #2c3e50 100%);
    border-bottom-color: #34495e;
}

[data-theme="dark"] .filter-calendar-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

[data-theme="dark"] .filter-calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .filter-month-calendar {
    background: #34495e;
    border-color: #4a5568;
}

[data-theme="dark"] .filter-month-header {
    background: linear-gradient(135deg, #1e293b 0%, #2c3e50 100%);
}

[data-theme="dark"] .filter-month-days {
    background: #34495e;
}

[data-theme="dark"] .filter-day-header {
    color: #9ca3af;
}

[data-theme="dark"] .filter-day {
    background: #34495e;
    color: #ecf0f1;
}

[data-theme="dark"] .filter-day.other-month {
    color: #4a5568;
    opacity: 0.3;
}

[data-theme="dark"] .filter-day.past {
    color: #6b7280;
    opacity: 0.4;
}

[data-theme="dark"] .filter-day.today {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #4a90e2;
}

[data-theme="dark"] .filter-day.available {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .filter-day.available:hover {
    background: #065f46;
}

[data-theme="dark"] .filter-day.selected {
    background: #4a90e2;
    color: #ffffff;
}

[data-theme="dark"] .filter-day.in-range {
    background: #5a4a2a;
    color: #ffd54f;
}

[data-theme="dark"] .filter-day.disabled {
    background: #475569;
    color: #a5b4fc;
    text-decoration-color: rgba(165, 180, 252, 0.5);
}

