/* Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-in-out;
}

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

.search-overlay-content {
    min-height: 100vh;
}

.search-overlay-header {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.search-overlay-header h3 {
    color: white;
    font-weight: 600;
}

.search-input-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper input {
    padding-left: 3.5rem;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: var(--bg-secondary);
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.search-input-wrapper input:focus {
    border-color: #fff;
    background: var(--bg-secondary);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.search-input-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: #6c757d;
    pointer-events: none;
}

.search-overlay-body {
    padding: 2rem 0;
    min-height: 60vh;
}

/* Loading Spinner */
.search-loading {
    text-align: center;
    padding: 3rem 0;
    color: white;
}

.search-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Search Results */
.search-results-section {
    margin-bottom: 2rem;
}

.search-results-section h4 {
    color: white;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 1.3rem;
}

.search-results-count {
    color: #FF6B6B;
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Category Results */
.category-result-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.category-result-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.category-result-item a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-result-item h5 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-result-item .badge {
    font-size: 0.9rem;
}

.category-result-item i.bi-arrow-right {
    font-size: 1.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.category-result-item:hover i.bi-arrow-right {
    opacity: 1;
    transform: translateX(5px);
}

/* Site Results */
.site-result-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.site-result-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.site-result-item a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-result-favicon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.site-result-favicon img {
    max-width: 32px;
    max-height: 32px;
    border-radius: 4px;
}

.site-result-info {
    flex-grow: 1;
}

.site-result-info h6 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.site-result-category {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.site-result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.site-result-arrow {
    font-size: 1.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.site-result-item:hover .site-result-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* No Results */
.search-no-results {
    text-align: center;
    padding: 3rem 0;
    color: rgba(255, 255, 255, 0.7);
}

.search-no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Placeholder */
.search-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-placeholder i {
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
    .search-overlay-header {
        padding: 1.5rem 0;
    }

    .search-input-wrapper input {
        font-size: 1rem;
    }

    .site-result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .category-result-item,
    .site-result-item {
        padding: 1rem;
    }
}

/* Keyboard shortcut hint */
.search-keyboard-hint {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.search-keyboard-hint kbd {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    margin: 0 0.25rem;
}

/* ========================================
   LIGHT MODE STYLES
   ======================================== */

body[data-theme="light"] .search-overlay {
    background: rgba(255, 255, 255, 0.98);
}

/* Input */
body[data-theme="light"] .search-input-wrapper input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: #212529;
}

body[data-theme="light"] .search-input-wrapper input:focus {
    background: #fff;
    border-color: #FF6B6B;
    color: #212529;
}

body[data-theme="light"] .search-input-icon {
    color: #495057;
}

/* Loading */
body[data-theme="light"] .search-loading {
    color: #212529;
}

body[data-theme="light"] .search-loading .spinner-border {
    color: #FF6B6B !important;
}

body[data-theme="light"] .search-loading p {
    color: #495057;
}

/* Results Sections */
body[data-theme="light"] .search-results-section h4 {
    color: #212529;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .search-results-count {
    color: #fff;
    background: #FF6B6B;
}

/* Category Results */
body[data-theme="light"] .category-result-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .category-result-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .category-result-item a {
    color: #212529;
}

body[data-theme="light"] .category-result-item i.bi-arrow-right {
    color: #6c757d;
}

/* Site Results */
body[data-theme="light"] .site-result-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .site-result-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .site-result-item a {
    color: #212529;
}

body[data-theme="light"] .site-result-favicon {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .site-result-category {
    color: #6c757d;
}

body[data-theme="light"] .site-result-arrow {
    color: #6c757d;
}

/* No Results */
body[data-theme="light"] .search-no-results {
    color: #495057;
}

body[data-theme="light"] .search-no-results i {
    color: #6c757d;
}

body[data-theme="light"] .search-no-results h4 {
    color: #212529;
}

body[data-theme="light"] .search-no-results p {
    color: #495057;
}

body[data-theme="light"] .search-no-results .text-muted {
    color: #6c757d !important;
}

/* Placeholder */
body[data-theme="light"] .search-placeholder {
    color: #6c757d;
}

body[data-theme="light"] .search-placeholder i {
    color: #adb5bd;
}

body[data-theme="light"] .search-placeholder p {
    color: #6c757d;
}

/* Keyboard Hint */
body[data-theme="light"] .search-keyboard-hint {
    background: rgba(0, 0, 0, 0.05);
    color: #212529;
}

body[data-theme="light"] .search-keyboard-hint kbd {
    background: rgba(0, 0, 0, 0.1);
    color: #212529;
}
