/* ===== ПРЕМИУМ ЧАТ-БОТ ===== */
.premium-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Кнопка чата с кольцами */
.premium-chat-button {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent) 0%, #9acc4d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 30px rgba(199, 255, 102, 0.3);
}

.premium-chat-button i {
    color: #0a0a0a;
    font-size: 28px;
    transition: transform 0.3s;
    z-index: 3;
}

.button-ring, .button-ring-2 {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: ringPulse 2s infinite;
}

.button-ring-2 {
    animation-delay: 0.5s;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ff4757;
    border: 2px solid #0a0a0a;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    z-index: 4;
}

@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.premium-chat-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 20px 40px rgba(199, 255, 102, 0.5);
}

.premium-chat-button:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Окно чата */
.premium-chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 400px;
    height: 600px;
    background: #1a1a1a;
    border-radius: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(199, 255, 102, 0.2);
}

.premium-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Градиентная шапка */
.premium-chat-header {
    position: relative;
    padding: 20px;
    background: #0f0f0f;
    border-bottom: 1px solid rgba(199, 255, 102, 0.2);
}

.header-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #4a90e2, var(--accent));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.bot-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    background: rgba(199, 255, 102, 0.1);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid #0f0f0f;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.bot-info h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.bot-info p {
    color: var(--accent);
    font-size: 12px;
    opacity: 0.8;
}

.header-close {
    width: 35px;
    height: 35px;
    background: rgba(199, 255, 102, 0.1);
    border: 1px solid rgba(199, 255, 102, 0.2);
    border-radius: 50%;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.header-close:hover {
    background: var(--accent);
    color: #0a0a0a;
    transform: rotate(90deg);
}

/* Область сообщений */
.premium-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #0f0f0f;
}

.message-date {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin: 20px 0;
    position: relative;
}

.message-date::before,
.message-date::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #2a2a2a;
}

.message-date::before {
    left: 0;
}

.message-date::after {
    right: 0;
}

.message-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-row {
    align-items: flex-start;
}

.user-row {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    background: rgba(199, 255, 102, 0.1);
    border: 1px solid rgba(199, 255, 102, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

.user-row .message-avatar {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: white;
}

.message-content-wrapper {
    max-width: 70%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
}

.bot-bubble {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-bottom-left-radius: 5px;
}

.user-bubble {
    background: rgba(199, 255, 102, 0.1);
    border: 1px solid var(--accent);
    border-bottom-right-radius: 5px;
    color: white;
}

.message-bubble p {
    color: white;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.message-time {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    padding-left: 10px;
}

.user-row .message-time {
    text-align: right;
    padding-right: 10px;
}

/* Тайп-эффект */
.typing-effect {
    color: white;
    font-size: 14px;
}

.typed-text {
    display: inline-block;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--accent);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Быстрые действия */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.quick-action-btn {
    flex: 1 1 calc(50% - 5px);
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.quick-action-btn i {
    font-size: 24px;
    color: var(--accent);
    transition: all 0.3s;
}

.quick-action-btn:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(199, 255, 102, 0.2);
}

.quick-action-btn:hover i {
    transform: scale(1.2);
}

/* Популярные вопросы */
.popular-questions {
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
}

.questions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 12px;
}

.questions-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) #2a2a2a;
}

.questions-carousel::-webkit-scrollbar {
    height: 4px;
}

.questions-carousel::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.questions-carousel::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.question-chip {
    padding: 8px 15px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 30px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.question-chip i {
    color: var(--accent);
    font-size: 12px;
}

.question-chip:hover {
    border-color: var(--accent);
    background: rgba(199, 255, 102, 0.1);
    transform: translateY(-2px);
}

/* Поле ввода */
.premium-chat-input {
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    display: flex;
    gap: 10px;
    align-items: center;
}

.attach-btn, .mic-btn {
    width: 40px;
    height: 40px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover, .mic-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

.premium-chat-input input {
    flex: 1;
    height: 40px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 30px;
    padding: 0 20px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.premium-chat-input input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(199, 255, 102, 0.2);
}

.send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--accent) 0%, #9acc4d 100%);
    border: none;
    border-radius: 50%;
    color: #0a0a0a;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(199, 255, 102, 0.3);
}

.send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 10px 25px rgba(199, 255, 102, 0.5);
}

.send-btn i {
    font-size: 18px;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */

/* Адаптация для очень маленьких экранов */
@media (max-width: 380px) {
    .premium-chat-container {
        bottom: 15px;
        right: 15px;
    }

    .premium-chat-button {
        width: 55px;
        height: 55px;
    }

    .premium-chat-button i {
        font-size: 22px;
    }
}

/* Окно чата - мобильная версия */
@media (max-width: 768px) {
    .premium-chat-container {
        bottom: 20px;
        right: 20px;
    }

    .premium-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        bottom: 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        z-index: 10000;
    }

    .premium-chat-window.active {
        transform: translateY(0);
    }

    /* Шапка для мобильных */
    .premium-chat-header {
        padding: 15px;
        border-radius: 0;
    }

    .bot-avatar {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .bot-info h4 {
        font-size: 15px;
    }

    .bot-info p {
        font-size: 11px;
    }

    .header-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    /* Затемнение фона при открытом чате */
    body.chat-open {
        overflow: hidden;
    }

    body.chat-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        pointer-events: none;
    }

    /* Область сообщений */
    .premium-chat-messages {
        padding: 15px;
        height: calc(100% - 180px);
    }

    /* Быстрые действия */
    .quick-actions {
        margin: 15px 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-action-btn {
        padding: 12px;
        font-size: 12px;
    }

    .quick-action-btn i {
        font-size: 20px;
    }

    .quick-action-btn span {
        font-size: 11px;
    }

    /* Популярные вопросы */
    .popular-questions {
        padding: 12px 15px;
    }

    .questions-title {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .questions-title i {
        font-size: 14px;
    }

    .question-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Поле ввода */
    .premium-chat-input {
        padding: 12px 15px;
        position: sticky;
        bottom: 0;
        background: #1a1a1a;
    }

    .premium-chat-input input {
        height: 45px;
        font-size: 16px;
    }

    .attach-btn, .mic-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .send-btn {
        width: 50px;
        height: 50px;
    }

    .send-btn i {
        font-size: 20px;
    }

    /* Сообщения */
    .message-content-wrapper {
        max-width: 85%;
    }

    .message-bubble {
        padding: 10px 14px;
    }

    .message-bubble p {
        font-size: 14px;
        line-height: 1.4;
    }

    .message-time {
        font-size: 9px;
    }

    .message-bubble a {
        word-break: break-all;
    }

    /* Подсказка для свайпа */
    .swipe-hint {
        display: flex;
        justify-content: center;
        margin-top: 5px;
        color: #666;
        font-size: 10px;
    }

    .swipe-hint i {
        margin-right: 5px;
        animation: swipeArrow 1.5s infinite;
    }

    @keyframes swipeArrow {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-3px);
        }
    }
}

/* Для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .premium-chat-window {
        width: 380px;
        height: 580px;
        bottom: 80px;
    }

    .quick-action-btn {
        padding: 14px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .premium-chat-window {
        display: flex;
        flex-direction: column;
    }

    .premium-chat-header {
        padding: 10px;
    }

    .bot-avatar {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .bot-info h4 {
        font-size: 14px;
    }

    .bot-info p {
        font-size: 10px;
    }

    .premium-chat-messages {
        height: calc(100% - 160px);
        padding: 10px;
    }

    .popular-questions {
        padding: 8px 10px;
    }

    .questions-carousel {
        gap: 8px;
    }

    .question-chip {
        padding: 5px 10px;
        font-size: 11px;
    }

    .premium-chat-input {
        padding: 8px 10px;
    }

    .premium-chat-input input {
        height: 40px;
        font-size: 14px;
    }

    .attach-btn, .mic-btn {
        width: 40px;
        height: 40px;
    }

    .send-btn {
        width: 45px;
        height: 45px;
    }
}

/* Стили для свайпа */
.dragging {
    transition: none !important;
    opacity: 0.9;
}

/* Анимации для мобильных */
@media (max-width: 768px) {
    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    @keyframes slideDown {
        from {
            transform: translateY(0);
        }
        to {
            transform: translateY(100%);
        }
    }
}

/* Индикатор печатания */
.typing-dots {
    display: flex;
    gap: 5px;
    padding: 5px 10px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
    opacity: 0.4;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}