/**
 * MeetPress front-end styles.
 */

:root {
	--mp-brand: #2d6cdf;
	--mp-brand-dark: #1f52ad;
	--mp-ink: #17202f;
	--mp-muted: #6b7686;
	--mp-line: #e2e6ed;
	--mp-surface: #ffffff;
	--mp-shell: #11151f;
	--mp-shell-2: #1b2130;
	--mp-shell-3: #262e40;
	--mp-danger: #d9453c;
	--mp-ok: #1f9d55;
	--mp-radius: 10px;
}

/* ---------------------------------------------------------------- Shared */

/*
 * The UA's [hidden] rule is display:block-weight and loses to any author
 * `display` declaration below, so every element this plugin toggles with the
 * hidden attribute needs this override or all screens render at once.
 */
.mp-room [hidden],
.mp-lobby [hidden],
.mp-classroom [hidden],
.mp-dashboard [hidden],
.mp-lessonview [hidden],
.mp-room[hidden],
.mp-lobby[hidden] {
	display: none !important;
}

.mp-notice {
	border: 1px solid var(--mp-line);
	border-left: 4px solid var(--mp-brand);
	background: #f7f9fc;
	padding: 14px 16px;
	border-radius: var(--mp-radius);
	margin: 16px 0;
	color: var(--mp-ink);
}

.mp-notice--error {
	border-left-color: var(--mp-danger);
	background: #fdf3f2;
}

.mp-muted {
	color: var(--mp-muted);
}

.mp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: var(--mp-radius);
	border: 1px solid var(--mp-line);
	background: var(--mp-surface);
	color: var(--mp-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.mp-btn:hover {
	border-color: #c9d1de;
	background: #f5f7fb;
}

.mp-btn:active {
	transform: translateY(1px);
}

.mp-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.mp-btn--primary {
	background: var(--mp-brand);
	border-color: var(--mp-brand);
	color: #fff;
}

.mp-btn--primary:hover {
	background: var(--mp-brand-dark);
	border-color: var(--mp-brand-dark);
}

.mp-btn--danger {
	background: var(--mp-danger);
	border-color: var(--mp-danger);
	color: #fff;
}

.mp-btn--danger-outline {
	background: transparent;
	border-color: var(--mp-danger);
	color: var(--mp-danger);
}

.mp-btn--lg {
	padding: 13px 22px;
	font-size: 15px;
	width: 100%;
}

.mp-btn--sm {
	padding: 6px 12px;
	font-size: 13px;
}

.mp-btn--ghost {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.mp-btn--ghost:hover {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.3);
}

.mp-field {
	display: block;
	margin: 0 0 14px;
}

.mp-field > span {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--mp-ink);
}

.mp-field input,
.mp-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--mp-line);
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: var(--mp-ink);
	box-sizing: border-box;
}

.mp-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	margin-bottom: 12px;
}

.mp-card {
	background: var(--mp-surface);
	border: 1px solid var(--mp-line);
	border-radius: 14px;
	padding: 22px;
}

.mp-card h2 {
	margin: 0 0 6px;
	font-size: 20px;
}

.mp-card--accent {
	border-top: 3px solid var(--mp-brand);
}

.mp-copyrow {
	display: flex;
	gap: 8px;
	margin: 10px 0;
}

.mp-copyrow input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid var(--mp-line);
	border-radius: 8px;
	font-size: 13px;
}

/* ----------------------------------------------------------------- Lobby */

.mp-lobby__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.mp-lobby__result {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px dashed var(--mp-line);
}

/* ------------------------------------------------------------------ Room */

.mp-room {
	position: relative;
	background: var(--mp-shell);
	color: #e9edf5;
	border-radius: 14px;
	overflow: hidden;
	min-height: 560px;
	display: flex;
	flex-direction: column;
}

.mp-prejoin,
.mp-ended {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.mp-prejoin__card,
.mp-ended__card {
	width: 100%;
	max-width: 460px;
	background: var(--mp-shell-2);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 24px;
}

.mp-prejoin__title,
.mp-ended__card h2 {
	margin: 0 0 6px;
	font-size: 22px;
	color: #fff;
}

.mp-prejoin__sub {
	margin: 0 0 16px;
	color: #9aa6bb;
	font-size: 14px;
}

.mp-prejoin__preview {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 18px;
}

.mp-prejoin__preview video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scaleX(-1);
}

.mp-prejoin__previewOff {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #8794ab;
	font-size: 14px;
	text-align: center;
	padding: 12px;
}

.mp-prejoin__devices {
	display: grid;
	gap: 10px;
}

.mp-prejoin .mp-field > span,
.mp-ended__card p {
	color: #c3ccdb;
}

.mp-prejoin .mp-field input,
.mp-prejoin .mp-field select {
	background: #0e121b;
	border-color: rgba(255, 255, 255, 0.14);
	color: #eaeef6;
}

.mp-prejoin__toggles {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 14px 0 6px;
	font-size: 13px;
	color: #c3ccdb;
}

.mp-prejoin__error {
	color: #ff9d97;
	font-size: 13px;
	margin: 0 0 12px;
}

.mp-ended__actions {
	display: flex;
	gap: 10px;
	margin-top: 16px;
	flex-wrap: wrap;
}

/* Live shell */

.mp-live {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.mp-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--mp-shell-2);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-topbar__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.mp-topbar__title {
	font-size: 15px;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mp-topbar__status {
	font-size: 12px;
	color: #8f9cb3;
}

.mp-topbar__actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.mp-timer {
	font-variant-numeric: tabular-nums;
	font-size: 13px;
	color: #9aa6bb;
}

.mp-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #6b7686;
	flex: none;
}

.mp-dot.is-connected {
	background: var(--mp-ok);
}

.mp-dot.is-reconnecting {
	background: #e0a52b;
}

.mp-dot.is-disconnected {
	background: var(--mp-danger);
}

.mp-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.mp-stage {
	flex: 1;
	position: relative;
	padding: 14px;
	min-width: 0;
	overflow: auto;
}

.mp-grid {
	display: grid;
	grid-template-columns: repeat(var(--mp-cols, 1), minmax(0, 1fr));
	gap: 12px;
	height: 100%;
	align-content: center;
}

.mp-stage__empty {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #7c8798;
	pointer-events: none;
}

.mp-tile {
	position: relative;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-tile video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: #000;
}

.mp-tile.is-self video {
	transform: scaleX(-1);
}

.mp-tile.is-self.is-screen video,
.mp-tile.is-screen video {
	transform: none;
	object-fit: contain;
}

.mp-tile__placeholder {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--mp-shell-3);
}

.mp-tile__placeholder img {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
}

.mp-tile.is-videoless .mp-tile__placeholder {
	display: flex;
}

.mp-tile.is-videoless video {
	visibility: hidden;
}

.mp-tile__bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
	font-size: 13px;
	color: #fff;
}

.mp-tile__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-tile__icons {
	display: flex;
	gap: 6px;
	flex: none;
}

/* Sidebar */

.mp-sidebar {
	width: 320px;
	flex: none;
	background: var(--mp-shell-2);
	border-left: 1px solid rgba(255, 255, 255, 0.06);
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.mp-sidebar__tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-tab {
	background: transparent;
	border: 0;
	color: #9aa6bb;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 14px;
	cursor: pointer;
}

.mp-tab.is-active {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.mp-sidebar__close {
	margin-left: auto;
	background: transparent;
	border: 0;
	color: #9aa6bb;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.mp-badge {
	background: rgba(255, 255, 255, 0.14);
	border-radius: 20px;
	padding: 1px 7px;
	font-size: 12px;
}

.mp-panel {
	display: none;
	flex: 1;
	min-height: 0;
	flex-direction: column;
}

.mp-panel.is-active {
	display: flex;
}

.mp-panel__actions {
	padding: 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-people {
	list-style: none;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	flex: 1;
}

.mp-person {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 10px;
}

.mp-person.is-hand {
	background: rgba(224, 165, 43, 0.14);
}

.mp-person__avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	flex: none;
	object-fit: cover;
}

.mp-person__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.mp-person__name {
	font-size: 14px;
	color: #eaeef6;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-person__tags {
	font-size: 11px;
	color: #8f9cb3;
}

.mp-person__actions {
	display: flex;
	gap: 4px;
	flex: none;
}

.mp-person__btn {
	background: rgba(255, 255, 255, 0.08);
	border: 0;
	color: #d6dcE8;
	border-radius: 7px;
	width: 28px;
	height: 28px;
	font-size: 13px;
	cursor: pointer;
}

.mp-person__btn:hover {
	background: rgba(255, 255, 255, 0.18);
}

/* Chat */

.mp-chat {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mp-chat__msg {
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 10px;
	padding: 8px 10px;
}

.mp-chat__msg.is-self {
	background: rgba(45, 108, 223, 0.22);
}

.mp-chat__author {
	font-size: 11px;
	color: #9aa6bb;
	margin-bottom: 2px;
}

.mp-chat__text {
	font-size: 14px;
	color: #eaeef6;
	word-break: break-word;
}

.mp-chat__system {
	font-size: 12px;
	color: #8f9cb3;
	text-align: center;
	font-style: italic;
}

.mp-chat__form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-chat__form input {
	flex: 1;
	min-width: 0;
	padding: 9px 12px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: #0e121b;
	color: #eaeef6;
	font-size: 14px;
}

/* Toolbar */

.mp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	background: var(--mp-shell-2);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	flex-wrap: wrap;
}

.mp-toolbar__group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mp-ctrl {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	min-width: 62px;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.05);
	color: #d6dce8;
	font-size: 11px;
	cursor: pointer;
}

.mp-ctrl:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.12);
}

.mp-ctrl:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.mp-ctrl.is-off {
	background: rgba(217, 69, 60, 0.22);
	border-color: rgba(217, 69, 60, 0.5);
	color: #ffb9b4;
}

.mp-ctrl.is-active {
	background: rgba(45, 108, 223, 0.28);
	border-color: rgba(45, 108, 223, 0.6);
	color: #cddffd;
}

.mp-ctrl__icon::before {
	font-size: 17px;
	line-height: 1;
}

.mp-ctrl__icon[data-icon="mic"]::before { content: "🎙"; }
.mp-ctrl__icon[data-icon="cam"]::before { content: "🎥"; }
.mp-ctrl__icon[data-icon="screen"]::before { content: "🖥"; }
.mp-ctrl__icon[data-icon="hand"]::before { content: "✋"; }
.mp-ctrl__icon[data-icon="rec"]::before { content: "⏺"; }
.mp-ctrl__icon[data-icon="people"]::before { content: "👥"; }
.mp-ctrl__icon[data-icon="chat"]::before { content: "💬"; }

.mp-ctrl.is-off .mp-ctrl__icon[data-icon="mic"]::before { content: "🔇"; }
.mp-ctrl.is-off .mp-ctrl__icon[data-icon="cam"]::before { content: "🚫"; }

.mp-ctrl__dot {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mp-danger);
}

/* Toasts */

.mp-toasts {
	position: absolute;
	left: 50%;
	bottom: 92px;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 30;
	pointer-events: none;
}

.mp-toast {
	background: rgba(20, 25, 36, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #eaeef6;
	padding: 9px 14px;
	border-radius: 20px;
	font-size: 13px;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.mp-toast.is-out {
	opacity: 0;
}

.mp-toast--ok { border-color: rgba(31, 157, 85, 0.6); }
.mp-toast--warn { border-color: rgba(224, 165, 43, 0.6); }
.mp-toast--error { border-color: rgba(217, 69, 60, 0.6); }

/* ------------------------------------------------------------- Classroom */

.mp-classroom__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.mp-classroom__title {
	margin: 0 0 4px;
}

.mp-classroom__live {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.mp-live-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #fdecea;
	color: #b4322a;
	border-radius: 20px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mp-live-pill__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mp-danger);
	animation: mp-pulse 1.6s infinite;
}

@keyframes mp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
	.mp-live-pill__dot { animation: none; }
}

.mp-classroom__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 22px;
	margin: 22px 0;
	align-items: start;
}

.mp-player {
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

.mp-player video {
	width: 100%;
	height: 100%;
	display: block;
}

.mp-player__embed {
	width: 100%;
	height: 100%;
}

.mp-player__embed iframe,
.mp-player__embed video {
	width: 100%;
	height: 100%;
	border: 0;
}

.mp-player__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #8794ab;
	font-size: 14px;
}

.mp-player__meta h2 {
	margin: 16px 0 8px;
	font-size: 22px;
}

.mp-playlist {
	background: var(--mp-surface);
	border: 1px solid var(--mp-line);
	border-radius: 12px;
	overflow: hidden;
}

.mp-playlist__title {
	margin: 0;
	padding: 14px 16px;
	font-size: 15px;
	border-bottom: 1px solid var(--mp-line);
}

.mp-playlist__list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 520px;
	overflow-y: auto;
}

.mp-playlist__item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 16px;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--mp-line);
	text-align: left;
	cursor: pointer;
	font-size: 14px;
	color: var(--mp-ink);
}

.mp-playlist__item:hover {
	background: #f5f7fb;
}

.mp-playlist__item.is-active {
	background: #eef3fd;
	box-shadow: inset 3px 0 0 var(--mp-brand);
}

.mp-playlist__num {
	width: 24px;
	height: 24px;
	flex: none;
	border-radius: 50%;
	background: #eef1f6;
	color: var(--mp-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
}

.mp-playlist__body {
	flex: 1;
	min-width: 0;
}

.mp-playlist__name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-playlist__bar {
	display: block;
	height: 3px;
	border-radius: 3px;
	background: #e7ebf2;
	margin-top: 6px;
	overflow: hidden;
}

.mp-playlist__bar span {
	display: block;
	height: 100%;
	background: var(--mp-brand);
}

.mp-playlist__check {
	color: var(--mp-ok);
	font-weight: 700;
	flex: none;
}

.mp-classroom__teacher {
	margin-top: 24px;
}

/* --------------------------------------------------- Dashboard / catalog */

.mp-dashboard__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.mp-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
}

.mp-classcard {
	background: var(--mp-surface);
	border: 1px solid var(--mp-line);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.mp-classcard__thumb img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

.mp-classcard__body {
	padding: 16px;
}

.mp-classcard__body h2 {
	margin: 8px 0;
	font-size: 17px;
}

.mp-classcard__body h2 a {
	color: inherit;
	text-decoration: none;
}

.mp-live-pill--sm {
	font-size: 10px;
	padding: 3px 9px;
}

/* ---------------------------------------------------------- Responsive */

@media (max-width: 960px) {
	.mp-classroom__body {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 782px) {
	.mp-room {
		min-height: 70vh;
		border-radius: 0;
	}

	.mp-sidebar {
		position: absolute;
		inset: 0;
		width: auto;
		z-index: 20;
	}

	.mp-ctrl {
		min-width: 54px;
		padding: 7px 6px;
	}

	.mp-ctrl__label {
		display: none;
	}

	.mp-toolbar {
		justify-content: center;
	}

	.mp-grid {
		--mp-cols: 1 !important;
	}
}
