/* Obsession premium UI layer
 * Scoped, dependency-free enhancements for stronger contrast, glass panels,
 * responsive moderation tools, profile popovers, and the desktop chat shell.
 */

:root {
	--obs-red: #ff334d;
	--obs-red-strong: #ff1838;
	--obs-red-soft: rgba(255, 51, 77, .16);
	--obs-coral: #ff7a65;
	--obs-violet: #9b72ff;
	--obs-cyan: #2dd4e7;
	--obs-gold: #ffc857;
	--obs-green: #3ddc97;
	--obs-ink: #07070a;
	--obs-panel: rgba(13, 13, 18, .82);
	--obs-panel-strong: rgba(18, 18, 25, .94);
	--obs-panel-soft: rgba(255, 255, 255, .045);
	--obs-border: rgba(255, 255, 255, .115);
	--obs-border-strong: rgba(255, 255, 255, .19);
	--obs-text: #f7f7fa;
	--obs-muted: #aaa8b2;
	--obs-shadow: 0 22px 70px rgba(0, 0, 0, .48);
	--obs-radius: 14px;
	--obs-radius-sm: 9px;
}

body {
	--primary: var(--obs-red);
	--primary-hover: var(--obs-red-strong);
	--danger: var(--obs-red-strong);
}

.btn,
.form-control,
.custom-select,
.card,
.profile-panel,
.popover,
.modal-content {
	transition: border-color .2s ease, background-color .2s ease, color .2s ease,
		box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}

.btn-primary,
.btn-danger {
	color: #fff !important;
	border-color: rgba(255, 255, 255, .12) !important;
	background: linear-gradient(135deg, var(--obs-red), var(--obs-red-strong)) !important;
	box-shadow: 0 8px 24px rgba(255, 36, 66, .2);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-danger:hover,
.btn-danger:focus {
	color: #fff !important;
	border-color: rgba(255, 255, 255, .28) !important;
	background: linear-gradient(135deg, #ff5269, #ff1536) !important;
	box-shadow: 0 10px 30px rgba(255, 36, 66, .33) !important;
	transform: translateY(-1px);
}

.btn-success {
	border-color: rgba(61, 220, 151, .3) !important;
	background: linear-gradient(135deg, #1c8f62, var(--obs-green)) !important;
	box-shadow: 0 8px 24px rgba(61, 220, 151, .14);
}

.btn-warning {
	color: #15120a !important;
	border-color: rgba(255, 200, 87, .34) !important;
	background: linear-gradient(135deg, #f2a93b, var(--obs-gold)) !important;
}

.btn-secondary {
	border: 1px solid var(--obs-border) !important;
	background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035)) !important;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
}

.btn-secondary:hover,
.btn-secondary:focus {
	border-color: rgba(255, 51, 77, .45) !important;
	background: linear-gradient(180deg, rgba(255, 51, 77, .15), rgba(255, 255, 255, .055)) !important;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .09) !important;
	transform: translateY(-1px);
}

.form-control:focus,
.custom-select:focus {
	border-color: var(--obs-red) !important;
	box-shadow: 0 0 0 3px rgba(255, 51, 77, .16) !important;
}

.text-primary,
a.text-primary,
.nav-link.active,
.emojitab.active {
	color: var(--obs-red) !important;
}

.bg-primary {
	background-color: var(--obs-red) !important;
}

::selection {
	color: #fff;
	background: rgba(255, 51, 77, .65);
}

:focus-visible {
	outline: 2px solid var(--obs-cyan) !important;
	outline-offset: 2px;
}

/* Full profile moderation tools */
.profile-moderation {
	overflow: hidden;
	margin-top: 18px;
	border: 1px solid var(--obs-border) !important;
	border-radius: var(--obs-radius);
	background:
		radial-gradient(circle at 12% 0%, rgba(155, 114, 255, .1), transparent 34%),
		linear-gradient(145deg, rgba(18, 18, 25, .92), rgba(8, 8, 12, .9));
	box-shadow: var(--obs-shadow);
	backdrop-filter: blur(18px) saturate(125%);
}

.profile-moderation > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
	padding: 16px 20px;
	color: var(--obs-text);
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: .015em;
	cursor: pointer;
	list-style: none;
	background: linear-gradient(90deg, rgba(255, 51, 77, .12), transparent 45%);
}

.profile-moderation > summary::-webkit-details-marker {
	display: none;
}

.profile-moderation > summary .fa-chevron-down {
	color: var(--obs-red);
	transition: transform .22s ease;
}

.profile-moderation[open] > summary .fa-chevron-down {
	transform: rotate(180deg);
}

.profile-moderation__body {
	padding: 18px;
	border-top: 1px solid var(--obs-border);
}

.profile-moderation .admintools-user-lower-desktop,
.profile-moderation .admintools-user-lower-mobile {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.profile-moderation .admintools-user-lower-desktop > .body,
.profile-moderation .admintools-user-lower-mobile > .body,
.profile-moderation .admintools-user-lower-desktop > form,
.profile-moderation .admintools-user-lower-mobile > form {
	min-width: 0;
	margin: 0 !important;
	padding: 14px !important;
	border: 1px solid var(--obs-border) !important;
	border-radius: 11px;
	background: rgba(255, 255, 255, .035);
}

.profile-moderation form .form-control {
	min-height: 43px;
	margin-bottom: 9px;
	font-size: .88rem !important;
	border-color: rgba(255, 255, 255, .12);
	background: rgba(3, 3, 6, .72);
}

.profile-moderation .custom-control {
	min-height: 30px;
	margin: 4px 0 8px !important;
}

.profile-moderation .btn,
.profile-moderation input[type="submit"] {
	min-height: 42px;
	padding: 9px 14px;
	font-size: .86rem;
	font-weight: 750;
	white-space: normal;
}

.profile-moderation .actionbtns {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 !important;
	padding: 14px;
	border: 1px solid var(--obs-border);
	border-radius: 11px;
	background: linear-gradient(135deg, rgba(255, 51, 77, .055), rgba(45, 212, 231, .035));
}

.profile-moderation .actionbtns > form,
.profile-moderation .actionbtns > .btn {
	margin: 0 !important;
}

.profile-moderation .actionbtns > form {
	display: inline-flex;
}

.profile-moderation .moderation-asset-actions {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin: 0 !important;
	padding: 14px !important;
	border: 1px solid var(--obs-border) !important;
	border-radius: 11px;
	background: rgba(255, 200, 87, .045);
}

.profile-moderation .moderation-asset-actions .text-small {
	flex-basis: 100%;
	margin: 0 !important;
	color: #d7d2c9 !important;
	font-weight: 750;
	letter-spacing: .02em;
}

/* Desktop chat shell: keep the composer fully visible and uncropped. */
@media (min-width: 992px) {
	body#chat {
		display: flex;
		flex-direction: column;
		height: 100dvh !important;
		min-height: 620px;
		overflow: hidden !important;
	}

	body#chat > header,
	body#chat > nav {
		flex: 0 0 auto;
	}

	body#chat > .container.pb-4 {
		flex: 1 1 auto;
		height: auto !important;
		min-height: 0;
		padding-top: 12px;
		padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
		overflow: hidden;
	}

	body#chat #main-content-row {
		height: 100% !important;
		min-height: 0;
		margin: 0;
		padding: 0;
		overflow: hidden;
	}

	body#chat #main-content-col {
		display: flex;
		flex-direction: column;
		height: 100%;
		min-height: 0;
		padding-bottom: 2px;
		overflow: hidden;
	}

	body#chat #shrink {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		overflow: hidden;
	}

	body#chat #chat-window {
		flex: 1 1 auto;
		min-height: 140px;
		max-height: none !important;
		padding: 8px 10px 18px !important;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	body#chat #quotes,
	body#chat #chat-typing-row,
	body#chat #chat-status,
	body#chat #message {
		flex: 0 0 auto;
	}

	body#chat #message {
		position: relative !important;
		bottom: auto !important;
		z-index: 8;
		gap: 7px;
		margin: 6px 0 0 !important;
		padding: 10px;
		border: 1px solid var(--obs-border-strong);
		border-radius: 12px;
		background: rgba(12, 12, 17, .94);
		box-shadow: 0 -10px 36px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .05);
		backdrop-filter: blur(18px) saturate(130%);
	}

	body#chat #input-text {
		min-height: 44px;
		max-height: 126px;
		padding: 10px 12px;
		resize: vertical;
	}

	body#chat #chatsend {
		min-width: 44px;
		min-height: 44px;
		margin-left: 4px !important;
		border-radius: 10px;
	}

	body#chat .chat-online-column {
		height: 100%;
		min-height: 0;
		padding-top: 12px !important;
		overflow: hidden;
	}

	body#chat .chat-online-column #online {
		max-height: calc(100% - 36px) !important;
	}
}

body#chat #main-content-row {
	border: 1px solid var(--obs-border);
	border-radius: var(--obs-radius);
	background:
		radial-gradient(circle at 65% 0%, rgba(255, 51, 77, .055), transparent 33%),
		rgba(7, 7, 10, .73);
	box-shadow: var(--obs-shadow);
	backdrop-filter: blur(15px) saturate(120%);
}

body#chat .chat-group {
	margin-top: 9px;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: rgba(255, 255, 255, .027);
}

body#chat .chat-group:hover {
	border-color: rgba(255, 51, 77, .18);
	background: rgba(255, 255, 255, .045);
}

body#chat .chat-line {
	padding-top: 5px;
	padding-bottom: 5px;
}

/* Small motion details, disabled for reduced-motion users. */
@keyframes obsSoftIn {
	from { opacity: 0; transform: translateY(7px) scale(.992); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-moderation[open] .profile-moderation__body,
.popover.show .popover-user-profile {
	animation: obsSoftIn .2s ease-out both;
}

@media (max-width: 991.98px) {
	.profile-moderation .admintools-user-lower-desktop,
	.profile-moderation .admintools-user-lower-mobile {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575.98px) {
	.profile-moderation__body {
		padding: 11px;
	}

	.profile-moderation .admintools-user-lower-desktop,
	.profile-moderation .admintools-user-lower-mobile {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.profile-moderation .actionbtns,
	.profile-moderation .moderation-asset-actions {
		display: grid;
		grid-template-columns: 1fr;
	}

	.profile-moderation .actionbtns > form,
	.profile-moderation .actionbtns > .btn,
	.profile-moderation .actionbtns input[type="submit"],
	.profile-moderation .moderation-asset-actions .btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		scroll-behavior: auto !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
