/**
 * Search Box & Form Enhancements
 * Modern, accessible search and form components
 */

/* ========================================================================
   Hero Search Box
   ======================================================================== */

.main-wrapper .hero-search-wrapper {
    position: relative;
    z-index: 10;
}

.main-wrapper .search-box-v2 {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid #E5E7EB;
}

.main-wrapper .search-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
}

/* ========================================================================
   Search Fields
   ======================================================================== */

.main-wrapper .search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.main-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    color: #9CA3AF;
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 2;
}

.main-wrapper .search-input,
.main-wrapper .search-select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827 !important;
    background: #F9FAFB;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

.main-wrapper .search-input:focus,
.main-wrapper .search-select:focus {
    background: #ffffff;
    border-color: #4F46E5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.main-wrapper .search-input::placeholder {
    color: #9CA3AF !important;
    font-weight: 400;
}

/* Nice Select Overrides */
.main-wrapper .search-field .nice-select {
    background: #F9FAFB !important;
    border: 2px solid transparent !important;
    padding-left: 3rem !important;
    height: auto !important;
    line-height: 1.5 !important;
    font-size: 0.9375rem !important;
    color: #111827 !important;
}

.main-wrapper .search-field .nice-select:hover,
.main-wrapper .search-field .nice-select:focus,
.main-wrapper .search-field .nice-select.open {
    border-color: #4F46E5 !important;
    background: #ffffff !important;
}

.main-wrapper .search-field .nice-select .current {
    color: #111827 !important;
}

.main-wrapper .search-field .nice-select .list {
    background: #ffffff;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
}

.main-wrapper .search-field .nice-select .option {
    color: #6B7280 !important;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.main-wrapper .search-field .nice-select .option:hover,
.main-wrapper .search-field .nice-select .option.focus,
.main-wrapper .search-field .nice-select .option.selected {
    background: #F3F4F6 !important;
    color: #111827 !important;
}

/* ========================================================================
   Search Button
   ======================================================================== */

.main-wrapper .search-btn {
    padding: 0.875rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.main-wrapper .search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
    color: #ffffff !important;
}

.main-wrapper .search-btn:active {
    transform: translateY(0);
}

/* ========================================================================
   Popular Searches
   ======================================================================== */

.main-wrapper .popular-searches {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.main-wrapper .popular-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6B7280;
}

.main-wrapper .popular-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #F9FAFB;
    color: #4B5563 !important;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.main-wrapper .popular-tag:hover {
    background: #4F46E5;
    color: #ffffff !important;
    border-color: #4F46E5;
    transform: translateY(-2px);
    text-decoration: none;
}

/* ========================================================================
   Responsive Search Box
   ======================================================================== */

@media (max-width: 992px) {
    .main-wrapper .search-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.875rem;
    }
    
    .main-wrapper .search-field:first-child {
        grid-column: 1 / -1;
    }
    
    .main-wrapper .search-btn {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .main-wrapper .search-grid {
        grid-template-columns: 1fr;
    }
    
    .main-wrapper .search-box-v2 {
        padding: 1.25rem;
    }
    
    .main-wrapper .search-input,
    .main-wrapper .search-select,
    .main-wrapper .search-field .nice-select {
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
        font-size: 0.875rem;
    }
    
    .main-wrapper .search-icon {
        left: 0.875rem;
        font-size: 1rem;
    }
    
    .main-wrapper .search-btn {
        padding: 0.875rem 1.5rem;
    }
    
    .main-wrapper .popular-searches {
        margin-top: 1rem;
    }
    
    .main-wrapper .popular-tag {
        padding: 0.375rem 0.875rem;
        font-size: 0.8125rem;
    }
}

/* ========================================================================
   Select2 Enhancements (if used)
   ======================================================================== */

.main-wrapper .select2-container--default .select2-selection--single {
    background: #F9FAFB;
    border: 2px solid transparent;
    border-radius: 12px;
    height: auto;
    padding: 0.875rem 1rem 0.875rem 3rem;
}

.main-wrapper .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #4F46E5;
    background: #ffffff;
}

.main-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #111827;
    line-height: 1.5;
    padding: 0;
}

.main-wrapper .select2-dropdown {
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.main-wrapper .select2-results__option {
    padding: 0.75rem 1rem;
    color: #6B7280;
}

.main-wrapper .select2-results__option--highlighted {
    background: #F3F4F6 !important;
    color: #111827 !important;
}

/* ========================================================================
   Form Validation States
   ======================================================================== */

.main-wrapper .form-control.is-invalid,
.main-wrapper .search-input.is-invalid {
    border-color: #EF4444 !important;
}

.main-wrapper .form-control.is-invalid:focus,
.main-wrapper .search-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.main-wrapper .form-control.is-valid,
.main-wrapper .search-input.is-valid {
    border-color: #10B981 !important;
}

.main-wrapper .form-control.is-valid:focus,
.main-wrapper .search-input.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.main-wrapper .invalid-feedback,
.main-wrapper .error-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #EF4444;
}

.main-wrapper .valid-feedback,
.main-wrapper .success-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #10B981;
}
