/* Стили чата */

#premium-chat-scope {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    font-family: "Inter", sans-serif !important;
    max-width: 100%;
    height: 480px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

#premium-chat-scope .chat-history-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: #ffffff;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#premium-chat-scope .chat-history-container::-webkit-scrollbar {
    width: 5px;
}
#premium-chat-scope .chat-history-container::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
}
#premium-chat-scope .chat-history-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: content-box;
}
#premium-chat-scope .chat-history-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#premium-chat-scope .message-bubble {
    max-width: 82%;
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1.55;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
    transition: transform 0.2s ease;
}

/* Пустой чат */
#premium-chat-scope .chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

#premium-chat-scope .empty-icon-wrap {
    width: 80px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

#premium-chat-scope .empty-icon-wrap i {
    font-size: 32px;
    color: #4e6a8e;
    animation: pulse-subtle 2s infinite ease-in-out;
}

#premium-chat-scope .empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

#premium-chat-scope .empty-subtitle {
    font-size: 13px;
    color: #64748b;
    max-width: 240px;
    line-height: 1.6;
}

@keyframes pulse-subtle {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

#premium-chat-scope .message-bubble.user {
    align-self: flex-end;
    background: #4e6a8e;
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 6px 15px rgba(78, 106, 142, 0.15);
}

#premium-chat-scope .message-bubble.admin {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 20px 20px 20px 4px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

#premium-chat-scope .message-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

#premium-chat-scope .user .message-meta {
    justify-content: flex-end;
    color: rgba(255, 255, 255, 0.85);
}

#premium-chat-scope .message-status {
    display: flex;
    align-items: center;
    margin-left: 5px;
}

#premium-chat-scope .message-status i {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5); /* Не прочитано - приглушенный серый/белый */
    transition: color 0.3s ease;
}

#premium-chat-scope .message-status.read i {
    color: #59b2ff; /* Прочитано - яркий голубой */
    opacity: 1;
}

#premium-chat-scope .admin .message-meta {
    justify-content: flex-start;
    color: #94a3b8;
}

#premium-chat-scope .chat-input-wrapper {
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    z-index: 10;
}

#premium-chat-scope .chat-input-inner {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 6px 6px 6px 18px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#premium-chat-scope .chat-input-inner:focus-within {
    border-color: #4e6a8e;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(78, 106, 142, 0.05);
}

#premium-chat-scope .chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 0;
    font-family: "Inter", sans-serif !important;
    font-size: 14px;
    color: #0f172a;
    resize: none;
    max-height: 120px;
    min-height: 20px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
}

#premium-chat-scope .chat-textarea::placeholder {
    color: #94a3b8;
}

#premium-chat-scope .send-button {
    width: 40px;
    height: 40px;
    border-radius: 18px;
    background: #4e6a8e;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#premium-chat-scope .send-button:hover {
    background: #3d5471;
}

#premium-chat-scope .send-button:active {
    background: #2d3f55;
}

#premium-chat-scope .send-button i {
    font-size: 15px;
    display: block;
}

@media (max-width: 991px) {
    #premium-chat-scope {
        height: 440px;
        border-radius: 10px;
    }

    #premium-chat-scope .chat-history-container {
        padding: 18px 14px;
        gap: 14px;
    }

    #premium-chat-scope .message-bubble {
        max-width: 90%;
        padding: 10px 15px;
        font-size: 14px;
        border-radius: 18px 18px 4px 18px;
    }

    #premium-chat-scope .message-bubble.admin {
        border-radius: 18px 18px 18px 4px;
    }

    #premium-chat-scope .chat-input-wrapper {
        padding: 12px 14px 16px;
    }

    #premium-chat-scope .chat-input-inner {
        border-radius: 20px;
        padding: 5px 5px 5px 15px;
    }

    #premium-chat-scope .send-button {
        width: 38px;
        height: 38px;
        border-radius: 16px;
    }

    #premium-chat-scope .chat-textarea {
        font-size: 15px;
    }
}

@media (max-width: 375px) {
    #premium-chat-scope {
        height: 380px;
    }
    #premium-chat-scope .message-bubble {
        font-size: 13px;
    }
}
/* Кнопка reply на пузыре */
.message-bubble {
    position: relative;
}

.reply-btn {
    display: block;
    position: absolute;
    right: -30px;  /* справа снаружи пузыря */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
}

.reply-btn:hover {
    color: #fff;
}

/* Превью цитаты */
#reply-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.07);
    border-left: 3px solid #4fc3f7;
    font-size: 13px;
    color: #aaa;
}

#reply-preview-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#reply-cancel {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}

#reply-cancel:hover {
    color: #fff;
}

.reply-quote {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a0d4f5;
    border-left: 3px solid #4fc3f7;
    padding: 3px 8px;
    margin-bottom: 5px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-quote i {
    flex-shrink: 0;
    font-size: 11px;
    opacity: 0.7;
}

.reply-quote span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}