/**
 * Search Overlay Styles
 * Full-screen blur overlay with top-left search input
 */

/* Search Overlay Container */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay.active {
    display: flex;
    opacity: 1;
    animation: overlayFadeIn 0.3s ease-out;
}

/* Search Container (Top-left positioning) */
.search-container {
    padding: 3rem;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Close Button */
.search-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--navy);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-close:hover {
    color: var(--primary-blue);
    transform: rotate(90deg);
}

/* Search Input Wrapper */
.search-input-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

/* Search Input - Top Left, Large Font */
.search-input {
    width: 100%;
    max-width: 800px;
    border: none;
    border-bottom: 3px solid var(--primary-blue);
    background: transparent;
    font-size: 3rem;
    font-weight: 300;
    padding: 1rem 0;
    color: var(--navy);
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(0, 102, 204, 0.5);
    font-weight: 300;
}

.search-input:focus {
    border-bottom-width: 4px;
}

/* Search Icon */
.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--primary-blue);
    pointer-events: none;
}

/* Search Results Container */
.search-results {
    margin-top: 2rem;
    max-width: 900px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 1rem;
}

/* Loading Spinner */
.search-loading {
    display: none;
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--primary-blue);
}

.search-loading.active {
    display: block;
}

.search-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

/* No Results Message */
.no-results {
    display: none;
    text-align: center;
    padding: 3rem 0;
    font-size: 1.5rem;
    color: var(--text-dark);
    opacity: 0.6;
}

.no-results.active {
    display: block;
}

/* Search Result Item */
.search-result-item {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.2);
}

.search-result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.search-result-title a {
    color: var(--navy);
    text-decoration: none;
}

.search-result-title a:hover {
    color: var(--primary-blue);
}

.search-result-excerpt {
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.search-result-url {
    font-size: 0.9rem;
    color: var(--primary-blue);
    opacity: 0.8;
}

/* Highlight matched text */
.search-highlight {
    background-color: rgba(0, 102, 204, 0.2);
    font-weight: 600;
    padding: 0 2px;
}

/* Results Count */
.results-count {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

/* Custom Scrollbar for Results */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--navy);
}

/* Animations */
@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-container {
        padding: 2rem 1.5rem;
    }
    
    .search-input {
        font-size: 2rem;
        max-width: 100%;
    }
    
    .search-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
    
    .search-results {
        max-height: calc(100vh - 250px);
    }
    
    .search-result-title {
        font-size: 1.2rem;
    }
    
    .search-result-excerpt {
        font-size: 0.9rem;
    }
}

/* RTL Support */
[dir="rtl"] .search-result-item:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .search-icon {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .search-close {
    right: auto;
    left: 2rem;
}

@media (max-width: 768px) {
    [dir="rtl"] .search-close {
        left: 1rem;
    }
}
