/*================================================
Enhanced Search Overlay CSS - Additional Styles
Add these to your existing style.css file
=================================================*/

/* Search Input Enhancements */
.search-overlay .input-search {
    font-size: 18px;
    padding: 15px 110px 15px 25px;
    height: 60px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.search-overlay .input-search::placeholder {
    color: #999;
    font-weight: 400;
}

.search-overlay button[type="submit"] {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-overlay button[type="submit"]:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(42, 150, 255, 0.4);
}

/* Accessibility Improvements */
.search-overlay .input-search:focus {
    outline: 3px solid var(--mainColor);
    outline-offset: 2px;
}

.search-overlay button:focus {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.search-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Transitions */
.search-suggestions,
.recent-searches {
    will-change: opacity, transform;
}

/* No Results State */
.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.search-no-results i {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 20px;
    display: block;
}

.search-no-results h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 20px;
}

.search-no-results p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Popular Searches Badge */
.suggestion-popular {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #ff6b6b;
    font-weight: 600;
}

.suggestion-popular i {
    animation: pulse 2s ease-in-out infinite;
}

/* Improved Accessibility for Screen Readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Enhanced Mobile Experience */
@media (max-width: 576px) {
    .search-overlay .input-search {
        font-size: 16px;
        padding: 12px 90px 12px 20px;
        height: 50px;
    }

    .search-overlay button[type="submit"] {
        height: 50px;
        width: 50px;
    }

    .clear-search {
        right: 60px !important;
        font-size: 20px !important;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .quick-link-item {
        padding: 15px;
    }

    .quick-link-item i {
        font-size: 28px;
    }

    .search-suggestions,
    .recent-searches {
        max-height: 250px;
        font-size: 14px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .search-suggestions,
    .recent-searches {
        background: #2d2d2d;
        color: #ffffff;
    }

    .suggestions-list li:hover,
    .suggestions-list li.active {
        background: #3d3d3d;
    }

    .suggestions-footer {
        background: #252525;
        color: #999;
    }

    .recent-header {
        border-bottom-color: #3d3d3d;
    }
}

/* Print Styles */
@media print {
    .search-overlay {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .search-overlay .input-search {
        border: 2px solid currentColor;
    }

    .search-suggestions,
    .recent-searches {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .search-overlay *,
    .search-suggestions,
    .recent-searches,
    .quick-link-item {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible (Better Keyboard Navigation) */
.search-overlay button:focus-visible,
.suggestions-list li:focus-visible,
.recent-list li:focus-visible {
    outline: 3px solid var(--mainColor);
    outline-offset: 2px;
}

/* Loading State for Button */
.default-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.default-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Search Overlay Animation Improvements */
.search-overlay.active {
    animation: overlayFadeIn 0.4s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Suggestion Highlight Animation */
.suggestions-list li.highlight {
    animation: highlightPulse 0.5s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(42, 150, 255, 0.1);
    }
}

/* Better Touch Targets for Mobile */
@media (hover: none) and (pointer: coarse) {
    .suggestions-list li,
    .recent-list li,
    .quick-link-item {
        min-height: 44px;
        padding: 15px 20px;
    }

    .clear-recent-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px;
    }
}

/* Error State Styling */
.search-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 15px 20px;
    margin-top: 15px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-error i {
    font-size: 24px;
    color: #ffc107;
}

/* Empty State Styling */
.search-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    margin-top: 20px;
}

.search-empty-state i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

.search-empty-state h4 {
    color: var(--blackColor);
    margin-bottom: 10px;
    font-size: 18px;
}

.search-empty-state p {
    color: var(--optionalColor);
    font-size: 14px;
}

/* Tooltip for Search Tips */
.search-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-tooltip.show {
    opacity: 1;
}

.search-tooltip::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(0, 0, 0, 0.8);
}
