/* 
 * FUSION EATS - SEARCH MODAL
 * Premium Full-Screen Search Experience
 */

.search-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-header {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-modal-close {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
}

.search-modal-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem 3rem 3rem;
    position: relative;
    background: transparent !important;
}

.search-step {
    display: none;
    animation: step-reveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.search-step.active {
    display: block;
}

@keyframes step-reveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-step-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.search-step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: white;
    border: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #9ca3af;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #f3f4f6;
    margin: 0 -0.5rem;
    margin-top: -1.5rem; 
    position: relative;
    z-index: 1;
    transition: all 0.6s ease;
}

/* Active State */
.step-item.active .step-circle {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: #fffafa;
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(185, 28, 28, 0.1);
}

.step-item.active .step-label {
    color: var(--brand-red);
}

/* Completed State */
.step-item.completed .step-circle {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: white;
}

.step-item.completed .step-circle::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
}

.step-item.completed .step-circle {
    font-size: 0;
}

.step-line.active {
    background: var(--brand-red);
}

.search-step-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--dark-gray);
    line-height: 1.15;
}

/* Step 1: Where - State Grid */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.state-item {
    background: white;
    padding: 1.25rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.state-item:hover {
    background: white;
    border-color: var(--brand-red);
    color: var(--brand-red);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px -8px rgba(185, 28, 28, 0.15);
}

.state-item.selected {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: #fffafa;
    box-shadow: 0 8px 20px rgba(185, 28, 28, 0.1);
}

.state-item span {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

/* Step 2: When - Date Picker Overrides */
.search-date-container {
    padding: 1rem;
    margin: 0 auto;
    width: 100%;
    max-width: 440px; /* Optimal width for a square calendar */
    display: flex;
    justify-content: center;
}

.search-modal-overlay .air-datepicker.search-modal-dp {
    border: none !important;
    width: 100% !important;
    max-width: none !important;
    font-family: var(--font-primary) !important;
    background: #fff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
    border-radius: 1.5rem !important;
    padding: 1.5rem !important;
}

.search-modal-overlay .air-datepicker--content,
.search-modal-overlay .air-datepicker--body,
.search-modal-overlay .air-datepicker-body--cells {
    width: 100% !important;
    aspect-ratio: auto !important; /* Remove forced aspect ratio that causes stretching */
}

.search-modal-overlay .air-datepicker-nav {
    border-bottom: none;
    padding: 0 0 1.5rem;
    justify-content: space-between;
}

.search-modal-overlay .air-datepicker-nav--title {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-modal-overlay .air-datepicker-nav--action {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.search-modal-overlay .air-datepicker-nav--action:hover {
    background: #f3f4f6;
    color: var(--brand-red);
}

.search-modal-overlay .air-datepicker-body--day-name {
    font-weight: 800;
    color: var(--brand-red);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base cell styling - Forces perfect squares */
.search-modal-overlay .air-datepicker-cell {
    border-radius: 0 !important;
    font-weight: 600;
    font-size: 0.95rem !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important; /* Make each cell a perfect square based on width */
    position: relative;
    z-index: 1;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shared circular background for hover, current, and selected states */
.search-modal-overlay .air-datepicker-cell::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.5rem; /* Fixed size, not too big */
    height: 2.5rem;
    border-radius: 50%;
    z-index: -1;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Strip default hover/focus backgrounds from the library completely */
.search-modal-overlay .search-modal-dp .air-datepicker-cell:hover,
.search-modal-overlay .search-modal-dp .air-datepicker-cell.-focus-,
.search-modal-overlay .search-modal-dp .air-datepicker-cell.-day-:hover,
.search-modal-overlay .search-modal-dp .air-datepicker-cell.-day-.-focus- {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Custom circular hover state */
.search-modal-overlay .search-modal-dp .air-datepicker-cell:not(.-selected-):not(.-current-):hover::before,
.search-modal-overlay .search-modal-dp .air-datepicker-cell:not(.-selected-):not(.-current-).-focus-::before {
    background: #f3f4f6;
}

/* Current date styling */
.search-modal-overlay .air-datepicker-cell.-current- {
    color: var(--brand-red);
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-modal-overlay .air-datepicker-cell.-current-::before {
    background: #fff1f2;
}

/* Selected dates (start and end) */
.search-modal-overlay .air-datepicker-cell.-selected- {
    color: white !important;
    background: transparent !important;
}

.search-modal-overlay .air-datepicker-cell.-selected-::before {
    background: var(--brand-red);
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.3);
}

/* Range connections */
.search-modal-overlay .air-datepicker-cell.-in-range- {
    color: var(--brand-red) !important;
    background: transparent !important;
}

.search-modal-overlay .air-datepicker-cell.-in-range-::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2.5rem;
    transform: translateY(-50%);
    background: #fff1f2;
    z-index: -2;
}

/* Range from connection */
.search-modal-overlay .air-datepicker-cell.-selected-.-range-from-::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    right: 0;
    height: 2.5rem;
    transform: translateY(-50%);
    background: #fff1f2;
    z-index: -2;
}

/* Range to connection */
.search-modal-overlay .air-datepicker-cell.-selected-.-range-to-::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    left: 0;
    height: 2.5rem;
    transform: translateY(-50%);
    background: #fff1f2;
    z-index: -2;
}

/* If from and to are the same day */
.search-modal-overlay .air-datepicker-cell.-selected-.-range-from-.-range-to-::after {
    display: none;
}

/* Selected Date Pill Styling */
.selected-date-pill {
    margin-top: 2.5rem;
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    animation: pill-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pill-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.selected-date-pill .pill-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.selected-date-pill .pill-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--brand-red);
}

/* Step 3: Who - Guest Selectors */
.guest-selector-container {
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.guest-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.guest-row:last-child {
    border-bottom: none;
}

.guest-info h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark-gray);
    margin-bottom: 0.2rem;
}

.guest-info p {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.guest-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.guest-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.guest-btn:hover:not(:disabled) {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: #fffafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.1);
}

.guest-btn:active:not(:disabled) {
    transform: translateY(0);
}

.guest-count {
    font-size: 1.25rem;
    font-weight: 900;
    min-width: 2.5rem;
    text-align: center;
    color: var(--dark-gray);
}

/* Navigation Footer */
.search-modal-footer {
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.modal-nav-btn {
    padding: 1rem 2rem;
    border-radius: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.7rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: none;
    cursor: pointer;
}

.btn-back {
    color: var(--text-secondary);
    background: #f9fafb;
}

.btn-back:hover {
    background: #f3f4f6;
    color: var(--dark-gray);
    transform: translateX(-4px);
}

.btn-next, .btn-finish {
    background: var(--brand-red);
    color: white;
    box-shadow: 0 10px 25px -8px rgba(185, 28, 28, 0.3);
}

.btn-next:hover, .btn-finish:hover {
    background: var(--brand-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px rgba(185, 28, 28, 0.4);
}

.btn-next:active, .btn-finish:active {
    transform: translateY(0);
}

/* Progress Indicator */
.search-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.03);
    z-index: 100000;
}

.search-progress-fill {
    height: 100%;
    background: var(--brand-red);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive */
@media (max-width: 768px) {
    .search-modal-header, .search-modal-footer {
        padding: 1.25rem 1.5rem;
    }
    
    .search-modal-content {
        padding: 1rem 1.5rem 2rem;
    }
    
    .search-step-title {
        font-size: 1.75rem;
    }
    
    .state-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .search-step-indicator {
        margin-bottom: 2rem;
    }
    
    .search-modal-close {
        width: 2.5rem;
        height: 2.5rem;
    }
}
