/* Messages page (Zprávy): folders, conversation list and chat. */

.messages { padding: 24px var(--gutter) 48px; }

.count {
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-pill);
	background: var(--brand);
	font-size: 0.6875rem;
	font-weight: 700;
	color: #FFFFFF;
}

/* ---------- Folders ---------- */
.folders {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.folder {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--border-default);
	border-radius: var(--radius-pill);
	background: var(--surface-card);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.9375rem;
	white-space: nowrap;
	color: var(--ink-900);
	cursor: pointer;
	transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.folder i { font-size: 18px; }

.folder__count {
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-pill);
	background: var(--cream-200);
	font-size: 0.75rem;
	color: var(--ink-700);
}

.folder.is-active {
	border-color: var(--secondary);
	background: var(--secondary);
	color: #FFFFFF;
}
.folder.is-active .folder__count {
	background: rgba(255, 255, 255, 0.25);
	color: #FFFFFF;
}

/* ---------- Two panels ---------- */
.inbox {
	display: grid;
	grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
	gap: 16px;
	align-items: stretch;
}

.inbox__list,
.chat {
	min-width: 0;
	height: 720px;
	display: flex;
	flex-direction: column;
}

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

.inbox__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.inbox__title {
	font-weight: 800;
	font-size: 1.875rem;
}

.inbox__new {
	min-height: 44px;
	padding: 0 18px;
	border-radius: var(--radius-md);
	font-size: 0.9375rem;
}
.inbox__new i { font-size: 18px; }

.inbox__tabs { width: auto; }
.inbox__tabs .segment__btn {
	flex: 1;
	min-height: 36px;
	padding: 0 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 0.8125rem;
}

.inbox__search {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 14px;
	border: 1.5px solid var(--border-default);
	border-radius: var(--radius-md);
	background: var(--cream-100);
	transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.inbox__search:focus-within {
	border-color: var(--secondary);
	box-shadow: 0 0 0 4px var(--ring);
}
.inbox__search i {
	font-size: 18px;
	color: var(--ink-500);
}
.inbox__search input {
	flex: 1;
	min-width: 0;
	padding: 12px 0;
	border: 0;
	background: transparent;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--text-primary);
	outline: none;
}

.inbox__threads {
	flex: 1;
	overflow: auto;
	padding: 10px;
}

.thread-list__empty {
	padding: 40px 20px;
	text-align: center;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--text-muted);
}

.thread {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
	border: 0;
	border-radius: var(--radius-lg);
	background: transparent;
	text-align: left;
	cursor: pointer;
	transition: background var(--dur-fast);
}
.thread:hover { background: var(--cream-100); }
.thread.is-active { background: var(--cream-200); }

.thread__avatar {
	position: relative;
	flex-shrink: 0;
}
.thread__avatar img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
}

.thread__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.thread__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}
.thread__row:first-child { align-items: baseline; }

.thread__name {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 1rem;
	color: var(--ink-900);
}

.thread__time {
	font-size: 0.75rem;
	white-space: nowrap;
	color: var(--text-muted);
}

.thread__last {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-secondary);
}
.thread.is-unread .thread__last { font-weight: 700; }

.thread__unread {
	flex-shrink: 0;
	min-width: 22px;
	height: 22px;
	font-size: 0.75rem;
}

/* ---------- Chat ---------- */
.chat__thread {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.chat__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
}

.chat__back {
	display: none;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--radius-md);
	background: transparent;
	font-size: 22px;
	color: var(--ink-700);
	cursor: pointer;
}

.chat__avatar {
	position: relative;
	flex-shrink: 0;
}
.chat__avatar img {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	object-fit: cover;
}
.chat__avatar .online-dot {
	width: 15px;
	height: 15px;
}

.chat__who {
	flex: 1;
	min-width: 0;
}

.chat__name-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.chat__name {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 1.25rem;
	color: var(--ink-900);
}

.chat__online { padding: 3px 10px; line-height: 1.2; }

.chat__city {
	margin-top: 2px;
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.chat__tools {
	display: flex;
	gap: 8px;
}
.chat__fav i { color: var(--secondary); }
.chat__tools .icon-btn:last-child { font-size: 22px; }

.chat__match {
	margin: 0 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--radius-lg);
	background: var(--cream-200);
}

.chat__match-icon {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #FFFFFF;
	font-size: 17px;
	color: var(--like);
}

.chat__match-text {
	flex: 1;
	min-width: 180px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--text-primary);
}

.chat__profile {
	padding: 9px 16px;
	border: 1.5px solid var(--border-default);
	border-radius: var(--radius-md);
	background: #FFFFFF;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.875rem;
	white-space: nowrap;
	color: var(--text-link);
}

.chat__messages {
	flex: 1;
	overflow: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.bubble {
	max-width: 72%;
	padding: 12px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.bubble__text { text-wrap: pretty; }

.bubble__time {
	align-self: flex-end;
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.75rem;
}
.bubble__time i { font-size: 14px; }

.bubble--mine {
	align-self: flex-end;
	border-radius: 18px 18px 6px 18px;
	background: var(--secondary);
	color: #FFFFFF;
}
.bubble--mine .bubble__time { color: rgba(255, 255, 255, 0.85); }

.bubble--theirs {
	align-self: flex-start;
	border-radius: 18px 18px 18px 6px;
	background: var(--cream-200);
	color: var(--text-primary);
}
.bubble--theirs .bubble__time { color: var(--text-muted); }

.composer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 20px;
	border-top: 1px solid var(--border-subtle);
}

.composer__tool {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--radius-md);
	background: transparent;
	font-size: 22px;
	color: var(--ink-700);
	cursor: pointer;
}

.composer__input {
	flex: 1;
	min-width: 0;
	padding: 13px 16px;
	border: 1.5px solid var(--border-default);
	border-radius: var(--radius-md);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--text-primary);
	outline: none;
	transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.composer__input:focus {
	border-color: var(--secondary);
	box-shadow: 0 0 0 4px var(--ring);
}

.composer__send {
	width: 50px;
	height: 50px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--radius-md);
	background: var(--secondary);
	font-size: 22px;
	color: #FFFFFF;
	cursor: pointer;
	transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.composer__send:hover { background: var(--secondary-hover); }
.composer__send:active { transform: scale(0.96); }

/* ---------- Phone: one panel, list → chat ---------- */
@media (max-width: 759px) {
	.inbox { grid-template-columns: 1fr; }
	.inbox__list,
	.chat { height: 640px; }
	.inbox .chat { display: none; }
	.inbox.is-chat-open .inbox__list { display: none; }
	.inbox.is-chat-open .chat { display: flex; }
	.chat__back { display: flex; margin-left: -10px; }
	.chat__head { padding: 14px 16px; gap: 10px; }
	.chat__tools .icon-btn { width: 44px; height: 44px; }
	.chat__match { margin: 0 16px; }
	.chat__messages { padding: 16px; }
	.bubble { max-width: 85%; }
	.composer { padding: 12px 14px; gap: 4px; }
}
