Files
nahodka-front/src/styles/chat.css
2026-10-11 23:29:27 +03:00

340 lines
7.2 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ── Chat Page (Instagram Direct style) ── */
.chat-page {
display: flex;
flex-direction: column;
flex: 1;
/* Без min-width:0 flex-элемент не может ужаться ниже своего min-content
(его задаёт .chat-list с max-width:560px). На узком экране страница
становилась шире вьюпорта, и кнопка удаления уезжала за правый край. */
min-width: 0;
height: 100vh; height: 100dvh;
background: var(--bg-app);
}
/* Header */
.chat-header {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 18px;
border-bottom: 1px solid var(--border);
background: var(--bg-surface-solid);
backdrop-filter: blur(12px);
}
.chat-back-btn {
background: none;
border: 1px solid var(--border);
border-radius: 10px;
color: var(--muted);
font-size: 1.2rem;
cursor: pointer;
padding: 6px 12px;
transition: background .15s, color .15s;
}
.chat-back-btn:hover {
background: var(--hover-bg);
color: var(--text-primary);
}
.chat-header-title {
flex: 1;
color: var(--text-primary);
font-weight: 800;
font-size: 1rem;
}
.chat-header-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--bg-input);
border: 2px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.1rem;
flex-shrink: 0;
overflow: hidden;
}
.chat-header-avatar-img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
/* Messages area */
.chat-messages {
flex: 1;
overflow-y: auto;
overscroll-behavior: contain;
padding: 20px;
display: flex;
flex-direction: column;
gap: 8px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px; }
.chat-empty {
text-align: center;
color: var(--muted);
font-size: .9rem;
padding: 40px 0;
}
.chat-empty-full {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
color: var(--muted);
font-size: .95rem;
}
/* Bubbles */
.chat-bubble {
max-width: 70%;
padding: 10px 14px;
border-radius: 18px;
font-size: .92rem;
line-height: 1.45;
align-self: flex-start;
background: var(--bg-surface-solid);
border: 1px solid var(--border);
color: var(--text-primary);
word-break: break-word;
}
.chat-bubble.mine {
align-self: flex-end;
background: #3797f0;
border-color: #3797f0;
color: #fff;
}
.chat-bubble-time {
display: block;
margin-top: 4px;
font-size: .68rem;
line-height: 1;
text-align: right;
opacity: .6;
white-space: nowrap;
}
/* Input row */
.chat-input-row {
display: flex;
gap: 8px;
padding: 14px 16px;
border-top: 1px solid var(--border);
background: var(--bg-surface-solid);
}
.chat-input {
flex: 1;
padding: 12px 18px;
border-radius: 999px;
border: 1px solid var(--border);
background: var(--bg-input);
color: var(--text-primary);
font-family: var(--font);
font-size: .9rem;
outline: none;
transition: border-color .2s, box-shadow .2s;
}
.chat-input::placeholder { color: var(--muted); }
.chat-input:focus { border-color: rgba(var(--teal-rgb), .5); box-shadow: 0 0 0 3px rgba(var(--teal-rgb), .12); }
.chat-send-btn {
padding: 0 20px;
border-radius: 999px;
border: none;
background: var(--teal);
color: #fff;
cursor: pointer;
font-size: 1rem;
font-weight: 900;
transition: background .2s, opacity .2s;
}
.chat-send-btn:hover:not(:disabled) { background: var(--teal2); }
.chat-send-btn:disabled { opacity: .4; cursor: default; }
.chat-input-area {
position: relative;
}
/* ── Chat List ── */
.chat-list {
flex: 1;
overflow-y: auto;
overscroll-behavior: contain;
padding: 8px;
max-width: 560px;
width: 100%;
margin: 0 auto;
}
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px; }
.chat-list-item {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 16px;
border-radius: 14px;
cursor: pointer;
transition: background .15s;
}
.chat-list-item:hover {
background: var(--hover-bg);
}
.chat-list-avatar {
width: 44px;
height: 44px;
border-radius: 50%;
background: var(--bg-input);
border: 2px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.15rem;
font-weight: 800;
color: var(--muted);
flex-shrink: 0;
overflow: hidden;
}
.chat-list-avatar-img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
.chat-list-info {
flex: 1;
min-width: 0;
}
.chat-list-item.unread .chat-list-name {
font-weight: 800;
}
.chat-list-item.unread .chat-list-preview {
color: var(--text-primary);
font-weight: 700;
}
.chat-list-name {
color: var(--text-primary);
font-weight: 700;
font-size: .9rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.chat-list-preview {
color: var(--muted);
font-size: .78rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 3px;
}
/* ── Unread Badge ── */
.chat-list-unread-badge {
background: #ff3040;
color: #fff;
font-size: .7rem;
font-weight: 800;
min-width: 20px;
height: 20px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 6px;
flex-shrink: 0;
}
/* ── Sidebar Unread Badge ── */
.f-sb-unread-badge {
background: #ff3040;
color: #fff;
font-size: .65rem;
font-weight: 800;
min-width: 18px;
height: 18px;
border-radius: 9px;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 5px;
margin-left: auto;
}
/* ── Contact Button on Card ── */
/* Стили .f-card-contact живут в styles/card.css (PostOnFeed) */
.chat-list-delete-btn {
background: rgba(255, 71, 87, .08);
border: 1px solid rgba(255, 71, 87, .2);
border-radius: 10px;
color: rgba(255, 71, 87, .5);
cursor: pointer;
padding: 8px;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity .2s, background .2s, border-color .2s, color .2s;
flex-shrink: 0;
}
.chat-list-item:hover .chat-list-delete-btn {
opacity: 1;
}
.chat-list-delete-btn:hover {
background: rgba(255, 71, 87, .15);
border-color: rgba(255, 71, 87, .4);
color: #ff4757;
}
/* Mobile adjustments */
@media (max-width: 600px) {
.chat-header {
padding: 10px 12px;
}
.chat-input-row {
padding: 10px 12px;
}
.chat-bubble {
max-width: 85%;
}
.chat-list {
padding: 6px 10px;
}
.chat-list-item {
gap: 10px;
padding: 12px 10px;
}
.chat-list-avatar {
width: 40px;
height: 40px;
}
.chat-list-delete-btn {
padding: 8px;
}
}
/* На сенсорных экранах нет hover — показываем кнопку удаления всегда. */
@media (hover: none) {
.chat-list-delete-btn {
opacity: 1;
}
}
/* Безопасная зона под домашним индикатором iPhone (Dynamic Island / iPhone 15+). */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
.chat-page {
padding-bottom: env(safe-area-inset-bottom);
}
.chat-list {
padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
}