/* Enhanced Search Widget Styles - Compiled from SCSS */

/* Main container */
.enhanced-search-widget {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Search widget container */
.search-widget-container {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    position: relative;
    overflow: visible;
}

/* Search form layout */
.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 1024px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    .search-form {
        grid-template-columns: 1fr;
    }
}

/* Individual search field */
.search-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 3.5rem;
}

/* Field label with icon */
.field-label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}
.field-label .field-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #9CA3AF;
    transition: color 0.2s ease;
}
.field-label .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Search input styling */
.search-input {
    width: 100%;
    height: 3.5rem;
    min-height: 3.5rem;
    padding: 0 1rem 0 3rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1F2937;
    background: #F9FAFB;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}
.search-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}
.search-input:focus {
    background: white;
    border-color: #0066CC;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}
.search-input:focus ~ .field-label .field-icon {
    color: #0066CC;
}
.search-input:hover:not(:focus) {
    background: white;
    border-color: #E5E7EB;
}
.search-input.error {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
}
.search-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}
.search-input.error ~ .field-label .field-icon {
    color: #EF4444;
}
.search-input.loading {
    background-image: linear-gradient(90deg, #F9FAFB 0%, #F3F4F6 50%, #F9FAFB 100%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s ease-in-out infinite;
}

/* Kill browser native autocomplete yellow background */
.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus,
.search-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #F9FAFB inset !important;
    -webkit-text-fill-color: #1F2937 !important;
    box-shadow: 0 0 0 30px #F9FAFB inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

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

/* Guest button */
.guest-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
}
.guest-button .chevron-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #9CA3AF;
    transition: transform 0.3s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.guest-button .chevron-icon.rotate-180 {
    transform: rotate(180deg);
}
.guest-button:focus .chevron-icon {
    color: #0066CC;
}

/* Dropdown base styles */
.autocomplete-dropdown,
.guest-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    max-height: 20rem;
    overflow-y: auto;
}
.autocomplete-dropdown::-webkit-scrollbar,
.guest-dropdown::-webkit-scrollbar {
    width: 0.5rem;
}
.autocomplete-dropdown::-webkit-scrollbar-track,
.guest-dropdown::-webkit-scrollbar-track {
    background: #F3F4F6;
}
.autocomplete-dropdown::-webkit-scrollbar-thumb,
.guest-dropdown::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 0.25rem;
}
.autocomplete-dropdown::-webkit-scrollbar-thumb:hover,
.guest-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Dropdown transitions */
.dropdown-enter { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.dropdown-enter-start { opacity: 0; transform: translateY(-0.5rem) scale(0.95); }
.dropdown-enter-end { opacity: 1; transform: translateY(0) scale(1); }
.dropdown-leave { transition: all 0.15s cubic-bezier(0.4, 0, 1, 1); }
.dropdown-leave-start { opacity: 1; transform: translateY(0) scale(1); }
.dropdown-leave-end { opacity: 0; transform: translateY(-0.5rem) scale(0.95); }

/* Autocomplete dropdown items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    text-align: left;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dropdown-item .item-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.2s ease;
}
.dropdown-item:hover {
    background: #F0F7FF;
    color: #0066CC;
    transform: translateX(0.25rem);
}
.dropdown-item:hover .item-icon {
    color: #0066CC;
}
.dropdown-item:active {
    background: #E0EFFF;
}

/* Guest dropdown specific styles */
.guest-dropdown {
    padding: 1.5rem;
    min-width: 20rem;
}

/* Guest counter row */
.guest-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #F3F4F6;
}
.guest-counter-row:last-of-type {
    border-bottom: none;
}

/* Counter label */
.counter-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.counter-label .label-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1F2937;
}
.counter-label .label-description {
    font-size: 0.8125rem;
    color: #6B7280;
}

/* Counter controls */
.counter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Counter button */
.counter-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}
.counter-btn svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2.5;
}
.counter-btn:hover:not(:disabled) {
    border-color: #0066CC;
    background: #0066CC;
    color: white;
    transform: scale(1.1);
}
.counter-btn:active:not(:disabled) {
    transform: scale(0.95);
}
.counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Counter value */
.counter-value {
    min-width: 2rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1F2937;
}

/* Child ages section */
.child-ages-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #F3F4F6;
}
.child-ages-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}
.child-ages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr));
    gap: 0.5rem;
}
.child-age-select {
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1F2937;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.child-age-select:hover {
    border-color: #0066CC;
    background: white;
}
.child-age-select:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Error message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #EF4444;
    animation: shake 0.4s ease;
}
.error-message .error-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-0.5rem); }
    75% { transform: translateX(0.5rem); }
}
.search-input.shake {
    animation: shake 0.4s ease;
}

/* Search button */
.search-btn {
    height: 3.5rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    white-space: nowrap;
}
.search-btn .btn-content,
.search-btn .btn-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.search-btn .btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2.5;
}
.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}
.search-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}
.search-btn.loading {
    cursor: wait;
    opacity: 0.8;
}
.search-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading spinner */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 1s linear infinite;
}
.spinner-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 45;
    animation: dash 1.5s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .search-widget-container { padding: 1.5rem; }
    .search-form { gap: 0.75rem; }
    .guest-dropdown { right: 0; left: auto; min-width: 18rem; }
}
@media (max-width: 768px) {
    .enhanced-search-widget { padding: 0.5rem; }
    .search-widget-container { padding: 1rem; border-radius: 1rem; }
    .search-input { height: 3rem; font-size: 0.875rem; }
    .search-btn { height: 3rem; font-size: 0.9375rem; width: 100%; }
    .guest-dropdown { left: 0; right: 0; min-width: auto; }
    .child-ages-grid { grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr)); }
}
