/* wpmc-search-ai-styles.css */

/* Загальні стилі контейнера */
#wpmc-search-container {
    position: relative;
    margin: 0 auto;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
}

/* Стилізація заголовку (wpmc-result-title) та абзацу (wpmc-result-snippet) у результатах */
#wpmc-search-results .wpmc-result-title {
    margin: 0 0 5px;
    font-size: 18px !important;
    color: dodgerblue !important;
}
#wpmc-search-results .wpmc-result-snippet {
    margin: 0;
    font-size: 15px !important;
    color: #fff !important;
}

/* Стилізація кнопки результату */
.wpmc-result-btn {
    position: relative;
    display: inline-block;
    padding: 5px 15px;
    margin: 12px 0px 0px 0px;
    border-radius: 16px;
    font-family: 'Lexend Mega', sans-serif;
    font-weight: 600;
    font-size: 0,2rem;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(0, 255, 170, 0.1);
    backdrop-filter: blur(10px);
    box-shadow:
        inset 0 0 0 1px rgba(0, 255, 170, 0.4),
        0 10px 20px rgba(0, 255, 170, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    letter-spacing: 0.08em;
    cursor: pointer;
    z-index: 1;
    border: none;
}

.wpmc-result-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(1255, 51, 204, 0.3), transparent 70%);
    transform: scale(0);
    transition: transform 0.4s ease;
    z-index: -1;
}

.wpmc-result-btn:hover {
    color: #121212;
    background: rgba(255, 51, 204, 0.2);
    box-shadow:
        inset 0 0 0 1px rgba(255, 51, 204, 0.6),
        0 12px 30px rgba(255, 51, 204, 0.4);
    transform: translateY(-2px) scale(1.02);
}

.wpmc-result-btn:hover::before {
    transform: scale(1.5);
}

/* ===== ДЕСКТОПНА ВЕРСІЯ (min-width: 768px) ===== */
@media (min-width: 768px) {
    /* Пошукове поле – 30% ширини контейнера */
    #wpmc-search-input {
        width: 30% !important;
        padding: 10px;
        font-size: 16px;
    }
    /* Стилізація placeholder */
    #wpmc-search-input::placeholder {
        color: #888;
        font-style: italic;
    }
    /* Контейнер результатів */
    #wpmc-search-results {
        position: relative;
        height: auto; /* Забезпечуємо достатньо місця для позиціонування */
    }
    /* Результати пошуку */
    #wpmc-search-results li {
        position: absolute;
        list-style: none; /* Прибираємо стандартні маркери списку */
        background: #000; /* Чорний фон */
        border: 4px solid #fff; /* Біла обводка */
        padding: 10px;
        box-shadow: 6px 6px 0 #00ffaa; /* Біла тінь */
        max-width: 300px;
        height: 140px;
        opacity: 0;
        /* Використовуємо CSS-перемінну --offset для стартового відступу.
           За замовчуванням значення -20px (вище поля вводу) */
        transform: scale(0.5) translateY(var(--offset, -20px));
        animation: slideInDesktop 0.5s forwards;
    }
    /* Приклад позиціонування елементів.
       Для елементів, що повинні з’являтися знизу, перевизначаємо --offset на 20px */
    #wpmc-search-results li:nth-child(1) {
        top: -250px;
        left: 5%;
        animation-delay: 0.1s;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(2) {
        top: -300px;
        right: 30%;
        animation-delay: 0.2s;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(3) {
        top: -5px;
        left: 5px;
        animation-delay: 0.3s;
        --offset: 20px;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(4) {
        top: -100px;
        right: 5px;
        animation-delay: 0.4s;
        --offset: 20px;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(5) {
        top: -10px;
        left: 40%;
        animation-delay: 0.5s;
        z-index: 2147483647;
    }
    @keyframes slideInDesktop {
        0% {
            opacity: 0;
            transform: scale(0.5) translateY(var(--offset, -20px));
        }
        100% {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}

/* ===== МОБІЛЬНА ВЕРСІЯ (max-width: 767px) ===== */
@media (max-width: 767px) {
    /* Пошукове поле – 80% ширини контейнера */
    #wpmc-search-input {
        width: 80% !important;
        padding: 10px;
        font-size: 16px;
    }
    /* Стилізація placeholder */
    #wpmc-search-input::placeholder {
        color: #888;
        font-style: italic;
    }
    /* Контейнер результатів */
    #wpmc-search-results {
        position: relative;
        margin-top: 20px;
    }
    /* Результати пошуку */
    #wpmc-search-results li {
        position: absolute;
        list-style: none;
        background: #000;
        border: 4px solid #fff;
        padding: 10px;
        box-shadow: 6px 6px 0 #00ffaa;
        width: 80%;
        height: 140px;
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
        animation: slideInMobile 0.5s forwards;
    }
    /* Розташування результатів: два над і три під полем */
    #wpmc-search-results li:nth-child(1) {
        top: -430px;
        left: 50%;
        transform: translate(-50%, -20px) scale(0.8);
        animation-delay: 0.1s;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(2) {
        top: -250px;
        left: 50%;
        transform: translate(-50%, -20px) scale(0.8);
        animation-delay: 0.2s;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(3) {
        top: 2px;
        left: 50%;
        transform: translate(-50%, -20px) scale(0.8);
        animation-delay: 0.3s;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(4) {
        top: 205px;
        left: 50%;
        transform: translate(-50%, -20px) scale(0.8);
        animation-delay: 0.4s;
        z-index: 2147483647;
    }
    #wpmc-search-results li:nth-child(5) {
        top: 405px;
        left: 50%;
        transform: translate(-50%, -20px) scale(0.8);
        animation-delay: 0.5s;
        z-index: 2147483647;
    }
    @keyframes slideInMobile {
        0% {
            opacity: 0;
            transform: translate(-50%, -20px) scale(0.8);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, 0) scale(1);
        }
    }
}
