/* ==========================================================================
   БАЗОВЫЕ СТИЛИ И СЕТКА
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background-color: #f8f9fa; color: #333; line-height: 1.6; }

.page-wrapper {
    max-width: 1200px;
    margin: 120px auto 40px;
    background: white;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 8px;
}

/* ШАПКА */
.site-header {
    position: fixed; top: 0; left: 0; width: 100%;
    background: #fff; border-bottom: 1px solid #eee;
    padding: 10px 5%; display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; height: 90px;
}
.logo { height: 60px; width: auto; }
.main-nav a { margin: 0 15px; font-weight: 600; color: #333; text-decoration: none; font-size: 1.1em; }
.main-nav a:hover { color: #007bff; }
.search-bar { padding: 8px 15px; border: 1px solid #ddd; border-radius: 20px; width: 250px; }

/* НОВОСТИ (INDEX HOME) */
.news-item { margin-bottom: 50px; padding-bottom: 30px; border-bottom: 1px solid #eee; }
.news-item h1, .news-item h2 { margin-bottom: 20px; color: #222; }
.news-item img { 
    max-width: 100%;
    height: auto; 
    border-radius: 8px; 
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.secondary-news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

/* КАТАЛОГ (INDEX CATALOG) */
.catalog-layout { display: flex; gap: 30px; }
.filters-sidebar { width: 250px; flex-shrink: 0; background: #fdfdfd; padding: 20px; border-radius: 8px; border: 1px solid #eee; }
.movie-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px; 
    width: 100%;
}
@media (max-width: 900px) {
    .movie-grid { grid-template-columns: repeat(2, 1fr); }
}

.movie-card {
    background: #fff; border: 1px solid #eee; padding: 10px; border-radius: 8px;
    text-align: center; transition: transform 0.2s;
    display: flex; flex-direction: column; justify-content: space-between;
}
.movie-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.movie-card img { width: 100%; height: 300px; object-fit: cover; border-radius: 4px; margin-bottom: 10px; }
.movie-card strong { display: block; margin: 10px 0 5px; font-size: 1.1em; }

/* КНОПКИ */
.apply-btn { background: #007bff; color: white; border: none; padding: 10px; border-radius: 5px; cursor: pointer; width: 100%; }
.info-btn { background: #ffc107; border: none; padding: 5px 10px; border-radius: 3px; cursor: pointer; font-weight: bold; }

/* ФУТЕР */
.site-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; color: #777; }

/* ==========================================================================
   НОВЫЙ AJAX СЦЕНАРИЙ: ЖИВОЙ ПОИСК (ПОДСКАЗКИ)
   ========================================================================== */

/* Основной контейнер выпадающего списка */
.search-suggestions-dropdown {
    display: none; /* Скрыто по умолчанию */
    position: absolute;
    top: 100%; /* Сразу под инпутом */
    left: 0;
    width: 100%; /* Ширина как у инпута */
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 0 0 10px 10px; /* Скругление только снизу */
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 9999; /* Поверх всех карточек и фильтров */
    max-height: 280px;
    overflow-y: auto;
    margin-top: 2px;
}

/* Элемент списка (ссылка на фильм) */
.suggestion-item {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 0.95em;
    border-bottom: 1px solid #f1f1f1;
    transition: all 0.2s ease;
    text-align: left;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Эффект при наведении на подсказку */
.suggestion-item:hover {
    background-color: #007bff;
    color: white !important;
    padding-left: 20px;
}

/* Стиль для жирного текста (совпадение букв) */
.suggestion-item strong {
    color: #007bff;
    font-weight: 700;
}

.suggestion-item:hover strong {
    color: #fff; /* Белый при наведении */
}

/* Текст "Ничего не найдено" */
.suggestion-no-result {
    padding: 12px 15px;
    color: #999;
    font-size: 0.9em;
    font-style: italic;
    text-align: center;
}

/* Кастомизация скроллбара внутри списка */
.search-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}