/* ==========================================================================
   DawsonyWeb – Client Tutorial Videos — Manage Tutorials UI
   Brand: #36648b (steel blue) — shared Dawsony family
   ========================================================================== */

:root {
	--dctv-brand: #36648b;
	--dctv-brand-dark: #2a4f6e;
	--dctv-brand-light: #4a87b5;
	--dctv-brand-bg: #edf2f7;
	--dctv-success: #16a34a;
	--dctv-radius: 8px;
	--dctv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
	--dctv-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ---------- Full-bleed Wrap ---------- */

.dctv-wrap {
	margin: -8px 0 0 -20px;
	overflow-x: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	background: var(--dctv-brand-bg);
	min-height: 100vh;
}

/* ---------- Header ---------- */

.dctv-header {
	background: linear-gradient(135deg, var(--dctv-brand) 0%, var(--dctv-brand-dark) 100%);
	padding: 0;
	margin-bottom: 0;
}

.dctv-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.dctv-header-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.dctv-header-logo {
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	background: #fff;
	padding: 2px;
}

.dctv-header h1 {
	margin: 0;
	padding: 0;
	font-size: 20px;
	font-weight: 600;
	color: #fff;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.dctv-header-version {
	display: inline-block;
	font-size: 11px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.15);
	padding: 2px 8px;
	border-radius: 10px;
	margin-top: 2px;
}

/* ---------- Header: View Tutorial Page button ---------- */

.dctv-header-view-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none !important;
	transition: background 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.dctv-header-view-btn:hover {
	background: rgba(255, 255, 255, 0.25);
	border-color: rgba(255, 255, 255, 0.5);
	color: #fff !important;
}

/* ---------- Sidebar Layout ---------- */

.dctv-body {
	display: flex;
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px;
	gap: 24px;
	align-items: flex-start;
}

.dctv-sidebar {
	width: 200px;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--dctv-radius);
	padding: 8px 0;
	position: sticky;
	top: 32px;
}

.dctv-sidebar-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 500;
	color: #475569;
	text-decoration: none;
	border-left: 3px solid transparent;
	transition: color 0.15s, background 0.15s;
}

.dctv-sidebar-item:hover {
	color: var(--dctv-brand);
	background: var(--dctv-brand-bg);
}

.dctv-sidebar-item-active {
	color: var(--dctv-brand);
	background: var(--dctv-brand-bg);
	border-left-color: var(--dctv-brand);
	font-weight: 600;
}

.dctv-main {
	flex: 1;
	min-width: 0;
	padding-bottom: 24px;
}

/* ---------- Toast ---------- */

.dctv-toast {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #f0fdf4;
	color: var(--dctv-success);
	font-weight: 500;
	font-size: 13px;
	border-bottom: 1px solid #bbf7d0;
}

.dctv-toast svg {
	flex-shrink: 0;
}

/* ---------- Content Area ---------- */

.dctv-content {
	min-height: 400px;
}

/* ---------- Section Cards ---------- */

.dctv-section {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--dctv-radius);
	padding: 20px 24px;
	margin-bottom: 20px;
	box-shadow: var(--dctv-shadow-sm);
}

.dctv-section h2 {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
}

.dctv-section > .description {
	margin-top: 0;
	margin-bottom: 16px;
	color: #64748b;
	font-size: 13px;
	line-height: 1.5;
}

/* ---------- Repeater ---------- */

.dctv-repeater {
	margin-bottom: 12px;
}

.dctv-repeater-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 16px;
	margin-bottom: 10px;
	position: relative;
	transition: box-shadow 0.2s, border-color 0.2s;
}

.dctv-repeater-item:hover {
	box-shadow: var(--dctv-shadow);
}

.dctv-repeater-placeholder {
	border: 2px dashed #cbd5e1;
	background: #f8fafc;
	margin-bottom: 10px;
	min-height: 80px;
	border-radius: 6px;
}

.dctv-repeater-handle {
	cursor: grab;
	padding: 4px 2px;
	color: #94a3b8;
	flex-shrink: 0;
	margin-top: 2px;
}

.dctv-repeater-handle:active {
	cursor: grabbing;
}

.dctv-repeater-fields {
	flex: 1;
	min-width: 0;
}

.dctv-field {
	margin-bottom: 12px;
}

.dctv-field:last-child {
	margin-bottom: 0;
}

.dctv-field label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	color: #334155;
	margin-bottom: 4px;
}

.dctv-field input.regular-text {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-size: 13px;
	color: #334155;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.dctv-field input.regular-text:focus {
	border-color: var(--dctv-brand);
	box-shadow: 0 0 0 2px rgba(54, 100, 139, 0.2);
	outline: none;
}

.dctv-field textarea.large-text {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-size: 13px;
	color: #334155;
	line-height: 1.5;
	resize: vertical;
	font-family: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.dctv-field textarea.large-text:focus {
	border-color: var(--dctv-brand);
	box-shadow: 0 0 0 2px rgba(54, 100, 139, 0.2);
	outline: none;
}

.dctv-field-hint {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 400;
}

/* Video picker */

.dctv-video-picker {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.dctv-video-filename {
	font-size: 13px;
	color: #64748b;
	min-width: 0;
	word-break: break-all;
}

.dctv-remove-video.hidden {
	display: none;
}

.dctv-video-picker .button {
	border-radius: 6px;
}

/* Remove button */

.dctv-repeater-remove {
	flex-shrink: 0;
	border: none;
	background: none;
	color: #dc2626;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	opacity: 0.5;
	transition: opacity 0.15s, background 0.15s;
}

.dctv-repeater-remove:hover {
	opacity: 1;
	background: #fef2f2;
}

/* Add button */

#dctv-add-tutorial {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 6px;
}

/* ---------- Role Grid ---------- */

.dctv-role-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 4px 16px;
	margin-top: 10px;
}

.dctv-role-grid label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #334155;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s;
}

.dctv-role-grid label:hover {
	background: #f1f5f9;
}

/* ---------- Widget Toggle ---------- */

.dctv-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #334155;
	margin-top: 8px;
}

.dctv-setting-row {
	margin-top: 16px;
}

/* ---------- Submit Button ---------- */

.dctv-content .submit {
	margin-top: 16px;
	padding: 0;
}

.dctv-content .submit .button-primary {
	background: var(--dctv-brand);
	border-color: var(--dctv-brand-dark);
	border-radius: 6px;
	padding: 6px 20px;
	font-size: 13px;
	font-weight: 500;
	height: auto;
	line-height: 1.6;
	transition: background 0.15s, box-shadow 0.15s;
}

.dctv-content .submit .button-primary:hover {
	background: var(--dctv-brand-dark);
	border-color: var(--dctv-brand-dark);
}

.dctv-content .submit .button-primary:focus {
	box-shadow: 0 0 0 2px rgba(54, 100, 139, 0.4);
}

/* ---------- Footer ---------- */

.dctv-footer {
	padding: 16px 0 0;
	text-align: center;
	font-size: 12px;
	color: #94a3b8;
	border-top: 1px solid #e2e8f0;
	margin-top: 8px;
}

.dctv-footer a {
	color: var(--dctv-brand);
	text-decoration: none;
}

.dctv-footer a:hover {
	text-decoration: underline;
}

/* ---------- Help Tab ---------- */

.dctv-help-note {
	margin: 0;
	font-size: 13px;
}

.dctv-help-note a {
	color: var(--dctv-brand);
	text-decoration: none;
}

.dctv-help-note a:hover {
	text-decoration: underline;
}

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

@media (max-width: 782px) {
	.dctv-wrap {
		margin: -8px 0 0 -10px;
	}

	.dctv-header-inner {
		padding: 16px;
	}

	.dctv-body {
		flex-wrap: wrap;
		padding: 16px;
		gap: 16px;
	}

	.dctv-sidebar {
		width: 100%;
		position: static;
		display: flex;
		flex-wrap: wrap;
		padding: 6px 8px;
		gap: 4px;
	}

	.dctv-sidebar-item {
		border-left: none;
		border-radius: 20px;
		padding: 6px 12px;
		font-size: 12px;
	}

	.dctv-sidebar-item-active {
		border-left: none;
		background: var(--dctv-brand-bg);
	}

	.dctv-main {
		width: 100%;
		padding-bottom: 16px;
	}

	.dctv-role-grid {
		grid-template-columns: 1fr;
	}
}
