/* === ОБОЛОЧКА === */
.kinoai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: Arial, sans-serif;
}
.kinoai-chat-widget * {
    box-sizing: border-box;
}

/* === КНОПКА ЗАПУСКА === */
.kinoai-chat-launch {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1b1e25;
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    transition: all .25s ease;
    position: relative;
}
.kinoai-chat-launch:hover {
    background: #2e323b;
    transform: translateY(-2px);
}
.kinoai-chat-launch__icon {
    font-size: 22px;
}
.kinoai-chat-launch__title {
    font-weight: 600;
    font-size: 14px;
}
.kinoai-chat-launch__subtitle {
    font-size: 11px;
    opacity: 0.8;
}

/* Подсказка при наведении */
.kinoai-chat-launch::after {
    content: "Кино-консультант";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1b1e25;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    margin-right: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100000;
}
.kinoai-chat-launch:hover::after {
    opacity: 1;
    visibility: visible;
}

/* лёгкая подсветка один раз */
.kinoai-chat-widget--highlight .kinoai-chat-launch {
    animation: kinoai-pulse 1s ease-in-out 0s 2;
}
@keyframes kinoai-pulse {
    0%,100% { box-shadow: 0 0 6px rgba(47,128,237,0.3); }
    50% { box-shadow: 0 0 16px rgba(47,128,237,0.9); }
}

/* === ОКНО ЧАТА === */
.kinoai-chat-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 360px;
    height: 440px;
    background: #121318;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.8);
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.kinoai-chat-widget--open .kinoai-chat-window {
    display: flex;
}

/* === HEADER === */
.kinoai-chat-window__header {
    padding: 10px 14px;
    background: #1f2128;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kinoai-chat-window__info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.kinoai-chat-window__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background:#2f80ed;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
}
.kinoai-chat-window__title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
.kinoai-chat-window__status {
    font-size: 11px;
    color: #8d93a5;
}
.kinoai-chat-window__close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
}
.kinoai-chat-window__close:hover {
    color: #fff;
}

/* === СООБЩЕНИЯ === */
.kinoai-chat-window__messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}
.kinoai-chat-message {
    margin-bottom: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 14px;
}
.kinoai-chat-message--bot {
    background: #1c222c;
    color: #e9ecf3;
    text-align: left;
}
.kinoai-chat-message--user {
    background: #3b6aff;
    color: #fff;
    text-align: right;
}

/* typing ... */
.kinoai-chat-message--typing span {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: kinoai-blink 1.2s infinite;
}
@keyframes kinoai-blink {
    0% { opacity: .2; }
    50% { opacity: 1; }
    100% { opacity: .2; }
}

/* === ФОРМА ОТПРАВКИ === */
.kinoai-chat-form {
    padding: 8px 10px;
    border-top: 1px solid #282a31;
    display: flex;
    gap: 8px;
    background: #1f2128;
}
.kinoai-chat-input {
    flex: 1;
    padding: 7px 10px;
    border-radius: 8px;
    background: #14161c;
    border: 1px solid #333;
    color: #fff;
    resize: none;
    outline: none;
}
.kinoai-chat-send {
    padding: 7px 12px;
    background: #3b6aff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}
.kinoai-chat-send:hover {
    background: #5b7cff;
}

/* === РЯД С ГОЛОСОМ === */
.kinoai-chat-voice-row {
    padding: 6px 10px 10px;
    background: #1f2128;
    border-top: 1px solid #282a31;
    text-align: right;
}
#kinoai-chat-voice {
    background: #14161c !important;
    color: #a8ffb4 !important;
    border: 1px solid #3b6aff !important;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
#kinoai-chat-voice::before {
    content: "🔊";
}
#kinoai-chat-voice:hover {
    background: #191b23 !important;
}

/* Контейнер под кнопки в сообщении */
.movie-btns {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Общий стиль обеих кнопок */
.lf-similar-btn,
.lf-watch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    text-decoration: none;
}

/* "Похожие" — оранжевая рамка, прозрачный фон */
.lf-similar-btn {
    background: transparent;
    color: #ff9800;
    border-color: #ff9800;
}

.lf-similar-btn:hover {
    background: rgba(255, 152, 0, 0.12);
}

/* "Смотреть" — зелёная кнопка */
.lf-watch-btn {
    background: #36c95a;
    color: #0b0f13;
    border-color: #36c95a;
}

.lf-watch-btn:hover {
    background: #2bb64e;
    border-color: #2bb64e;
}

/* === МОБИЛКА С ПРАВИЛЬНЫМ ОКНОМ === */
@media (max-width: 768px) {
    .kinoai-chat-widget {
        position: fixed;
        bottom: 490px; /* Поднял выше */
        right: 20px;
        z-index: 99999;
    }

    .kinoai-chat-launch {
        padding: 12px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.7);
        transform: none;
    }

    /* Скрываем текст, оставляем только иконку */
    .kinoai-chat-launch__text {
        display: none;
    }

    .kinoai-chat-launch__icon {
        font-size: 28px;
        margin: 0;
    }

    /* Подсказка для мобилки */
    .kinoai-chat-launch::after {
        content: "Кино-консультант";
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #1b1e25;
        color: white;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 12px;
        white-space: nowrap;
        margin-bottom: 10px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 100000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .kinoai-chat-launch:hover::after {
        opacity: 1;
        visibility: visible;
    }

    /* Окно чата - полноэкранное на мобилке */
    .kinoai-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        z-index: 100000;
    }

    .kinoai-chat-window__header {
        padding: 15px;
        background: #1f2128;
    }

    .kinoai-chat-window__messages {
        padding: 15px;
        flex: 1;
    }

    .kinoai-chat-form {
        padding: 12px 15px;
    }

    .kinoai-chat-voice-row {
        padding: 10px 15px;
    }
}