/**
 * Search Toggle Component Styles
 *
 * Styles for the search toggle button and search form
 */

/* Header controls layout */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search icon wrapper */
.search-icon-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

/* Search button */
#search-toggle-button {
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* White search icon in light mode for better contrast with header background */
body.light-mode #search-toggle-button {
    color: white;
}

@media (prefers-color-scheme: light) {
    #search-toggle-button {
        color: white;
    }
}

#search-toggle-button:hover {
    transform: scale(1.1);
    color: #fcd00aff;
}

/* Remove default focus outline on mouse click */
#search-toggle-button:focus {
    outline: none !important;
}

/* Apply gold outline only when focused with keyboard */
#search-toggle-button:focus-visible {
    outline: 2px solid #fcd00aff;
    outline-offset: 2px;
}

/* Search form container */
.search-form-container {
    position: absolute;
    top: 100%;
    left: -80px; /* Adjust to better center the search form */
    width: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    margin-top: 10px;
    background-color: transparent;
    border-radius: 4px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    visibility: hidden;
    transform: translateY(-10px);
}

.search-form-container.active {
    width: 300px;
    max-height: 50px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-form {
    display: flex;
    padding: 0;
    width: 300px; /* Fixed width to match the expanded container */
    box-sizing: border-box;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #333;
    background-color: var(--color-background-primary);
}

/* Make search form wider on larger screens */
@media (min-width: 768px) {
    .search-form-container.active {
        width: 320px;
        max-height: 50px;
    }
    
    .search-form {
        width: 320px;
    }
}

/* Make search form narrower on smaller screens */
@media (max-width: 767px) {
    .search-form-container.active {
        width: 260px;
        max-height: 50px;
    }
    
    .search-form {
        width: 260px;
    }
    
    .search-form-container {
        left: -70px; /* Adjust position on mobile */
    }
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 0;
    background-color: var(--color-background-primary);
    color: var(--color-text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    height: 40px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
}

.search-submit {
    background-color: var(--color-brand-primary); /* Use brand gold color */
    color: black; /* Better contrast with gold */
    border: none;
    border-radius: 0;
    padding: 0 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Slightly bolder for better visibility */
    height: 40px;
    transition: background-color 0.2s ease;
    min-width: 70px;
    text-align: center;
}

.search-submit:hover {
    background-color: var(--color-brand-secondary); /* Darker gold on hover */
}

/* Responsive styles */
@media (max-width: 768px) {
    .search-form-container.active {
        width: 250px;
    }
    
    .search-form {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .search-form-container.active {
        width: 200px;
    }
    
    .search-form {
        width: 200px;
    }
}
 