/* =====================================================
   BOOKIFY - SEARCH BOX & CALENDAR STYLES
   ===================================================== */

/* ===== SEARCH BOX ===== */
.search-wrapper {
    margin-top: -230px;
    position: relative;
    z-index: 10;
    margin-bottom: var(--spacing-3xl);
}

.search-box-modern {
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-gray-100);
}

.search-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-gray-600);
    transition: var(--transition-base);
}

.search-tab i {
    font-size: 13px;
}

.search-tab:hover {
    background: var(--color-gray-100);
    color: var(--color-black);
}

.search-tab.active {
    background: var(--color-gray-900);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-form-modern {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr auto;
    gap: 12px;
    padding: 20px;
    position: relative;
    align-items: flex-end;
}

/* ===== UNIFIED DATE INPUTS WRAPPER ===== */
.date-inputs-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    height: 46px;
    /* Match other inputs */
    align-items: center;
}

.date-inputs-wrapper:hover {
    border-color: var(--color-gray-300);
}

/* Internal Date Fields */
.search-field.date-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 12px;
    height: 100%;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 6px;
    /* Inner radius */
    margin: 2px;
    /* Small gap for active state */
}

.search-field.date-field:first-child {
    border-right: 1px solid transparent;
}

/* Separator between dates */
.search-field.date-field:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: var(--color-gray-200);
}

/* Active State for Date Field */
.search-field.date-field.active-field {
    background: #fff;
    box-shadow: 0 0 0 2px var(--color-primary);
    z-index: 2;
    /* Bring above siblings */
}

.search-field.date-field.active-field::after {
    display: none;
    /* Hide separator when active */
}

/* Labels inside date fields */
.search-field.date-field .search-label {
    font-size: 9px;
    color: var(--color-gray-600);
    margin-bottom: 0;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.search-field.date-field .search-label i {
    display: none;
    /* Hide icons inside for cleaner look */
}

/* Inputs inside date fields */
.search-field.date-field .search-input {
    border: none;
    background: transparent;
    padding: 0;
    height: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-black);
    width: 100%;
    box-shadow: none;
}

.search-field.date-field .search-input:focus {
    box-shadow: none;
    background: transparent;
}

.search-field.date-field .search-input::placeholder {
    color: var(--color-gray-400);
    font-weight: 400;
}

/* ===== OTHER FIELDS ===== */
.search-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.search-label i {
    font-size: 12px;
    color: var(--color-gray-500);
}

.search-input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-base);
    background: var(--color-white);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-black);
    background: var(--color-gray-50);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-button {
    background: var(--color-primary);
    color: var(--color-black);
    border: none;
    width: 52px;
    height: 46px;
    border-radius: 8px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    box-shadow: 0 4px 15px rgba(254, 250, 23, 0.25);
    cursor: pointer;
}

.search-button:hover {
    background: var(--color-black);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.search-button:active {
    transform: translateY(-1px);
}

/* ===== COMPACT CALENDAR STYLES ===== */
.calendar-dropdown-combined {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 660px;
    /* Fixed width for 2 months */
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 24px;
    z-index: 1000;
    display: none;
    margin-top: 12px;
}

.calendar-dropdown-combined.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.calendar-navigation {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    /* Let clicks pass through to headers */
    z-index: 10;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    /* Re-enable clicks */
    transition: all 0.2s ease;
    color: var(--color-gray-600);
}

.calendar-nav-btn:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-300);
    color: var(--color-black);
}

.calendar-months-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.calendar-month-header {
    text-align: center;
    margin-bottom: 16px;
}

.calendar-month-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
    margin: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 2px;
}

.calendar-day {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Circular selection */
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--color-gray-800);
    transition: all 0.2s ease;
    margin: 1px 0;
}

.calendar-day:hover:not(.disabled):not(.selected):not(.in-range) {
    background: var(--color-gray-100);
    color: var(--color-black);
}

/* Selected State (Start/End) */
.calendar-day.selected {
    background: var(--color-white);
    border: 1px solid var(--color-primary);
    color: var(--color-black);
    font-weight: 700;
    position: relative;
    z-index: 2;
}

/* Range State */
.calendar-day.in-range {
    background: rgba(254, 250, 23, 0.15);
    /* Very light primary */
    border-radius: 0;
}

.calendar-day.in-range:first-child,
.calendar-day.selected.range-start+.in-range {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
}

.calendar-day.in-range:last-child {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
}

.calendar-day.disabled {
    color: var(--color-gray-300);
    cursor: not-allowed;
}

.calendar-day.today {
    position: relative;
}

.calendar-day.today::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
}

.calendar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-gray-100);
}

.calendar-clear-btn {
    background: none;
    border: none;
    color: var(--color-gray-600);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.calendar-clear-btn:hover {
    background: var(--color-gray-50);
    color: var(--color-red);
}

.calendar-today-btn {
    background: var(--color-primary);
    color: var(--color-black);
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.calendar-today-btn:hover {
    background: var(--color-black);
    color: var(--color-primary);
}

/* Responsive Search */
@media (max-width: 992px) {
    .search-form-modern {
        grid-template-columns: 1fr 1fr;
    }

    .date-inputs-wrapper {
        grid-column: span 2;
    }

    .search-button {
        grid-column: span 2;
        width: 100%;
    }

    .calendar-dropdown-combined {
        width: 90%;
        left: 5%;
        transform: none;
    }
}

@media (max-width: 768px) {
    .search-form-modern {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .date-inputs-wrapper {
        grid-column: span 1;
        grid-template-columns: 1fr;
        height: auto;
        /* Allow stacking */
        gap: 8px;
        padding: 8px;
    }

    .search-field.date-field:first-child::after {
        display: none;
    }

    .search-button {
        grid-column: span 1;
    }

    .calendar-months-wrapper {
        grid-template-columns: 1fr;
    }

    .calendar-dropdown-combined {
        width: 100%;
        left: 0;
        border-radius: 0;
    }
}
/* Hide days from other months */
.calendar-day.other-month {
    visibility: hidden;
    pointer-events: none;
}
