/* Search Form Styles for v2.5 */

.search-events {
    width: 100%;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-out;
    position: fixed;
    top: var(--header-height); /* Position right below the header */
    left: 0;
    right: 0;
    z-index: 999; /* Below the fixed header but above other content */
}

.search-events.active {
    height: 80px; /* Set to actual content height */
}

.search {
    height: 80px;
    background-color: #1a1a1a;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search > *:not(:first-child) {
    margin-left: 2.5rem;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    height: 4rem;
}

.search .search-input {
    width: 100%;
    height: 100%;
    font-size: 1.4rem;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.3rem;
    padding: 0 3rem 0 1rem; /* Right padding for close button */
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search .search-input::placeholder {
    opacity: 1;
    color: rgba(255, 255, 255, 0.5);
}

.search .search-input:focus::placeholder {
    opacity: 0;
    color: transparent;
}

.search .search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--primary, #FFAC4E);
    box-shadow: 0 0 0 2px rgba(255, 172, 78, 0.2);
}

/* Search Close Button */
.search-close-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem; /* Position inside the input wrapper */
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.search-filter {
    display: flex;
    align-items: center;
}

.search-filter > *:not(:last-child) {
    margin-right: 1.5rem;
}

.search-filter p {
    font-size: 1.2rem;
    color: white;
    white-space: nowrap;
}

/* Select2 Dropdown Styling */
.search-filter .select2-container {
    width: 100% !important;
    min-width: 12rem;
}

.search-filter .select2-container--default .select2-selection--single {
    height: 4rem;
    border-radius: 0.4rem;
    border: 0;
    background: #333 !important;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.search-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
    display: block;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 0 1rem;
    line-height: 4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-filter .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-filter .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 4rem;
    right: 1rem;
    top: 0;
}

.search-filter .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: rgba(255, 255, 255, 0.5) transparent transparent transparent;
}

.search-filter .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent rgba(255, 255, 255, 0.5) transparent;
}

/* Dropdown menu styling */
.select2-dropdown {
    background: #333;
    border: 1px solid #444;
    border-radius: 0.4rem;
    z-index: 1000;
}

.select2-dropdown .select2-results__options {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #333;
}

.select2-dropdown .select2-results__options::-webkit-scrollbar {
    width: 8px;
}

.select2-dropdown .select2-results__options::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.select2-dropdown .select2-results__options::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.select2-dropdown .select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.select2-dropdown .select2-results__option {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1rem;
    font-size: 1.2rem;
}

.select2-dropdown .select2-results__option--highlighted {
    background: var(--primary, #FFAC4E);
    color: white;
}

.select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #555;
    color: white;
}

/* Clear button styling */
.search-filter .select2-container--default .select2-selection--single .select2-selection__clear {
    color: rgba(255, 255, 255, 0.5);
    float: right;
    margin-right: 2rem;
    font-size: 1.2rem;
}

.search-filter button {
    background: var(--gradient-horizontal-primary, linear-gradient(to right, #ffac4e 0%, #fe4e66 100%));
    border: none;
    border-radius: 0.4rem;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.search-filter button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.search-filter button img {
    filter: brightness(0) invert(1);
    width: 24px !important;
    height: 24px !important;
    max-width: 24px;
    max-height: 24px;
}

/* Search toggle active state */
.search-toggle.active {
    opacity: 0.7;
}

/* Responsive styles */
@media (width < 1200px) {
    .search-events.active {
        height: 180px; /* More height needed on mobile for column layout */
    }
    
    .search {
        flex-direction: column;
        padding: 1rem 2rem;
        height: 180px;
        justify-content: flex-start;
        position: relative;
    }
    
    .search-input-wrapper {
        width: 100%;
        margin-bottom: 1rem;
        height: 4rem;
    }
    
    .search .search-input {
        width: 100%;
        height: 100%;
        padding: 0 3rem 0 1rem;
    }
    
    .search-filter {
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .search-filter p {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }
    
    .search-filter .select2-container {
        flex: 1;
        min-width: calc(50% - 0.5rem);
    }
    
    .search-filter button {
        min-width: 60px;
        height: 40px;
    }
    
    .search-close-btn {
        right: 0.5rem;
        font-size: 1.5rem;
    }
    
    .search > *:not(:first-child) {
        margin-left: 0;
    }
}

@media (width < 768px) {
    .search-events.active {
        height: 220px; /* Even more height needed for mobile column layout */
    }
    
    .search {
        height: 220px;
        padding: 1rem;
    }
    
    .search-input-wrapper {
        height: 3rem;
        margin-bottom: 1rem;
    }
    
    .search .search-input {
        height: 100%;
        font-size: 1rem;
        padding: 0 2.5rem 0 1rem;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    
    .search-filter p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .search-filter .select2-container {
        width: 100%;
        min-width: auto;
    }
    
    .search-filter .select2-container--default .select2-selection--single {
        height: 3rem;
    }
    
    .search-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 3rem;
        font-size: 1rem;
    }
    
    .search-filter .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 3rem;
    }
    
    .search-filter button {
        width: 100%;
        height: 3rem;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .search-close-btn {
        right: 0.3rem;
        font-size: 1.3rem;
        padding: 0.3rem;
    }
}

@media (width < 480px) {
    .search-events.active {
        height: 240px;
    }
    
    .search {
        height: 240px;
        padding: 0.8rem;
    }
    
    .search-input-wrapper {
        height: 2.8rem;
    }
    
    .search .search-input {
        height: 100%;
        font-size: 0.9rem;
        padding: 0 2.5rem 0 1rem;
    }
    
    .search-filter p {
        font-size: 0.8rem;
    }
    
    .search-filter .select2-container--default .select2-selection--single {
        height: 2.8rem;
    }
    
    .search-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 2.8rem;
        font-size: 0.9rem;
        padding: 0 0.8rem;
    }
    
    .search-filter .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 2.8rem;
        right: 0.8rem;
    }
    
    .search-filter button {
        height: 2.8rem;
        font-size: 0.8rem;
    }
}