/*
 * استایل عمومی افزونه CWS Online Academy
 * تمام کلاس‌ها با پیشوند cws- نام‌گذاری شده‌اند تا با استایل قالب و سایر افزونه‌ها تداخل نداشته باشند.
 */

.cws-block {
	--cws-accent: #2271b1;
	--cws-radius: 10px;
	--cws-bg: #ffffff;
	--cws-border: #e2e4e7;
	--cws-text: #1e1e1e;
	--cws-muted: #6b7280;

	background: var(--cws-bg);
	border: 1px solid var(--cws-border);
	border-radius: calc(var(--cws-radius) + 4px);
	padding: 16px;
	margin: 0 0 24px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	font-family: inherit;
	max-width: 100%;
	box-sizing: border-box;
}

.cws-block *,
.cws-block *::before,
.cws-block *::after {
	box-sizing: border-box;
}

.cws-block-title {
	margin: 0 0 12px;
	font-size: 17px;
	line-height: 1.6;
	font-weight: 600;
	color: var(--cws-text);
}

/* ----- نمایش ویدیو ----- */
.cws-video-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--cws-radius);
	overflow: hidden;
	background: #000;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.cws-video-wrapper video.cws-video,
.cws-video-wrapper iframe.cws-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: var(--cws-radius);
	display: block;
}

.cws-video-error {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #d63638;
	background: #fff;
	padding: 20px;
	text-align: center;
	margin: 0;
	border-radius: var(--cws-radius);
}

/* ----- آکاردئون فایل‌های پیوست ----- */
.cws-files-accordion {
	margin-top: 14px;
	border: 1px solid var(--cws-border);
	border-radius: var(--cws-radius);
	overflow: hidden;
}

.cws-files-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f8f9fa;
	border: 0;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	color: var(--cws-text);
	transition: background 0.2s ease;
	font-family: inherit;
}

.cws-files-toggle:hover {
	background: #f0f1f2;
}

.cws-files-toggle .cws-toggle-icon {
	margin-inline-start: auto;
	font-size: 18px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.cws-files-toggle[aria-expanded="true"] .cws-toggle-icon {
	transform: rotate(45deg);
}

.cws-files-panel {
	padding: 10px 14px;
	animation: cws-fade-in 0.2s ease;
}

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

@keyframes cws-fade-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cws-files-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cws-files-list li a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 6px;
	text-decoration: none;
	color: var(--cws-accent);
	background: #fafbfc;
	transition: background 0.15s ease;
	font-size: 14px;
}

.cws-files-list li a:hover {
	background: #f0f6fb;
	text-decoration: underline;
}

/* ----- کادر یادداشت ----- */
.cws-notes-box {
	margin-top: 14px;
	border: 1px solid var(--cws-border);
	border-radius: var(--cws-radius);
	padding: 12px 14px;
	background: #fcfcfd;
}

.cws-notes-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 8px;
	color: var(--cws-text);
}

.cws-note-textarea {
	width: 100%;
	min-height: 70px;
	border: 1px solid var(--cws-border);
	border-radius: 8px;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cws-note-textarea:focus {
	outline: none;
	border-color: var(--cws-accent);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cws-note-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}

.cws-note-save {
	background: var(--cws-accent);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 6px 16px;
	cursor: pointer;
	font-size: 13px;
	transition: opacity 0.2s ease;
	font-family: inherit;
}

.cws-note-save:hover {
	opacity: 0.9;
}

.cws-note-save:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.cws-note-status {
	font-size: 12px;
	color: var(--cws-muted);
}

/* ----- محتوای محدودشده ----- */
.cws-restricted-box {
	background: #fff8e5;
	border: 1px solid #f0c33c;
	border-radius: var(--cws-radius, 10px);
	padding: 20px;
	text-align: center;
	color: #5a4a1f;
	line-height: 2;
}

.cws-restricted-box a {
	color: var(--cws-accent, #2271b1);
	font-weight: 600;
}

.cws-admin-only-notice {
	background: #fbeaea;
	border: 1px dashed #d63638;
	color: #8a2424;
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 10px;
	font-size: 13px;
	line-height: 1.8;
}

/* ----- واکنش‌گرایی ----- */
@media (max-width: 600px) {
	.cws-block {
		padding: 12px;
	}
	.cws-block-title {
		font-size: 15px;
	}
	.cws-files-toggle {
		font-size: 13px;
		padding: 9px 12px;
	}
}
