/* 
 * 增强型全局搜索弹窗样式 (Search Pro Max Edition)
 * ----------------------------------------------------
 * 设计方案：Cyberpunk x Glassmorphism
 */

#global-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-index-modal);
    display: none;
    /* Controlled by .active */
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#global-search-modal.active {
    display: flex;
}

.search-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: -1;
}

.search-container {
    width: 100%;
    max-width: 700px;
    background: var(--search-glass);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--search-border);
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    animation: modal-enter 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Digital Scanline Effect */
.search-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg,
            rgba(255, 0, 0, 0.02),
            rgba(0, 255, 0, 0.01),
            rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.3;
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* Header & Input */
.search-header {
    padding: 30px 40px 10px;
    position: relative;
    border-bottom: 1px solid var(--low-border, rgba(255, 255, 255, 0.05));
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--search-border);
    color: var(--lw-text);
    font-size: 1.5rem;
    padding: 15px 0;
    outline: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-bottom-color: var(--search-glow);
    text-shadow: 0 0 10px var(--search-border);
}

.search-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--lw-border);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff4444;
}

/* Results Content */
.search-results {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px 40px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--search-border) transparent;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--search-border);
    border-radius: 10px;
}

/* Placeholder */
.search-placeholder,
.search-no-results {
    text-align: center;
    padding: 60px 0;
    color: var(--lw-text-muted);
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.quick-tags span {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--lw-border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-tags span:hover {
    border-color: var(--search-glow);
    background: rgba(255, 170, 0, 0.1);
    color: var(--search-glow);
}

/* Result Groups & Items */
.search-result-group {
    margin-bottom: 30px;
}

.group-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--search-glow);
    margin-bottom: 15px;
    opacity: 0.8;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--search-border);
    transform: translateX(5px);
}

.result-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    margin-right: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.result-thumb-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--lw-text-muted);
    flex-shrink: 0;
}

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

.result-type {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.result-info h4 {
    margin: 0;
    color: var(--lw-text);
    font-size: 1rem;
}

.result-info p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--lw-text-muted);
}

.result-action {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--search-glow);
}

.search-result-item:hover .result-action {
    opacity: 1;
    transform: translateX(0);
}

/* Light Mode Polish */
body.light-mode .search-container {
    background: var(--search-glass);
    border-color: var(--search-border);
}

body.light-mode .search-result-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 768px) {
    .search-container {
        max-width: 95vw;
    }

    .search-header {
        padding: 20px 20px 10px;
    }

    .search-results {
        padding: 10px 20px 20px;
    }

    .search-input {
        font-size: 1.2rem;
    }
}