/*
 * Netraha VPN — the customer's ticket pages ([nvpn_tickets], 3.48.0).
 *
 * Loaded after site.css and built on it: the card, the buttons, the pills, the notes and the form boxes are the
 * dashboard's and the contact form's own (.nvpn-card, .nvpn-btn, .nvpn-pill, .nvpn-note, .nvpn-contact__in).
 * This file only lays the three views out. Colours come from the --netraha-* tokens alone; logical properties
 * throughout, so one code serves Persian (RTL) and English (LTR). No shadows, no gradients.
 */

.nvpn-sc.nvpn-tk {
	display: grid;
	gap: var(--nvpn-gap);
	max-inline-size: 860px;
}

/* Telegram first: a strip of its own on top of every view, readable on the page's ground whatever its colour */
.nvpn-tk .nvpn-tk__intro {
	margin: 0;
	border: 1px solid var(--netraha-border);
	background: var(--netraha-surface);
}

.nvpn-tk .nvpn-tk__intro .nvpn-btn {
	margin-inline-start: 0;
}

.nvpn-tk__intro > span {
	flex: 1 1 260px;
}

.nvpn-tk__card > :last-child {
	margin-block-end: 0;
}

.nvpn-tk__card h2 {
	margin: 0;
	font-size: 22px;
	font-weight: var(--nvpn-weight-black);
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.nvpn-tk__card > h2 {
	margin-block-end: 8px;
}

.nvpn-tk__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	margin-block-end: 16px;
}

.nvpn-tk__head > h2 {
	flex: 1 1 240px;
	min-inline-size: 0;
}

.nvpn-tk__actions {
	margin: 16px 0 0;
}

.nvpn-tk__empty {
	margin: 0;
	padding: 28px 16px;
	border: 1px dashed var(--netraha-border);
	border-radius: var(--nvpn-radius-row);
	color: var(--netraha-muted);
	text-align: center;
}

.nvpn-tk__back {
	margin: 0 0 12px;
	font-size: 14px;
}

.nvpn-tk__back a,
.nvpn-tk__guest-contact a {
	color: var(--netraha-green);
	font-weight: var(--nvpn-weight-bold);
	text-underline-offset: 0.2em;
}

/* the arrow points back the way the page reads: to the right in Persian, to the left in English */
.nvpn-tk__back a::before {
	content: "\2190";
	display: inline-block;
	margin-inline-end: 6px;
}

[dir="rtl"] .nvpn-tk__back a::before {
	content: "\2192";
}

/* ------------------------------------------------------------------
   The list
   ------------------------------------------------------------------ */
.nvpn-tk__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-end: 16px;
}

.nvpn-sc .nvpn-tk__filter {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-block-size: 40px;
	padding: 6px 14px;
	border: 1px solid var(--netraha-border);
	border-radius: 999px;
	background: var(--netraha-surface);
	color: var(--netraha-ink);
	font-size: 14px;
	font-weight: var(--nvpn-weight-bold);
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.nvpn-sc .nvpn-tk__filter:hover {
	border-color: var(--netraha-green);
	color: var(--netraha-green);
}

.nvpn-sc .nvpn-tk__filter[aria-current="true"] {
	border-color: var(--netraha-deep);
	background: var(--netraha-deep);
	color: var(--nvpn-on-dark);
}

.nvpn-tk__n {
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	opacity: 0.8;
}

.nvpn-tk__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.nvpn-tk__item {
	margin: 0;
}

.nvpn-sc .nvpn-tk__item > a {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 6px 12px;
	padding: 14px 16px;
	border: 1px solid var(--netraha-border);
	border-radius: var(--nvpn-radius-row);
	background: var(--netraha-surface);
	color: var(--netraha-ink);
	text-decoration: none;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.nvpn-sc .nvpn-tk__item > a:hover {
	border-color: var(--netraha-green);
	background: var(--netraha-bg);
}

/* an unread answer: a gold edge at the start of the row, next to the «new answer» pill (never colour alone) */
.nvpn-sc .nvpn-tk__item.is-unread > a {
	border-inline-start: 4px solid var(--netraha-gold);
	padding-inline-start: 13px;
}

.nvpn-tk__subject {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.nvpn-tk__item.is-unread .nvpn-tk__subject {
	font-weight: var(--nvpn-weight-black);
}

.nvpn-tk__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
}

.nvpn-tk__meta {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 2px 16px;
	color: var(--netraha-muted);
	font-size: 13px;
	line-height: 1.7;
}

.nvpn-tk__meta bdi {
	font-variant-numeric: tabular-nums;
	font-weight: var(--nvpn-weight-bold);
}

.nvpn-tk__pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-block-start: 16px;
}

.nvpn-tk .nvpn-tzline {
	margin: 12px 0 0;
	font-size: 13px;
}

/* ------------------------------------------------------------------
   The forms (the boxes are the contact form's)
   ------------------------------------------------------------------ */
.nvpn-tk__form {
	display: grid;
	gap: 18px;
	margin: 16px 0 0;
}

.nvpn-tk__count {
	text-align: end;
	font-variant-numeric: tabular-nums;
}

.nvpn-tk__count.is-near {
	color: var(--netraha-danger-ink);
	font-weight: var(--nvpn-weight-bold);
}

.nvpn-sc .nvpn-tk__file {
	inline-size: 100%;
	min-block-size: 48px;
	padding: 8px 10px;
	border: 1px dashed var(--netraha-border);
	border-radius: var(--nvpn-radius-btn);
	background: var(--netraha-surface);
	color: var(--netraha-ink);
	font: inherit;
	font-size: 14px;
}

.nvpn-sc .nvpn-tk__form .nvpn-btn[aria-busy="true"] {
	opacity: 0.7;
	cursor: progress;
}

/* ------------------------------------------------------------------
   One ticket
   ------------------------------------------------------------------ */
.nvpn-tk__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
	margin: 0 0 20px;
	padding: 12px 16px;
	border-radius: var(--nvpn-radius-row);
	background: var(--netraha-bg);
}

.nvpn-tk__facts > div {
	min-inline-size: 0;
}

.nvpn-tk__facts dt {
	color: var(--netraha-muted);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
}

.nvpn-tk__facts dd {
	margin: 0;
	font-size: 14px;
	font-weight: var(--nvpn-weight-bold);
	line-height: 1.7;
	overflow-wrap: anywhere;
}

.nvpn-tk__thread {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}

/* the customer's own words stand at the end side, the answers at the start side; each also carries its name */
.nvpn-tk__msg {
	inline-size: fit-content;
	min-inline-size: min(100%, 240px);
	max-inline-size: 88%;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--netraha-border);
	border-radius: var(--nvpn-radius-row);
}

.nvpn-tk__msg--customer {
	justify-self: end;
	background: var(--netraha-bg);
}

.nvpn-tk__msg--support {
	justify-self: start;
	border-color: transparent;
	background: var(--netraha-ok-bg);
	color: var(--netraha-ok-ink);
}

.nvpn-tk__msghead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin-block-end: 6px;
	font-size: 13px;
	line-height: 1.6;
}

.nvpn-tk__time {
	margin-inline-start: auto;
	opacity: 0.85;
	font-size: 12px;
}

.nvpn-tk__ai {
	padding: 1px 8px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 11px;
	font-weight: var(--nvpn-weight-bold);
	line-height: 1.6;
	white-space: nowrap;
}

.nvpn-tk__body {
	font-size: 15px;
	line-height: 1.9;
	overflow-wrap: anywhere;
	text-align: start;
}

.nvpn-tk__files {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	font-size: 14px;
}

.nvpn-tk__files a {
	color: inherit;
	overflow-wrap: anywhere;
}

.nvpn-tk__files img {
	display: block;
	inline-size: 96px;
	block-size: 96px;
	object-fit: cover;
	border: 1px solid var(--netraha-border);
	border-radius: 8px;
	background: var(--netraha-surface);
}

.nvpn-tk__reply {
	margin-block-start: 24px;
	padding-block-start: 20px;
	border-block-start: 1px solid var(--netraha-border);
	scroll-margin-block-start: 80px;
}

.nvpn-tk__reply > .nvpn-note:first-child {
	margin-block-start: 0;
}

.nvpn-tk__reply .nvpn-tk__form {
	margin-block-start: 0;
}

.nvpn-sc .nvpn-tk__reply textarea.nvpn-contact__in {
	min-block-size: 132px;
}

.nvpn-tk__side {
	margin: 14px 0 0;
}

#nvpn-tk-done {
	scroll-margin-block-start: 80px;
}

@media (max-width: 599.98px) {
	.nvpn-tk__card h2 {
		font-size: 20px;
	}

	/* a long subject keeps the whole line; its status chip goes under it */
	.nvpn-tk__head > h2 {
		flex-basis: 100%;
	}

	.nvpn-tk__head > .nvpn-btn {
		inline-size: 100%;
	}

	.nvpn-tk__msg {
		max-inline-size: 100%;
	}

	.nvpn-sc .nvpn-tk__item > a {
		grid-template-columns: minmax(0, 1fr);
	}

	.nvpn-tk__chips {
		justify-content: flex-start;
	}

	.nvpn-tk__time {
		margin-inline-start: 0;
		flex: 1 0 100%;
	}

	.nvpn-sc .nvpn-tk__side .nvpn-btn {
		inline-size: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nvpn-sc .nvpn-tk__filter,
	.nvpn-sc .nvpn-tk__item > a {
		transition: none;
	}
}
