/* ============================================================================
   SEARCH MODAL STYLES
   ============================================================================ */

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 2rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-modal-content {
    width: 100%;
    max-width: 600px;
    background: var(--bg-primary, #1a1a1a);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color, #333);
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.search-modal.active .search-modal-content {
    transform: translateY(0) scale(1);
}

/* Search Header */
.search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #333);
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.search-input-container:focus-within {
    border-color: var(--accent-primary, #00ff88);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.search-icon {
    font-size: 1.2rem;
    padding: 0 1rem;
    color: var(--text-secondary, #cccccc);
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary, #ffffff);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary, #cccccc);
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--bg-hover, #3a3a3a);
    color: var(--text-secondary, #cccccc);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: #ff4444;
    color: white;
}

.search-close-btn {
    background: var(--bg-secondary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    color: var(--text-secondary, #cccccc);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-close-btn:hover {
    background: var(--bg-hover, #3a3a3a);
    color: var(--text-primary, #ffffff);
}

/* Search Body */
.search-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Search Suggestions */
.search-suggestions h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary, #cccccc);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-tag {
    background: var(--bg-secondary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    color: var(--text-primary, #ffffff);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-tag:hover {
    background: var(--accent-primary, #00ff88);
    color: #000;
    border-color: var(--accent-primary, #00ff88);
    transform: translateY(-1px);
}

/* Search Results */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #333);
}

.search-results-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.search-results-count {
    font-size: 0.85rem;
    color: var(--text-secondary, #cccccc);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    background: var(--bg-secondary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    border-color: var(--accent-primary, #00ff88);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.search-result-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    line-height: 1.3;
}

.search-result-title mark {
    background: var(--accent-primary, #00ff88);
    color: #000;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

.search-result-category {
    background: var(--accent-primary, #00ff88);
    color: #000;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    margin-left: 1rem;
}

.search-result-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #cccccc);
    line-height: 1.4;
}

.search-result-description mark {
    background: var(--accent-primary, #00ff88);
    color: #000;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

.search-result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary, #cccccc);
}

.search-result-type {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-result-url {
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.7;
}

/* No Results */
.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary, #cccccc);
}

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

.search-no-results h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-primary, #ffffff);
}

.search-no-results p {
    margin: 0;
    font-size: 0.95rem;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.search-modal.active ~ .search-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Search Toggle Button */
.search-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    color: var(--text-primary, #ffffff);
}

.search-toggle-btn:hover {
    background: var(--bg-hover, #3a3a3a);
}

/* Navigation Search (existing) */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    transition: all 0.3s ease;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
}

.nav-search.active {
    max-width: 300px;
    opacity: 1;
    margin-right: 1rem;
}

.nav-search-input {
    border: none;
    background: none;
    padding: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-primary, #ffffff);
    outline: none;
    width: 250px;
}

.nav-search-input::placeholder {
    color: var(--text-secondary, #cccccc);
}

.nav-search-icon {
    padding: 0 0.75rem;
    color: var(--text-secondary, #cccccc);
    cursor: pointer;
}

.nav-search-icon:hover {
    color: var(--accent-primary, #00ff88);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-modal {
        padding: 5vh 1rem 1rem;
    }
    
    .search-modal-content {
        max-height: 80vh;
    }
    
    .search-header {
        padding: 1rem;
    }
    
    .search-input {
        font-size: 1rem;
    }
    
    .search-suggestion-tags {
        gap: 0.375rem;
    }
    
    .search-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .search-result-item {
        padding: 0.75rem;
    }
    
    .search-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .search-result-category {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .search-modal {
        padding: 2vh 0.5rem 0.5rem;
    }
    
    .search-close-btn {
        display: none;
    }
    
    .search-header {
        padding: 0.75rem;
    }
    
    .search-body {
        padding: 0.75rem;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .search-modal-content {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .search-result-item {
    background: #2a2a2a;
    border-color: #333;
}

[data-theme="dark"] .search-result-item:hover {
    border-color: #00ff88;
}

/* Keyboard Shortcuts Hint */
.search-shortcut-hint {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #cccccc);
    background: var(--bg-secondary, #2a2a2a);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color, #333);
}

/* Animation Classes */
.search-result-item-enter {
    animation: searchResultEnter 0.3s ease-out;
}

@keyframes searchResultEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary, #cccccc);
}

.search-loading::before {
    content: '🔍';
    font-size: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}