.module-search {
    background: url(module-search-background.webp) no-repeat center center;
}

.module-search .form-title {
    text-align: center;
    font-weight: 500;
    margin-bottom: 10px;
}

.module-search__mode {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.module-search__mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.90);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    font-family: inherit;
}

.module-search__mode-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.module-search__mode-btn:hover {
    background: var(--white);
}

.module-search__mode-btn.is-active {
    background: var(--secondary-color);
    color: var(--white);
    font-weight: 600;
}

.module-search__form {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.module-search__form-wrap {
    position: relative;
}

.module-search__bar {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 32px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.10);
    padding: 5px 10px 5px 20px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 300ms ease;
}

.module-search__bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    border-radius: 5px;
    opacity: 0;
    transition: opacity 200ms ease;
    animation: search-scan 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation-play-state: paused;
}

.module-search__bar:hover {
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.14);
}

.module-search__bar:hover::after {
    opacity: 1;
    animation-play-state: running;
}

.module-search__bar.is-searching::after {
    opacity: 1;
    animation-play-state: running;
}

.module-search__bar.is-searching {
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.14);
}

@keyframes search-scan {
    0%   { left: -60%; }
    100% { left: 100%; }
}

.module-search__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-color);
    padding: 10px 15px 10px 0;
    min-width: 0;
}

.module-search__input::placeholder {
    color: #b0b0b0;
}

.module-search__tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
    padding: 0 5px;
}

.module-search__tags-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.6;
    white-space: nowrap;
}

.module-search__tag {
    font-size: 12px;
    color: var(--text-color);
    background: var(--white);
    border: none;
    text-decoration: none;
    border-radius: 32px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
    opacity: 0.70;
    transition: background 200ms ease, color 200ms ease, opacity 200ms ease;
}

.module-search__tag:hover {
    background: var(--secondary-color);
    color: var(--white);
    opacity: 1;
    text-decoration: none;
}

.module-article {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.module-search__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
    z-index: 100;
    overflow: hidden;
    max-height: 50vh;
    overflow-y: auto;
}

.module-search__dropdown-loading {
    padding: 30px;
    text-align: center;
    font-size: 14px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .module-search__form {
        max-width: 100%;
    }

    .module-search__bar {
        padding: 5px 5px 5px 15px;
    }

    .module-search__input {
        font-size: 16px;
    }

    .module-search__tags {
        gap: 8px;
    }
}