/*support widget shown on every non-staff page (see support_widget.html).
  deliberately self contained: it renders on pages that do not load theme.css or
  player_pages.css, so every colour is spelled out here rather than inherited.
  palette and shapes follow the sign in / player page redesign.*/

/*container*/

.support-widget {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/*launcher: sits above the fixed navbar (z-index 1030) but below the ajax loader
  and the auth modal (z-index 2000), which must still cover the whole page.*/

.support-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1035;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: linear-gradient(135deg, #1c222c, #0d1117);
	color: #e0b64f;
	font-size: 1.35rem;
	cursor: pointer;
	box-shadow: 0 8px 24px -6px rgba(13, 17, 23, 0.5);
	transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.support-launcher:hover {
	background: linear-gradient(135deg, #262d3a, #141922);
	color: #ecc25c;
	transform: translateY(-2px);
}

.support-launcher:focus {
	outline: none;
	box-shadow: 0 8px 24px -6px rgba(13, 17, 23, 0.5), 0 0 0 3px rgba(191, 152, 50, 0.35);
}

.support-launcher[hidden] {
	display: none;
}

/*unread badge*/

.support-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 21px;
	height: 21px;
	padding: 0 5px;
	border-radius: 11px;
	background: #d4a53f;
	color: #17130a;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 21px;
	text-align: center;
	box-shadow: 0 0 0 2px #0d1117;
}

.support-badge[hidden] {
	display: none;
}

/*panel*/

.support-panel {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1040;
	width: 380px;
	height: 560px;
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e9e4d8;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(66, 54, 22, 0.05), 0 24px 60px -12px rgba(16, 24, 40, 0.35);
}

.support-panel[hidden] {
	display: none;
}

/*panel header*/

.support-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.95rem 1.1rem;
	border-bottom: 1px solid #f0ece1;
}

.support-head h2 {
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: #1c1917;
	margin: 0;
}

.support-head p {
	font-size: 0.78rem;
	color: #79716b;
	margin: 0.15rem 0 0;
}

.support-close {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #a8a29e;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.support-close:hover {
	background: #f6f3ec;
	color: #1c1917;
}

.support-close:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(191, 152, 50, 0.3);
}

/*thread*/

.support-thread {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 1.1rem;
}

.support-msg {
	display: flex;
	flex-direction: column;
	margin-bottom: 0.9rem;
}

.support-msg-user {
	align-items: flex-end;
}

.support-msg-staff {
	align-items: flex-start;
}

.support-bubble {
	max-width: 85%;
	padding: 0.5rem 0.75rem;
	border-radius: 12px;
	font-size: 0.87rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

.support-msg-user .support-bubble {
	background: rgba(212, 165, 63, 0.16);
	border: 1px solid rgba(191, 152, 50, 0.25);
	color: #44403c;
}

.support-msg-staff .support-bubble {
	background: #faf9f5;
	border: 1px solid #e9e4d8;
	color: #44403c;
}

.support-stamp {
	margin-top: 0.25rem;
	font-size: 0.68rem;
	color: #a8a29e;
}

/*placeholder copy inside the thread and above the guest form*/

.support-hint {
	font-size: 0.85rem;
	line-height: 1.55;
	color: #79716b;
	margin: 0;
}

.support-thread .support-hint {
	padding-top: 1.25rem;
	text-align: center;
}

/*composer*/

.support-compose {
	padding: 0.75rem 0.9rem 0.9rem;
	border-top: 1px solid #f0ece1;
}

.support-compose-row {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
}

.support-compose textarea {
	flex: 1;
	min-width: 0;
	resize: none;
	padding: 0.5rem 0.7rem;
	border: 1px solid #dad5c9;
	border-radius: 9px;
	background: #fff;
	color: #1c1917;
	font-family: inherit;
	font-size: 0.87rem;
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-compose textarea:focus {
	border-color: #bf9832;
	box-shadow: 0 0 0 3px rgba(191, 152, 50, 0.18);
	outline: none;
}

.support-send {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 9px;
	background: linear-gradient(135deg, #1c222c, #0d1117);
	color: #e0b64f;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.support-send:hover:not(:disabled) {
	background: linear-gradient(135deg, #262d3a, #141922);
	color: #ecc25c;
}

.support-send:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(191, 152, 50, 0.35);
}

.support-send:disabled {
	opacity: 0.45;
	cursor: default;
}

/*errors*/

.support-error {
	margin: 0 0 0.5rem;
	font-size: 0.78rem;
	line-height: 1.45;
	color: #b91c1c;
}

.support-error[hidden] {
	display: none;
}

/*guest form*/

.support-guest {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	overflow-y: auto;
	padding: 1.1rem;
}

.support-guest[hidden] {
	display: none;
}

.support-input {
	width: 100%;
	padding: 0.55rem 0.75rem;
	border: 1px solid #dad5c9;
	border-radius: 9px;
	background: #fff;
	color: #1c1917;
	font-family: inherit;
	font-size: 0.88rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-input:focus {
	border-color: #bf9832;
	box-shadow: 0 0 0 3px rgba(191, 152, 50, 0.18);
	outline: none;
}

.support-input.bad-input,
.support-input.bad-input:focus {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.support-guest-body {
	flex: 1;
	min-height: 120px;
	resize: none;
	line-height: 1.5;
}

.support-guest-send {
	flex-shrink: 0;
	height: 42px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #1c222c, #0d1117);
	color: #e0b64f;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.support-guest-send:hover:not(:disabled) {
	background: linear-gradient(135deg, #262d3a, #141922);
	color: #ecc25c;
}

.support-guest-send:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(191, 152, 50, 0.35);
}

.support-guest-send:disabled {
	opacity: 0.55;
	cursor: default;
}

/*guest confirmation*/

.support-sent {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 1.5rem;
	text-align: center;
}

.support-sent[hidden] {
	display: none;
}

.support-sent .fa {
	font-size: 1.75rem;
	color: #16a34a;
}

.support-sent p {
	font-size: 0.88rem;
	line-height: 1.55;
	color: #44403c;
	margin: 0;
}

.support-sent span {
	font-weight: 600;
	color: #8f6a14;
}

.support-again {
	border: none;
	background: transparent;
	color: #79716b;
	font-size: 0.8rem;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}

.support-again:hover {
	color: #1c1917;
}

/*responsive: phones and small tablets. the widget stays available here (unlike the
  desktop-only original), so the panel becomes a full height sheet rather than a
  floating card that would not fit, and the launcher shrinks out of the way.*/

@media (max-width: 575.98px) {
	.support-launcher {
		right: 16px;
		bottom: 16px;
		width: 50px;
		height: 50px;
		font-size: 1.2rem;
	}

	.support-panel {
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		height: auto;
		top: 60px;   /*height of the collapsed navbar at this breakpoint, so the sheet sits under it rather than over it*/
		max-height: none;
		border-radius: 16px 16px 0 0;
		border-left: none;
		border-right: none;
		border-bottom: none;
	}

	.support-thread,
	.support-guest {
		padding-left: 0.9rem;
		padding-right: 0.9rem;
	}

	/*keep the composer clear of the phone's home indicator*/
	.support-compose {
		padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
	}
}
