/* Enhanced Search Styles */

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    margin-top: 0;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid var(--gray-200);
}

.autocomplete-header {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 14px;
}

.autocomplete-group {
    padding: 8px 0;
}

.autocomplete-type {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-100);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--gray-50);
}

.autocomplete-item i {
    margin-right: 12px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.autocomplete-item span {
    flex: 1;
    color: var(--gray-800);
}

/* History Dropdown */
.history-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    margin-top: 0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid var(--gray-200);
}

.history-header {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 14px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-100);
    position: relative;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--gray-50);
}

.history-item i {
    margin-right: 12px;
    color: var(--gray-400);
    width: 20px;
}

.history-item span {
    flex: 1;
    color: var(--gray-800);
}

.history-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    opacity: 0;
}

.history-item:hover .history-remove {
    opacity: 1;
}

.history-remove:hover {
    background: var(--gray-200);
    color: var(--danger-color);
}

/* Trending Searches Display */
.trending-searches-display {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 16px;
    z-index: 999;
    border: 1px solid var(--gray-200);
    margin-top: 0;
    margin-bottom: 0;
    overflow: visible;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.trending-header {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    font-size: 14px;
}

.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
    width: 100%;
    max-width: 100%;
}

.trending-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--border-radius-full);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    flex-shrink: 0;
    word-break: keep-all;
}

.trending-tag:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Advanced Search Button */
.advanced-search-btn,
.voice-search-btn {
    position: absolute;
    right: 72px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0px;
    background: linear-gradient(135deg, var(--secondary-600, #059669) 0%, var(--secondary-700, #047857) 100%);
    border: 2px solid white;
    color: var(--white);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 7;
    opacity: 1;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3),
                0 1px 2px rgba(0, 0, 0, 0.1);
}

.advanced-search-btn {
    right: 128px;
}

.voice-search-btn {
    right: 72px;
}

.animated-search-container.focused .advanced-search-btn,
.animated-search-container.focused .voice-search-btn,
.animated-search-container:hover .advanced-search-btn,
.animated-search-container:hover .voice-search-btn {
    opacity: 1;
    pointer-events: all;
}

.advanced-search-btn:hover,
.voice-search-btn:hover {
    background: linear-gradient(135deg, var(--secondary-700, #047857) 0%, var(--secondary-600, #059669) 100%);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.15);
}

.advanced-search-btn:active,
.voice-search-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.advanced-search-btn i,
.voice-search-btn i {
    font-size: 18px;
    color: white;
}

.voice-search-btn.active {
    background: var(--danger-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Advanced Search Modal */
.advanced-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 20px;
    overflow-y: auto;
}

.advanced-search-modal-content {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.advanced-search-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.advanced-search-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    width: 100%;
}

.advanced-search-header h2 i {
    color: var(--primary-color);
    font-size: 22px;
}

.advanced-search-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.advanced-search-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.advanced-search-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.search-field-group {
    margin-bottom: 20px;
}

.search-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.search-field-group input,
.search-field-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}

.search-field-group input:focus,
.search-field-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.salary-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.salary-range input {
    flex: 1;
}

.salary-range span {
    color: var(--gray-500);
    font-size: 14px;
}

.advanced-search-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--gray-200);
}

.advanced-search-footer .btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
    .autocomplete-dropdown,
    .history-dropdown,
    .trending-searches-display {
        max-width: 100%;
    }
    
    .advanced-search-modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .advanced-search-header h2 {
        font-size: 20px;
    }
    
    .advanced-search-body {
        padding: 16px;
    }
    
    .advanced-search-footer {
        padding: 16px;
        flex-direction: column;
    }
    
    .advanced-search-footer .btn {
        width: 100%;
    }
    
    /* Adjust button positioning on mobile */
    .advanced-search-btn {
        right: 104px;
        width: 40px;
        height: 40px;
    }
    
    .voice-search-btn {
        right: 56px;
        width: 40px;
        height: 40px;
    }
    
    .advanced-search-btn,
    .voice-search-btn {
        margin-top: 0px;
    }
    
    .advanced-search-btn i,
    .voice-search-btn i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .advanced-search-btn,
    .voice-search-btn {
        margin-top: 0px;
    }
}

/* Scrollbar styling for dropdowns */
.autocomplete-dropdown::-webkit-scrollbar,
.history-dropdown::-webkit-scrollbar,
.advanced-search-modal-content::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track,
.history-dropdown::-webkit-scrollbar-track,
.advanced-search-modal-content::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb,
.history-dropdown::-webkit-scrollbar-thumb,
.advanced-search-modal-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover,
.history-dropdown::-webkit-scrollbar-thumb:hover,
.advanced-search-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

