/* --- ПОИСК (Spotlight Style) --- */

/* Оверлей затемнения */
.search-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Обертка поиска (двигается целиком) */
.search-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Пружинистый эффект */
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

/* Класс для сдвига вверх при наборе текста */
.search-wrapper.shifted {
    top: 20%; /* Поднимаем к верху экрана */
    transform: translate(-50%, 0);
}

/* Поле ввода */
.global-search-input {
    width: 100%;
    padding: 20px 30px;
    font-size: 1.5rem;
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #4cc2ff;
    border-radius: 20px;
    color: white;
    outline: none;
    box-shadow: 0 0 50px rgba(76, 194, 255, 0.3);
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    box-sizing: border-box;
}

/* Контейнер результатов */
.search-results-container {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #4cc2ff;
    border-top: none;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none; /* Скрыт по умолчанию */
}

.search-results-container.has-content {
    display: block;
}

/* Элемент результата */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(76, 194, 255, 0.15);
}

.result-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.result-info h4 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.result-info p {
    margin: 4px 0 0;
    color: #aaa;
    font-size: 0.9rem;
}

/* Сообщение "Ничего не найдено" */
.no-results {
    padding: 40px;
    text-align: center;
    color: #888;
}

.no-results span {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Кнопка закрытия поиска */
.search-close-btn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-60px) scale(0);
    margin-left: 300px; 
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close-btn.active {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-60px) scale(1);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .search-wrapper { width: 95%; }
    .search-wrapper.shifted { top: 15%; }
    
    .search-close-btn {
        margin-left: 0;
        top: 10px;
        right: 10px;
        left: auto;
        transform: scale(0);
    }
    .search-close-btn.active { transform: scale(1); }
    
    .hero-text h1 { font-size: 2rem; }
    .news-item { flex-direction: column; gap: 10px; }
    .news-date { width: 100%; padding: 5px; }
}

/* --- Подсказка при пустом поиске --- */
.search-hint {
    text-align: center;
    color: #888;
    font-size: 0.95rem;
    padding: 15px 20px;
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #4cc2ff;
    border-top: none;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    display: none; /* Скрыта по умолчанию */
}

.search-hint.visible {
    display: block;
}

/* --- Результаты поиска (уже были) --- */
.search-results-container {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #4cc2ff;
    border-top: none;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
}

.search-results-container.has-content {
    display: block;
}
/* --- Адаптация результатов --- */
.search-results-container {
    /* Уже есть в вашем CSS */
}

.search-results-container.has-content ~ .search-hint,
.search-results-container.has-content ~ .quick-categories {
    display: none !important;
}