/* ── OverviewTab — server name + icon editor ─────────────────────────
   Shared between desktop ServerSettingsModal and mobile MobileServerSettings.
   The component branches its layout off `mobile` so the same form
   logic powers both styles. Mobile variant uses the now-familiar
   rounded-card pattern; desktop uses the existing inline form look. */

.root {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.heading {
	font-size: 20px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
}

/* ── Icon picker ────────────────────────────────────────────────────*/

.iconBlock {
	display: flex;
	align-items: center;
	gap: 16px;
}

.iconPreviewWrap {
	position: relative;
	flex-shrink: 0;
}

.iconPreview {
	width: 96px;
	height: 96px;
	border-radius: 24px;
	object-fit: cover;
	background-color: var(--background-secondary-alt);
	display: block;
}

.iconInitials {
	width: 96px;
	height: 96px;
	border-radius: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--background-secondary-alt);
	color: var(--text-primary);
	font-size: 32px;
	font-weight: 700;
}

.iconBadge {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background-color: var(--brand-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 3px solid var(--background-secondary);
	pointer-events: none;
}

.iconActions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.iconActionsHelp {
	font-size: 12px;
	color: var(--text-primary-muted);
	margin: 0;
}

.iconButton {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid var(--background-modifier-accent, rgba(255, 255, 255, 0.1));
	border-radius: 8px;
	background-color: var(--background-secondary-alt);
	color: var(--text-primary);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.iconButton:active {
	background-color: var(--background-modifier-hover);
}

.iconButtonDanger {
	color: hsl(350, calc(90% * var(--saturation-factor)), 65%);
	border-color: hsla(350, calc(90% * var(--saturation-factor)), 65%, 0.3);
}

/* ── Name field ─────────────────────────────────────────────────────*/

.fieldLabel {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--text-primary-muted);
	margin: 0 0 4px;
}

.nameInput {
	width: 100%;
	padding: 12px 14px;
	background-color: var(--background-secondary-alt);
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--text-primary);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.nameInput:focus,
.nameInput:focus-visible {
	border-color: var(--brand-primary);
	outline: none;
}

/* ── Save / status row ──────────────────────────────────────────────*/

.actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 4px;
}

.saveButton {
	padding: 10px 18px;
	background-color: var(--brand-primary);
	border: none;
	border-radius: 8px;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.saveButton:active:not(:disabled) {
	filter: brightness(0.92);
}

.saveButton:disabled {
	opacity: 0.5;
	cursor: default;
}

.status {
	padding: 10px 14px;
	border-radius: 0.5rem;
	font-size: 13px;
}

.statusSuccess {
	background-color: hsl(139, calc(47.3% * var(--saturation-factor)), 20%);
	color: hsl(139, calc(47.3% * var(--saturation-factor)), 85%);
}

.statusError {
	background-color: hsl(0, calc(60% * var(--saturation-factor)), 22%);
	color: hsl(0, calc(80% * var(--saturation-factor)), 85%);
}

.gate {
	padding: 32px 16px;
	text-align: center;
}

.gateTitle {
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 8px;
}

.gateBody {
	font-size: 14px;
	color: var(--text-primary-muted);
	margin: 0;
}

/* ── Mobile variant overrides ───────────────────────────────────────
   When `mobile` is true the component renders the same widgets but
   with the rounded-card chrome the rest of the mobile settings tabs
   use. The inline overrides below tweak spacing / colors so it sits
   inside MobileServerSettings comfortably. */

.mobileRoot {
	gap: 16px;
}

.mobileIconBlock {
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.mobileNameCard {
	background-color: var(--background-secondary);
	border-radius: 0.75rem;
	padding: 14px 16px;
}

.mobileNameCard .nameInput {
	background: transparent;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	border: none;
}

.mobileNameCard .nameInput:focus,
.mobileNameCard .nameInput:focus-visible {
	border: none;
}

.mobileFieldLabel {
	padding: 0 4px 6px;
	margin: 0;
}

.mobileSaveButton {
	width: 100%;
	padding: 14px;
	font-size: 15px;
	border-radius: 0.75rem;
}

.mobileActions {
	margin-top: 0;
}

/* ── Idle / AFK settings ─────────────────────────────────────── */

.idleSection {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--background-modifier-accent);
}

.idleHeading {
	font-size: 15px;
	font-weight: 700;
	color: var(--text-primary);
}

.idleDescription {
	font-size: 13px;
	color: var(--text-secondary);
	margin: 0 0 4px 0;
}

.idleRow {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 768px) {
	.idleRow {
		grid-template-columns: 1fr;
	}
}

.idleField {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.idleSelect {
	height: 40px;
	padding: 0 12px;
	border-radius: var(--radius-md, 6px);
	background-color: var(--background-tertiary);
	color: var(--text-primary);
	border: none;
	font-size: 0.9375rem;
	font-family: inherit;
	outline: none;
	cursor: pointer;
}

.idleSelect:focus {
	outline: 2px solid var(--brand-primary);
	outline-offset: -2px;
}
