/* Hero section with search overlay */
.hero-with-search { 
    position: relative; 
    padding-bottom: 0;
    margin-bottom: 0;
    min-height: 600px; /* Ensure minimum height for proper positioning */
}

.hero-with-search .hero-slider-active-2 {
    height: 100%;
/*    min-height: 600px;*/
}

.hero-search-wrapper {
    position: absolute;
    bottom: 50px; /* Overlays bottom of hero */
    left: 0;
    right: 0;
    /*z-index: 1000;*/ /* High z-index to ensure it stays on top of subsequent sections */
    width: 100%;
}

/* Reduce hero heading sizes and margins */
.hero-with-search .hero-content h4 {
    font-size: 16px !important;
    margin-bottom: 8px !important;
    margin-top: 20px !important;
}

.hero-with-search .hero-content h2 {
    font-size: 42px !important;
    margin-bottom: 15px !important;
    line-height: 1.2 !important;
    color: white;
}

.hero-with-search .hero-button {
    margin-top: 10px !important;
}

.hero-search-box {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin: 0 15px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    overflow: visible; /* Allow suggestions dropdown to overflow */
    position: relative;
    /*z-index: 1050;*/ /* Higher than wrapper to ensure proper stacking */
}

.search-title {
    font-size: 20px;
    font-weight: 700;
    color: #16171A;
    margin-bottom: 15px;
    text-align: center;
}

/* Search form styling */
.search-form {
    overflow: visible; /* Allow suggestions dropdown to overflow */
    position: relative;
}

.search-form .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-form .form-control,
.search-form .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    background-color: #fff !important;
}

/* Override Bootstrap's select styling completely */
.search-form select.form-select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    background-color: #fff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #212529 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
}

/* Custom dropdown arrow for select elements */
.search-form .form-select {
    display: block !important; /* Ensure select is visible */
    visibility: visible !important; /* Force visibility */
    opacity: 1 !important; /* Ensure opacity */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px 12px !important;
    padding-right: 40px !important; /* Add space for arrow */
    text-overflow: ellipsis; /* Handle long text */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow text */
}

/* Force visibility for specific select elements */
#countryFilter,
#degreeLevelFilter {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide Nice Select elements that are interfering */
.nice-select {
    display: none !important;
}

/* Specifically hide Nice Select elements in search form */
.search-form .nice-select {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Ensure our select elements are not affected by Nice Select */
.search-form select.no-nice-select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure original select elements are visible and functional */
.search-form select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Completely override Bootstrap select styling */
.search-form select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    background-color: #fff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #212529 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Add custom arrow only after removing all Bootstrap styling */
.search-form select:not([multiple]) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px 12px !important;
    padding-right: 40px !important;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: #ED2057;
    box-shadow: 0 0 0 0.2rem rgba(237, 32, 87, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ED2057' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px 12px !important;
}

.search-btn {
    background: #ED2057;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    height: 100%;
}

.search-btn:hover {
    background: #c4082e;
    transform: translateY(-1px);
}

/* Autocomplete suggestions dropdown */
.search-input-wrapper { 
    position: relative;
    /*z-index: 1100;*/ /* Establish stacking context - higher than search box */
}

.search-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 10000 !important; /* Very high z-index to ensure it appears on top of everything */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 2px;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-type {
    font-size: 11px;
    color: #ED2057;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.suggestion-name {
    font-size: 14px;
    color: #16171A;
    font-weight: 500;
    margin-bottom: 2px;
}

.suggestion-subinfo {
    font-size: 12px;
    color: #888;
}

/* Loading state */
.search-loading {
    padding: 12px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-loading i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 991px) {
    .hero-with-search {
        padding-bottom: 0;
    }
    .hero-search-wrapper { 
        bottom: -60px; 
    }
    .hero-search-box { 
        padding: 20px; 
        margin: 0 10px;
    }
    .search-title { 
        font-size: 18px; 
    }
    .hero-with-search .hero-content h2 {
        font-size: 28px !important;
    }
}

@media (max-width: 767px) {
    .hero-with-search {
        padding-bottom: 0;
    }
    .hero-search-wrapper { 
        position: relative;
        bottom: 0;
        margin-top: 20px;
    }
    .hero-search-box {
        margin: 0;
        border-radius: 0;
        padding: 20px 15px;
    }
    .search-btn { 
        margin-top: 10px; 
    }
    .search-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    .hero-with-search .hero-content h2 {
        font-size: 24px !important;
    }
    .hero-with-search .hero-content h4 {
        font-size: 14px !important;
    }
}

@media (max-width: 575px) {
    .hero-search-box {
        padding: 15px;
    }
    .search-form .form-control,
    .search-form .form-select {
        padding: 10px 12px;
        font-size: 13px;
    }
    .search-form .form-select {
        padding-right: 35px; /* Adjust for smaller screens */
    }
    .search-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
