/* /css/chat/style.css */

.chat-wrap {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-header-info {
    font-size: 13px;
    color: #9ca3af;
    padding: 10px 0;
}

/* ---- Новая тема ---- */
.chat-new-thread {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chat-new-thread h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #374151;
    margin-bottom: 10px;
}
.chat-new-thread textarea {
    width: 100%;
    height: 72px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    font-family: Arial, sans-serif;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.chat-new-thread textarea:focus { border-color: #a855f7; }
.chat-new-thread .chat-submit-btn {
    margin-top: 10px;
    background: linear-gradient(90deg, #e84393, #a855f7);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.chat-new-thread .chat-submit-btn:hover { opacity: 0.88; }

/* ---- Тема ---- */
.chat-thread {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ---- Шапка ---- */
.chat-thread-header {
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.chat-thread-user {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1f2937;
}
.chat-thread-user img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-thread-username {
    font-size: 13px;
    font-weight: 700;
}

/* ---- Меню 3 точки ---- */
.chat-menu-wrap { position: relative; flex-shrink: 0; }
.chat-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    letter-spacing: 2px;
    color: #9ca3af;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.chat-menu-btn:hover { background: #f3f4f6; color: #374151; }
.chat-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 200;
    min-width: 190px;
    overflow: hidden;
}
.chat-menu-dropdown.open { display: block; }
.chat-menu-dropdown form { margin: 0; padding: 0; }
.chat-menu-dropdown form button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    padding: 10px 16px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    font-family: Arial, sans-serif;
}
.chat-menu-dropdown form:last-child button { border-bottom: none; }
.chat-menu-dropdown form button:hover { background: #f9fafb; }
.chat-menu-dropdown .menu-danger { color: #ef4444 !important; }

/* ---- Контейнер сообщений ---- */
.chat-messages { padding: 8px 0; }

/* ---- Дата-разделитель по центру (как в Telegram) ---- */
.chat-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 6px;
}








.chat-date-divider span {
    background: rgba(0,0,0,0.07);
    color: #6b7280;
    font-size: 16px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}








/* ---- Строка сообщения ---- */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 1px 12px;
}
.chat-msg-left  { flex-direction: row; }
.chat-msg-right { flex-direction: row-reverse; }

/* ---- Аватарка = ссылка ---- */
.chat-msg-avatar {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
}
.chat-msg-avatar img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s;
}
.chat-msg-avatar:hover img { opacity: 0.75; }

/* ---- Тело сообщения ---- */
.chat-msg-body {
    max-width: 60%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.chat-msg-right .chat-msg-body {
    align-items: flex-end;
}





/* ---- Пузырь ---- */
.chat-bubble {
    width: fit-content;
    max-width: 100%;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 20px;
    line-height: 1.4;
    word-break: break-word;
}







.bubble-left {
    background: #f0f0f0;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}
.bubble-right {
    background: linear-gradient(135deg, #e84393, #a855f7);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ---- Время внутри пузыря ---- */
.bubble-time {
    display: inline-block;
    font-size: 10px;
    opacity: 0.6;
    margin-left: 6px;
    vertical-align: bottom;
    white-space: nowrap;
    line-height: 1;
    position: relative;
    top: 1px;
}

/* ---- Плашки ---- */
.chat-private-notice {
    margin: 6px 14px;
    padding: 7px 12px;
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
}
.chat-hidden-notice {
    padding: 6px 14px;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}
.chat-closed-notice {
    padding: 10px 14px;
    font-size: 13px;
    color: #ef4444;
    border-top: 1px solid #fee2e2;
    background: #fff5f5;
}
.chat-empty {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
    font-size: 15px;
}

/* ---- Форма ответа ---- */
.chat-reply-form {
    border-top: 1px solid #e5e7eb;
    padding: 10px 14px;
}
.chat-reply-form form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.chat-reply-form textarea {
    flex: 1;
    height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    resize: none;
    font-family: Arial, sans-serif;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.chat-reply-form textarea:focus { border-color: #a855f7; }
.chat-reply-form button {
    background: linear-gradient(90deg, #e84393, #a855f7);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.chat-reply-form button:hover { opacity: 0.88; }

/* ---- Mobile ---- */
@media (max-width: 1024px) {
    .chat-msg-body { max-width: 75%; }
    .chat-msg { padding: 1px 8px; }
    .chat-bubble { font-size: 14px; }
}