/**
 * GoFrag Search Widget v1.0.2
 * Крупный поиск, яркий ободок, большие карточки
 */

/* --- Контейнер --- */
.gf-search {
    position: relative;
    width: 100%;
}
.uk-navbar-right {
    flex: 1 !important;
}
.uk-navbar-right > .uk-navbar-nav {
    flex: 1 !important;
    justify-content: center !important;
}
#module-404 {
    width: 530px !important;
    flex-shrink: 0 !important;
}
/* --- Поле ввода --- */
.gf-search .gf-search__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gf-search .gf-search__icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #4CAF50;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
    opacity: 0.7;
}

.gf-search input.gf-search__input {
    width: 100% !important;
    height: 44px !important;
    padding: 0 42px 0 42px !important;
    background: #1a1a1a !important;
    border: 1px solid rgba(76, 175, 80, 0.35) !important;
    border-radius: 8px !important;
    color: #e0e0e0 !important;
    font-family: inherit;
    font-size: 15px !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.gf-search input.gf-search__input::-webkit-search-cancel-button,
.gf-search input.gf-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.gf-search input.gf-search__input::placeholder {
    color: #777 !important;
}

.gf-search input.gf-search__input:focus {
    border-color: #4CAF50 !important;
    background: #1c1c1c !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2) !important;
}

.gf-search input.gf-search__input:focus ~ .gf-search__icon {
    color: #4CAF50;
    opacity: 1;
}

/* --- Кнопка очистки --- */
.gf-search .gf-search__clear {
    position: absolute;
    right: 10px;
    width: 26px;
    height: 26px;
    background: none !important;
    border: none !important;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    transition: color 0.15s, background 0.15s;
}

.gf-search .gf-search__clear:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.1) !important;
}

.gf-search .gf-search__clear.visible {
    display: flex;
}

/* --- Dropdown --- */
.gf-search .gf-search__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 530px;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 1050;
}

.gf-search .gf-search__dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Карточка результата --- */
.gf-search a.gf-search__item {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 10px 16px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
}

.gf-search a.gf-search__item:last-of-type {
    border-bottom: none;
}

.gf-search a.gf-search__item:hover {
    background: #282828 !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
}

/* --- Постер (горизонтальный, крупнее) --- */
.gf-search .gf-search__poster {
    width: 80px;
    height: 45px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: #141414;
    display: block;
}

.gf-search .gf-search__poster--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
}

/* --- Инфо --- */
.gf-search .gf-search__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gf-search .gf-search__title {
    font-size: 14px;
    font-weight: 600;
    color: #eee;
    line-height: 1.3;
}

.gf-search .gf-search__title mark {
    background: none !important;
    color: #66BB6A !important;
    font-weight: 700;
}

.gf-search .gf-search__meta {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Звёзды рейтинга --- */
.gf-search .gf-search__stars {
    flex-shrink: 0;
    display: flex;
    gap: 2px;
    cursor: default;
    position: relative;
}

.gf-search .gf-search__star {
    width: 14px;
    height: 14px;
}

.gf-search .gf-search__star--active {
    color: #4CAF50;
}

.gf-search .gf-search__star--inactive {
    color: #3a3a3a;
}

/* Tooltip */
.gf-search .gf-search__stars[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: #111;
    color: #e0e0e0;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s, visibility 0.12s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.gf-search .gf-search__stars[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- «Все результаты» --- */
.gf-search a.gf-search__all {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px !important;
    background: rgba(76, 175, 80, 0.08) !important;
    border-top: 1px solid rgba(76, 175, 80, 0.2);
    color: #66BB6A !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.12s;
}

.gf-search a.gf-search__all:hover {
    background: rgba(76, 175, 80, 0.15) !important;
    color: #66BB6A !important;
    text-decoration: none !important;
}

.gf-search a.gf-search__all svg {
    width: 14px;
    height: 14px;
}

/* --- Пустой результат --- */
.gf-search .gf-search__empty {
    padding: 28px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.gf-search .gf-search__empty span {
    color: #999;
    font-weight: 500;
}

/* --- Загрузка --- */
.gf-search .gf-search__loading {
    padding: 24px 16px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.gf-search .gf-search__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #444;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: gf-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes gf-spin {
    to { transform: rotate(360deg); }
}

/* --- Мобилка --- */
@media (max-width: 768px) {
    .gf-search .gf-search__dropdown {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 70vh;
        overflow-y: auto;
    }

    .gf-search .gf-search__poster {
        width: 64px;
        height: 36px;
    }
}
