/**
 * WTD Search Styles
 * OS 31/Dec
 * Monochromatic, minimalist search overlay
 */

/* Search Toggle Button */
.wtd-search-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #000;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wtd-search-toggle:hover {
    opacity: 0.7;
} 
.wtd-search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Search Overlay */
.wtd-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 236, 232, 0.98);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wtd-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Container */
.wtd-search-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    height: 100%;
    overflow-y: auto;
}

/* Close Button */
.wtd-search-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #000;
    transition: opacity 0.3s ease;
}

.wtd-search-close:hover {
    opacity: 0.6;
}

/* Search Inner */
.wtd-search-inner {
    margin-top: 100px;
}

/* Search Form */
.wtd-search-form {
    position: relative;
    margin-bottom: 40px;
}

/* Search Input */
.wtd-search-input {
    width: 100%;
    padding: 20px 0;
    font-size: 2.5rem;
    font-family: 'biennale', Georgia, serif;
    font-weight: 300;
    background: none;
    border: none;
    border-bottom: 2px solid #ddd;
    outline: none;
    transition: border-color 0.3s ease;
    color: #2a2a2a;
}

.wtd-search-input:focus {
    border-bottom-color: #999;
}

.wtd-search-input::placeholder {
    color: #999;
    opacity: 0.6;
}

/* Search Suggestions */
.wtd-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    z-index: 100;
}

.wtd-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wtd-suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'manrope', -apple-system, sans-serif;
    font-size: 1rem;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.wtd-suggestion-item:last-child {
    border-bottom: none;
}

.wtd-suggestion-item:hover,
.wtd-suggestion-item.selected {
    background-color: #f8f8f8;
    color: #000;
}

/* Search Filters */
.wtd-search-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    font-family: 'manrope', -apple-system, sans-serif;
}

.wtd-filter-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: #999;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    text-transform: lowercase;
}

.wtd-filter-btn:hover {
    color: #666;
}

.wtd-filter-btn.active {
    color: #000;
}

.wtd-filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: #000;
}

/* Search Results */
.wtd-search-results {
    min-height: 300px;
}

.wtd-search-empty,
.wtd-search-loading,
.wtd-search-error {
    text-align: center;
    padding: 60px 20px;
    font-family: 'manrope', -apple-system, sans-serif;
    color: #999;
}

.wtd-search-empty p,
.wtd-search-error p {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Loading Spinner */
.wtd-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #f0f0f0;
    border-top-color: #666;
    border-radius: 50%;
    animation: wtd-spin 0.8s linear infinite;
}

@keyframes wtd-spin {
    to { transform: rotate(360deg); }
}

/* Results List */
.wtd-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Result Item */
.wtd-search-result {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wtd-search-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wtd-search-result.wtd-result-restricted {
    opacity: 0.7;
}

.wtd-search-result.wtd-result-restricted::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

/* Result Icon */
.wtd-result-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-radius: 8px;
    color: #666;
}

.wtd-result-icon svg {
    width: 20px;
    height: 20px;
}

/* Result Content */
.wtd-result-content {
    flex: 1;
    min-width: 0;
}

.wtd-result-title {
    font-family: 'biennale', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 300;
    margin: 0 0 8px 0;
    color: #000;
}

.wtd-result-title mark {
    background: rgba(255, 220, 0, 0.3);
    color: inherit;
    padding: 0 2px;
}

.wtd-result-excerpt {
    font-family: 'manrope', -apple-system, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin: 0 0 12px 0;
}

/* Result Meta */
.wtd-result-meta {
    display: flex;
    gap: 16px;
    font-family: 'manrope', -apple-system, sans-serif;
    font-size: 0.8rem;
    color: #999;
}

.wtd-result-type {
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.wtd-result-lock {
    font-size: 0.9rem;
}

/* Pagination */
.wtd-search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    font-family: 'manrope', -apple-system, sans-serif;
}

.wtd-page-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    text-transform: lowercase;
}

.wtd-page-btn:hover {
    color: #000;
}

.wtd-page-info {
    color: #999;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 768px) {
    .wtd-search-container {
        padding: 20px;
    }
    
    .wtd-search-close {
        top: 20px;
        right: 20px;
    }
    
    .wtd-search-inner {
        margin-top: 60px;
    }
    
    .wtd-search-input {
        font-size: 1.8rem;
        padding: 15px 0;
    }
    
    .wtd-search-filters {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .wtd-filter-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .wtd-search-result {
        padding: 15px;
    }
    
    .wtd-result-title {
        font-size: 1.1rem;
    }
    
    .wtd-result-excerpt {
        font-size: 0.85rem;
    }
}

/* Mobile Menu Search Icon */
@media (max-width: 768px) {
    .nav-section.search-mobile {
        margin-top: 20px;
    }
    
    .nav-section.search-mobile a {
        display: flex;
        align-items: center;
        gap: 10px;
    }
} 