/* ================================================
   СЕКЦИЯ ЧАТ-БОТА
   Размеры из Figma: 1671px × 295px
   ================================================ */

.chatbot {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    position: relative;
    /* z-index выше чем секция "О нас" чтобы маскот был поверх */
    z-index: 10;
}

/* Контейнер секции */
.chatbot__container {
    width: 1671px;
    max-width: calc(100% - 40px);
    height: 295px;
    background: linear-gradient(135deg, #958ad1 0%, #8e7ee8 100%);
    border-radius: 20px;
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 43px 99px 43px 99px;
    box-sizing: border-box;
}

/* Контент (текст, поле ввода, подсказки) */
.chatbot__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 2;
    /* Резервируем место для маскота справа */
    margin-right: 250px;
    max-width: calc(100% - 250px);
}

/* Описание чат-бота */
.chatbot__description {
    max-width: 979px;
    width: 100%;
    min-height: 78px;
    font-family: 'Coolvetica Rg', 'Coolvetica', sans-serif;
    font-weight: 400; /* Coolvetica Regular */
    font-size: 24px;
    line-height: 34.266px;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

/* Контейнер поиска */
.chatbot__search {
    position: relative;
    max-width: 1296px;
    width: 100%;
    height: 59px;
    margin-top: 16px;
}

/* Поле ввода */
.chatbot__input {
    width: 100%;
    height: 100%;
    background-color: #f6f6f6;
    border: 1px solid #cecece;
    border-radius: 5px;
    padding: 0 230px 0 20px;
    font-family: 'Coolvetica Rg', 'Coolvetica', sans-serif;
    font-weight: 400; /* Coolvetica Regular */
    font-size: 20px;
    line-height: 24px;
    color: #000000;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbot__input::placeholder {
    color: #000000;
    opacity: 0.5;
}

.chatbot__input:focus {
    border-color: #958ad1;
}

/* Кнопка "Найти" */
.chatbot__submit {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 206px;
    height: 43.74px;
    background-color: #313131;
    border: none;
    border-radius: 6.34px;
    font-family: 'Coolvetica', sans-serif;
    font-weight: 400; /* Coolvetica Book */
    font-size: 11.96px;
    line-height: 14.35px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.chatbot__submit:hover {
    background-color: #4a4a4a;
    transform: translateY(-50%) scale(1.02);
}

.chatbot__submit:active {
    transform: translateY(-50%) scale(0.98);
}

/* Подсказки */
.chatbot__suggestions {
    display: flex;
    gap: 9px;
    margin-top: 10px;
}

.chatbot__suggestion {
    width: 176px;
    height: 45px;
    background-color: #625b8b;
    border: none;
    border-radius: 0 8px 8px 8px;
    font-family: 'Coolvetica', sans-serif;
    font-weight: 300; /* Coolvetica Light */
    font-size: 20px;
    line-height: 24px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot__suggestion:hover {
    background-color: #7369a0;
    transform: translateY(-2px);
}

.chatbot__suggestion:active {
    transform: translateY(0);
}

/* Контейнер иллюстрации маскота */
.chatbot__illustration {
    position: absolute;
    right: -47px;
    top: -77px;
    width: 288px;
    height: 414px;
    display: flex;
    align-items: flex-end;
    z-index: 1;
}

/* Изображение маскота */
.chatbot__mascot {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
}

/* ================================================
   АДАПТИВНОСТЬ
   ================================================ */

/* Планшеты */
@media (max-width: 1700px) {
    .chatbot__container {
        width: 95%;
        max-width: 1671px;
        padding: 40px 60px;
    }
    
    .chatbot__content {
        margin-right: 200px;
        max-width: calc(100% - 200px);
    }
    
    .chatbot__description {
        width: 100%;
        max-width: 100%;
    }
    
    .chatbot__search {
        width: 100%;
        max-width: 100%;
    }
    
    .chatbot__illustration {
        right: -30px;
        width: 240px;
        height: auto;
    }
    
    .chatbot__mascot {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 1400px) {
    .chatbot__container {
        padding: 40px 50px;
    }
    
    .chatbot__content {
        margin-right: 180px;
        max-width: calc(100% - 180px);
    }
    
    .chatbot__illustration {
        right: -20px;
        width: 200px;
    }
    
    .chatbot__description {
        font-size: 22px;
        line-height: 30px;
    }
}

/* Планшеты и выше */
@media (max-width: 1024px) and (min-width: 768px) {
    .chatbot__container {
        height: auto;
        flex-direction: column;
        padding: 30px 30px 20px 30px;
        gap: 16px;
        min-height: 280px;
    }
    
    .chatbot__content {
        margin-right: 0;
        max-width: 100%;
    }
    
    .chatbot__description {
        width: 100%;
        min-height: auto;
        font-size: 20px;
        line-height: 28px;
    }
    
    .chatbot__search {
        width: 100%;
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        height: auto !important;
    }
    
    .chatbot__input {
        padding: 0 20px !important;
        height: 60px !important;
        font-size: 18px !important;
    }
    
    .chatbot__submit {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 0 !important;
        height: 58px !important;
        font-size: 18px !important;
    }
    
    .chatbot__submit:hover {
        transform: scale(1.02);
    }
    
    .chatbot__submit:active {
        transform: scale(0.98);
    }
    
    /* Подсказки - скрыты на планшетах */
    .chatbot__suggestions {
        display: none;
    }
    
    /* Маскот - скрыт на планшетах */
    .chatbot__illustration {
        display: none;
    }
}

/* Мобильные устройства */
@media (max-width: 767px) {
    .chatbot {
        padding: 20px 0;
    }
    
    .chatbot__container {
        /* Единое фиолетовое окно с фоном как на десктопе */
        padding: 25px 20px 22px 20px;
        background: linear-gradient(135deg, #958ad1 0%, #8e7ee8 100%);
        border-radius: 20px;
        height: auto;
        flex-direction: column;
        gap: 10px;
        position: relative;
        min-height: auto;
    }
    
    .chatbot__content {
        margin-right: 0;
        max-width: 100%;
        width: 100%;
        z-index: 2;
    }
    
    /* Текст описания - белый на фиолетовом фоне */
    .chatbot__description {
        font-size: 18px;
        line-height: 26px;
        color: #ffffff;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    /* Поиск */
    .chatbot__search {
        margin-top: 8px;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    /* Поле ввода */
    .chatbot__input {
        height: 52px;
        font-size: 16px;
        line-height: 24px;
        padding: 0 20px;
        border-radius: 8px;
        border: 1px solid #cecece;
        background: #f6f6f6;
        width: 100%;
    }
    
    .chatbot__input:focus {
        border-color: #958ad1;
    }
    
    /* Кнопка "Найти" */
    .chatbot__submit {
        position: static;
        transform: none;
        width: 100%;
        height: 48px;
        margin-top: 0;
        font-size: 16px;
        background-color: #313131;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .chatbot__submit:hover {
        background-color: #4a4a4a;
        transform: scale(1.02);
    }
    
    .chatbot__submit:active {
        transform: scale(0.98);
    }
    
    /* Подсказки - скрыты на мобильных */
    .chatbot__suggestions {
        display: none;
    }
    
    /* Маскот - скрыт на мобильных */
    .chatbot__illustration {
        display: none;
    }
}

/* Очень маленькие экраны */
@media (max-width: 375px) {
    .chatbot__description {
        font-size: 17px;
        line-height: 25px;
    }
    
    .chatbot__container {
        padding: 22px 18px 20px 18px;
    }
    
    .chatbot__search {
        margin-top: 6px;
    }
}

/* ================================================
   ВИДЖЕТ ЧАТ-БОТА (STICKY)
   ================================================ */

/* Контейнер виджета */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-widget.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Кнопка открытия/закрытия виджета */
.chatbot-widget__toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #958ad1 0%, #8e7ee8 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(149, 138, 209, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.chatbot-widget__toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(149, 138, 209, 0.6);
}

.chatbot-widget__toggle img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Окно чата */
.chatbot-widget__window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 400px;
    min-width: 400px;
    max-height: 600px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-widget__window.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Шапка окна чата */
.chatbot-widget__header {
    background: linear-gradient(135deg, #958ad1 0%, #8e7ee8 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-widget__header-title {
    color: #ffffff;
    font-family: 'Coolvetica Rg', 'Coolvetica', sans-serif;
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-widget__header-title img {
    width: 30px;
    height: 30px;
}

.chatbot-widget__close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chatbot-widget__close:hover {
    transform: rotate(90deg);
}

/* Тело окна чата */
.chatbot-widget__body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background: #f8f8f8;
}

.chatbot-widget__description {
    font-family: 'Coolvetica Rg', 'Coolvetica', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #333333;
    margin-bottom: 20px;
}

/* Форма виджета */
.chatbot-widget__form {
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

.chatbot-widget__input-group {
    display: flex;
    gap: 10px;
}

.chatbot-widget__input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #cecece;
    border-radius: 25px;
    font-family: 'Coolvetica Rg', 'Coolvetica', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbot-widget__input:focus {
    border-color: #958ad1;
}

.chatbot-widget__input::placeholder {
    color: #000000;
    opacity: 0.5;
}

.chatbot-widget__send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #958ad1 0%, #8e7ee8 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s ease;
}

.chatbot-widget__send:hover {
    transform: scale(1.1);
}

/* Подсказки в виджете */
.chatbot-widget__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.chatbot-widget__suggestion {
    padding: 8px 16px;
    background-color: #625b8b;
    border: none;
    border-radius: 0 12px 12px 12px;
    font-family: 'Coolvetica', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.chatbot-widget__suggestion:hover {
    background-color: #7369a0;
    transform: translateY(-2px);
}

.chatbot-notification {
    position: fixed;
    top: 100px;
    right: 30px;
    background: #4caf50;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 16px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ================================================
   АДАПТИВНОСТЬ ДЛЯ ВИДЖЕТА ЧАТ-БОТА
   ================================================ */

/* Мобильные устройства (до 767px) */
@media (max-width: 767px) {
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    
    /* Кнопка чуть меньше на мобильных */
    .chatbot-widget__toggle {
        width: 60px;
        height: 60px;
        box-shadow: 0 4px 16px rgba(149, 138, 209, 0.5);
    }
    
    .chatbot-widget__toggle img {
        width: 40px;
        height: 40px;
    }
    
    /* Окно чата на всю ширину с отступами */
    .chatbot-widget__window {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        z-index: 1000 !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s ease-in-out !important;
        animation: none !important;
        flex: none !important;
    }
    
    .chatbot-widget__window.open {
        display: flex !important;
        transform: translateY(0) !important;
    }
    
    .chatbot-widget__header {
        padding: 18px 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .chatbot-widget__header-title {
        font-size: 16px;
        gap: 8px;
    }
    
    .chatbot-widget__header-title img {
        width: 26px;
        height: 26px;
    }
    
    .chatbot-widget__close {
        font-size: 28px;
    }
    
    .chatbot-widget__body {
        padding: 18px;
        max-height: calc(80vh - 140px);
    }
    
    .chatbot-widget__description {
        font-size: 15px;
        line-height: 22px;
        margin-bottom: 16px;
    }
    
    .chatbot-widget__suggestions {
        gap: 6px;
        margin-top: 12px;
    }
    
    .chatbot-widget__suggestion {
        padding: 8px 14px;
        font-size: 13px;
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    .chatbot-widget__form {
        padding: 12px 15px;
    }
    
    .chatbot-widget__input {
        padding: 11px 14px;
        font-size: 15px;
    }
    
    .chatbot-widget__send {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 375px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-widget__toggle {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-widget__toggle img {
        width: 36px;
        height: 36px;
    }
    
    /* Стили окна чата уже установлены в основном мобильном медиа-запросе */
    
    .chatbot-widget__body {
        max-height: calc(85vh - 130px);
    }
    
    .chatbot-widget__suggestion {
        min-width: 100px;
        font-size: 12px;
        padding: 7px 12px;
    }
}

/* Планшеты (768px-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .chatbot-widget {
        bottom: 25px;
        right: 25px;
    }
    
    .chatbot-widget__toggle {
        width: 65px;
        height: 65px;
    }
    
    .chatbot-widget__toggle img {
        width: 45px;
        height: 45px;
    }
    
    /* Окно чата на планшетах */
    .chatbot-widget__window {
        width: 380px;
        max-height: 550px;
        bottom: 95px;
    }
    
    .chatbot-widget__body {
        padding: 18px;
    }
    
    .chatbot-widget__description {
        font-size: 15px;
        line-height: 23px;
    }
    
    .chatbot-widget__suggestion {
        font-size: 13px;
        padding: 8px 14px;
    }
}
