/* Calendar Popup Modal Styles */
.timezone-control {
    display: none;
}

.calendar-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 80px;
    /* Account for progress header height */
    box-sizing: border-box;
}

.calendar-popup-overlay.show {
    display: flex;
}

.calendar-popup-modal {
    background: white;
    border-radius: 24px;
    box-shadow: 0 0 48px 0 rgba(9, 17, 41, 0.24);
    max-width: 1200px;
    width: 100%;
    max-height: calc(100vh - 120px);
    /* Account for header + padding */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-popup-header {
    background: #0C71C3;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-popup-title {
    color: #FFF;
    text-align: center;
    font-size: 20px !important;
    font-style: normal;
    font-weight: 700;
    line-height: 150%;
    margin: 0;
    flex: 1;
    font-family: 'Plus Jakarta Sans';
}

.mobile-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: none;
    /* Hidden by default (desktop) */
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-popup-close {
    position: absolute;
    top: 95px;
    right: 20px;
    background: #fff;
    border: none;
    color: rgb(0, 0, 0);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 1001;
    font-family: 'Plus Jakarta Sans';
}

.calendar-popup-close:hover {
    background: rgba(255, 255, 255, 0.7);
}

.calendar-popup-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.calendar-section {
    width: 100%;
    max-width: 50%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.time-slots-section {
    padding: 30px 30px 30px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-width: 25%;
}

.banners-section {
    background: #F7F7F7;
    padding: 40px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
}

.calendar-popup-footer {
    background: #fff;
    padding: 16px 32px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-details {
    display: flex;
    gap: 40px;
    align-items: center;
}

.booking-detail-label {
    color: rgba(0, 0, 0, 0.64);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    font-family: 'Plus Jakarta Sans';
}

.booking-detail-value {
    color: rgba(0, 0, 0, 0.87);
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 150%;
    font-family: 'Plus Jakarta Sans';
}

.confirm-call-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Plus Jakarta Sans';
}

.confirm-call-btn:hover {
    background: #20c55a;
}

.confirm-call-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Calendar Styles */
.calendar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-month-year {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans';
}

.calendar-navigation {
    display: flex;
    gap: 10px;
}

.calendar-nav-btn {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 30px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-family: 'Plus Jakarta Sans';
}

.calendar-nav-btn:hover:not(:disabled):not(.disabled) {
    background: #e9ecef;
    border-color: #0C71C3;
    color: #0C71C3;
}

.calendar-nav-btn:disabled,
.calendar-nav-btn.disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #b0b0b0;
    cursor: not-allowed;
    opacity: 0.6;
}

.calendar-nav-btn:disabled:hover,
.calendar-nav-btn.disabled:hover {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #b0b0b0;
}

.calendar-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    overflow: visible;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
}

.weekday {
    color: rgba(0, 0, 0, 0.48);
    text-align: center;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    text-transform: uppercase;
    font-family: 'Plus Jakarta Sans';
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    place-items: center;
    overflow: visible;
    padding: 8px 0;
}

.calendar-day {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    position: relative;
    background: #EAF6FF;
    color: #0C71C3;
    box-sizing: border-box;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans';
}

/* .calendar-day:hover:not(.empty):not(.unavailable) {
    background: #D1ECFF;
    color: #0C71C3;
} */

/* 
.calendar-day.today {
    background: #e3f2fd;
    color: #0C71C3;
    font-weight: 600;
} */

.calendar-day.selected {
    border-radius: 24px;
    background: #0C71C3;
    box-shadow: 4px 4px 16px 0 rgba(9, 78, 134, 0.32) !important;
    color: white;
    font-weight: 600;
    border: none;
}

.calendar-day.unavailable {
    background: transparent;
    color: rgba(0, 0, 0, 0.24);
    cursor: not-allowed;
    position: relative;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.unavailable-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    font-family: 'Plus Jakarta Sans';
    margin-bottom: 4px;
    min-width: max-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.unavailable-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #ff4444;
}

.calendar-day.unavailable:hover .unavailable-tooltip {
    opacity: 1;
}

/* Time Slots Styles */
.time-slots-section {
    display: flex;
    flex-direction: column;
}

.time-slots-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    font-family: 'Plus Jakarta Sans';
    text-align: center;
}

.time-slots-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable;
    min-height: 400px;
    max-height: 400px;
}

.time-slots-container::-webkit-scrollbar {
    width: 6px;
}

.time-slots-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.time-slots-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.time-slots-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.time-slots-placeholder,
.time-slots-loading,
.time-slots-error,
.time-slots-no-slots {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    margin: 0;
    font-family: 'Plus Jakarta Sans';
}

.time-slots-loading {
    color: #0C71C3;
}

.time-slots-error {
    color: #ff4444;
}

.time-slots-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 2px;
}

/* Skeleton Loading Styles */
.time-slots-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-slot {
    height: 48px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.time-slot-btn {
    border-radius: 8px;
    border: 1px solid #0C71C3;
    background: #FFF;
    color: #0C71C3;
    text-align: center;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    padding: 16px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: none;
    font-family: 'Plus Jakarta Sans';
}

.time-slot-btn:focus {
    outline: none;
    box-shadow: none;
    border: 1px solid #0C71C3;
}

.time-slot-btn:hover {
    border-color: #0C71C3;
    background: #f0f8ff;
    color: #0C71C3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(12, 113, 195, 0.15);
}

.time-slot-btn.selected {
    background: #0C71C3;
    border: 1px solid #0C71C3;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(12, 113, 195, 0.3) !important;
    outline: none;
}

.time-slot-btn.selected:hover {
    background: #0a5a9c;
    border: 1px solid #0a5a9c;
    transform: translateY(-1px);
}

.time-slot-btn.selected:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(12, 113, 195, 0.3);
    border: 1px solid #0C71C3;
}

/* Banners Styles */
.banners-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trust-banner {
    background: #FFF1DA;
    border: 1px solid #F7A81D;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;

}

.trust-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.trust-banner-icon {
    display: flex;
    gap: 4px;
}

.trust-banner-text {
    font-size: 14px;
    color: #333;
    margin: 0;
    text-align: left;
    line-height: 1.5;
    font-family: 'Plus Jakarta Sans';
}

.whatsapp-banner {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #FFF;
    padding: 24px 16px;
    text-align: center;
}

.whatsapp-banner-icon {
    margin-bottom: 12px;
    text-align: left;
    width: max-content;
    background: #EBF7EF;
    padding: 8px;
}

.whatsapp-banner-title {
    color: rgba(0, 0, 0, 0.87);
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
    margin-bottom: 12px;
    text-align: center;
    font-family: 'Plus Jakarta Sans';
}

.whatsapp-banner-text {
    color: rgba(0, 0, 0, 0.64);
    font-family: 'Roboto';
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    text-align: left;
    margin-bottom: 16px;
}

.whatsapp-btn {
    background: #FFF;
    color: #4CAF50;
    border-radius: 8px;
    border: 1px solid #4CAF50;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-family: 'Plus Jakarta Sans';
}

.whatsapp-btn:hover {
    background: #E9FFF2;
    color: #4CAF50;
}

/* Confirmation Bar Styles */
.calendar-popup-footer {
    background: #fff;
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-booking-details {
    background: transparent;
    border: none;
    color: #0C71C3;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 4px;
    font-family: 'Plus Jakarta Sans';
}

.toggle-booking-details:focus {
    outline: none;
}

.toggle-icon svg {
    display: block;
}

/* Hide toggle by default (desktop). Mobile will override */
.toggle-booking-details {
    display: none;
}

.booking-detail-item {
    display: flex;
    align-items: baseline;
    font-size: 16px;
    color: #333;
    flex-direction: column;
    position: relative;
    font-family: 'Plus Jakarta Sans';
}

.booking-detail-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 50px;
    background-color: #D1D1D1;
}

.confirm-call-btn {
    background: #41A76D;
    color: white;
    border: none;
    padding: 12px 54px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 3px 3px 8px 0 rgba(255, 255, 255, 0.24) inset, 4px 4px 16px 0 rgba(65, 167, 109, 0.32);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans';
}

.confirm-call-btn:hover:not(:disabled) {
    background: rgb(23, 143, 65);
}

.confirm-call-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.confirm-call-btn .desktop-text {
    display: block;
    font-family: 'Plus Jakarta Sans';
}

.confirm-call-btn .mobile-text {
    display: none;
}

/* Animation for popup entrance */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.calendar-popup-modal {
    animation: popupFadeIn 0.3s ease-out;
}


@media (max-width: 768px) {
    .calendar-popup-overlay {
        padding: 10px;
        padding-top: 70px;
        /* Adjust for mobile header */
    }

    .calendar-popup-modal {
        max-width: 100%;
        margin: 0;
        /* Fallback for browsers without dynamic viewport units */
        max-height: calc(100vh - 95px);
        /* Prefer dynamic viewport when supported */
        max-height: calc(100dvh - 95px);
        /* Adjust for mobile */
        border-radius: 16px;
    }

    .calendar-popup-body {
        flex-direction: column;
        min-height: unset;
        flex: none;
    }

    .calendar-section,
    .time-slots-section,
    .banners-section {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 16px;
    }

    .banners-section {
        border-bottom: none;
    }

    .booking-details {
        flex-direction: row;
        gap: 10px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .calendar-popup-footer {
        flex-direction: column;
        gap: 10px;
        /* mobile spacing */
        align-items: stretch;
    }

    .confirm-call-btn {
        width: max-content;
    }

    .confirm-call-btn:disabled {
        padding: 12px;
    }

    .confirm-call-btn .desktop-text {
        display: none;
    }

    .confirm-call-btn .mobile-text {
        display: block;
    }

    .footer-actions {
        justify-content: space-between;
        gap: unset;
    }

    .booking-detail-value {
        font-size: 12px;
    }

    .calendar-day {
        width: 36px;
        height: 36px;
        font-size: 12px;
        font-family: 'Plus Jakarta Sans';
    }

    .calendar-popup-title {
        font-size: 15px !important;
        font-family: 'Plus Jakarta Sans';
    }

    .calendar-popup-header {
        padding: 8px;
    }

    .calendar-popup-close {
        display: none;
    }

    .mobile-close-btn {
        display: flex;
        /* Show on mobile */
    }

    .calendar-popup-modal {
        overflow: scroll;
    }

    .calendar-popup-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar-popup-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        background: #fff;
        padding: 12px 16px;
        gap: 26px;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    }

    /* Mobile: show toggle and collapse details by default */
    .toggle-booking-details {
        display: inline-flex;
    }

    #booking-details {
        display: none;
    }

    .whatsapp-banner-icon {
        display: none;
    }

    .whatsapp-banner-text,
    .time-slots-title {
        text-align: center;
    }

    .whatsapp-banner {
        padding: 16px;
    }

    .booking-detail-item:not(:last-child)::after {
        display: none;
    }

}