/* ============================================
   导航栏搜索功能样式
   ============================================ */

/* 搜索图标按钮 */
.nav-search-toggle {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-search-toggle .search-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    height: 40px !important;
    width: 40px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.nav-search-toggle .search-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary-color) !important;
    transform: scale(1.1);
}

.nav-search-toggle .search-toggle-btn i {
    font-size: 18px;
}

/* 搜索覆盖层 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.search-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 1;
    padding-top: 100px;
    padding-bottom: 50px;
}

/* 搜索容器 */
.search-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索头部 */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: #fff;
}

.search-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.search-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 搜索表单 */
.search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 10px 50px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    padding: 15px 0;
    background: transparent;
    color: var(--text-primary);
    font-weight: 400;
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-submit-btn {
    background: var(--primary-color);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.search-submit-btn:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

.search-submit-btn:active {
    transform: scale(0.95);
}

.search-submit-btn i {
    font-size: 16px;
}

/* 搜索建议 */
.search-suggestions {
    margin-top: 30px;
    display: none;
}

.search-suggestions.show {
    display: block;
}

.suggestions-header {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-item {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 移动端样式 */
@media (max-width: 768px) {
    .search-overlay.active {
        padding-top: 80px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .search-container {
        padding: 0;
    }

    .search-header h3 {
        font-size: 20px;
    }

    .search-input {
        font-size: 16px;
        padding: 12px 0;
    }

    .search-input-wrapper {
        padding: 4px 4px 4px 15px;
    }

    .search-submit-btn {
        width: 44px;
        height: 44px;
    }

    .suggestions-list {
        gap: 8px;
    }

    .suggestion-item {
        padding: 8px 16px;
        font-size: 13px;
    }

    .nav-search-toggle .search-toggle-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .nav-search-toggle .search-toggle-btn i {
        font-size: 16px;
    }
}

/* 移动端导航栏中的搜索按钮 */
@media (max-width: 1199.98px) {
    .nav-search-toggle {
        margin-top: 0;
        border-left: none !important;
        padding-left: 0 !important;
        margin-left: 15px !important;
    }
}
