/* 사용법·매뉴얼 영상 갤러리 */

.helpdesk-video-single-embed.helpdesk-video-modal__ratio {
	margin: 0 0 var(--hc-space-xl, 2rem) 0;
	max-width: 100%;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
}

.helpdesk-video-single-html {
	margin: 0 0 var(--hc-space-xl, 2rem) 0;
}

.helpdesk-video-single-html__label {
	margin: 0 0 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--hc-text-secondary, rgba(255, 255, 255, 0.75));
}

.helpdesk-wrapper .helpdesk-video-single-html__label {
	color: #374151;
}

.helpdesk-video-single-html__frame {
	min-height: 320px;
}

.helpdesk-video-modal__html-wrap {
	margin: 0 1.25rem 0.75rem;
}

.helpdesk-video-modal__html-caption {
	margin: 0 0 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--hc-text-secondary, rgba(255, 255, 255, 0.78));
}

.helpdesk-wrapper .helpdesk-video-modal__html-caption {
	color: #4b5563;
}

.helpdesk-video-modal__html-frame {
	position: relative;
	width: 100%;
	min-height: 280px;
	max-height: 55vh;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--hc-border, rgba(255, 255, 255, 0.12));
}

.helpdesk-wrapper .helpdesk-video-modal__html-frame {
	border-color: #e5e7eb;
}

.helpdesk-video-modal__iframe--html {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 280px;
	border: 0;
	background: #fff;
}

.helpdesk-form-control--file {
	padding: 0.5rem 0;
	font-size: 0.9rem;
}

.helpdesk-video-html-current-note {
	margin: 8px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--hc-accent, #6366f1);
}

.helpdesk-wrapper .helpdesk-video-html-current-note {
	color: #4f46e5;
}

button.helpdesk-video-card__edit.helpdesk-btn {
	font-family: inherit;
	cursor: pointer;
}

/* 사용안내: 제목 → 분류 → 검색 순 */
.helpdesk-video-board__title-line {
	justify-content: flex-start;
	margin-bottom: 0.9rem;
}

.helpdesk-video-board__search-line {
	justify-content: stretch;
	margin-bottom: var(--hc-space-md, 1rem);
}

/* 모바일 검색+글쓰기 한 줄: helpdesk-common.css (.helpdesk-board__search-line / .helpdesk-video-board) */

/* 분류 네비: 모바일에서 좌우 스크롤만 (세로 스와이프는 네비에 맡기지 않음) */
.helpdesk-video-cat-nav-wrap {
	overflow-x: auto;
	overflow-y: hidden;
	max-height: 3.25rem;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	overscroll-behavior-x: contain;
	margin: 0 0 0.65rem;
	scrollbar-width: thin;
}

.helpdesk-video-cat-nav {
	display: block;
	min-width: min-content;
}

.helpdesk-video-cat-nav__track {
	display: inline-flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.45rem;
	padding: 2px 4px 6px;
	vertical-align: top;
}

.helpdesk-video-cat-nav__item {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--hc-border, rgba(255, 255, 255, 0.18));
	border-radius: 999px;
	background: var(--hc-surface, rgba(255, 255, 255, 0.08));
	color: var(--hc-text-primary, #fff);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.helpdesk-wrapper .helpdesk-video-cat-nav__item {
	background: #f3f4f6;
	border-color: #e5e7eb;
	color: #1f2937;
}

.helpdesk-video-cat-nav__item:hover {
	border-color: var(--hc-accent, #6366f1);
	color: var(--hc-accent, #6366f1);
}

.helpdesk-video-cat-nav__item.is-active {
	background: var(--hc-accent, #6366f1);
	border-color: var(--hc-accent, #6366f1);
	color: #fff;
}

.helpdesk-wrapper .helpdesk-video-cat-nav__item.is-active {
	color: #fff;
}

.helpdesk-video-cat-nav__item:focus-visible {
	outline: 2px solid var(--hc-accent, #6366f1);
	outline-offset: 2px;
}

.helpdesk-video-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1rem 1.25rem;
	margin-bottom: var(--hc-space-lg, 1.25rem);
}

.helpdesk-video-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	text-align: left;
	padding: 0;
	border: 1px solid var(--hc-border, rgba(255, 255, 255, 0.12));
	/* 썸네일 상단은 직각, 카드 하단만 라운드 */
	border-radius: 0 0 12px 12px;
	background: var(--hc-surface, rgba(255, 255, 255, 0.06));
	cursor: default;
	transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	overflow: hidden;
	position: relative;
	font: inherit;
	color: inherit;
}

.helpdesk-wrapper .helpdesk-video-card {
	background: #fff;
	border-color: #e5e7eb;
}

.helpdesk-video-card:hover {
	transform: translateY(-2px);
	border-color: var(--hc-accent, #6366f1);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.helpdesk-video-card__open:focus-visible {
	outline: 2px solid var(--hc-accent, #6366f1);
	outline-offset: 2px;
}

.helpdesk-video-card__thumb-btn {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: left;
	min-height: 0;
	flex-shrink: 0;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
}

/* 16:9 — aspect-ratio만 쓰면 일부 환경에서 높이 0·썸네일 소실 → padding-bottom 방식이 안전 */
.helpdesk-video-card__thumb-wrap {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	height: 0;
	padding-bottom: 56.25%;
	background: #0f0f12;
	border-radius: 0;
	overflow: hidden;
	min-height: 0;
	isolation: isolate;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
}

.helpdesk-video-card__thumb {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	border-radius: 0;
	z-index: 1;
}

.helpdesk-video-card__thumb--placeholder {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
	color: rgba(255, 255, 255, 0.35);
}

.helpdesk-video-card__play {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.22);
	color: #fff;
	pointer-events: none;
	transition: background 0.15s ease;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
}

/* 재생/보기: 밝은 하늘색 원형 + 흰색 플레이(인라인 SVG — 모바일 WebKit 대비) */
.helpdesk-video-card__play-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.85rem;
	height: 2.85rem;
	border-radius: 50%;
	background: #38bdf8;
	color: #ffffff;
	line-height: 0;
	box-shadow: 0 4px 14px rgba(56, 189, 248, 0.55);
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
}

.helpdesk-video-card__play-svg {
	display: block;
	width: 1.35rem;
	height: 1.35rem;
	flex-shrink: 0;
	color: #ffffff;
}

.helpdesk-video-card__play-svg path {
	fill: currentColor;
}

.helpdesk-wrapper .helpdesk-video-card__play-icon {
	box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

/* 호버·정밀 포인터 기기에서만 확대 (모바일 터치에서 레이아웃 깨짐 방지) */
@media (hover: hover) and (pointer: fine) {
	.helpdesk-video-card:hover .helpdesk-video-card__play {
		background: rgba(0, 0, 0, 0.38);
	}

	.helpdesk-video-card:hover .helpdesk-video-card__play-icon {
		transform: scale(1.06) translateZ(0);
		background: #7dd3fc;
		box-shadow: 0 5px 18px rgba(56, 189, 248, 0.5);
	}
}

.helpdesk-video-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	width: 100%;
	box-sizing: border-box;
	padding: 0.85rem 0.75rem 0.4rem;
}

.helpdesk-video-card__action {
	flex: 0 0 auto;
	padding: 0.35rem 0.65rem !important;
	font-size: 0.8125rem !important;
	line-height: 1.25;
	text-decoration: none !important;
}

.helpdesk-video-card__title {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.75rem 0.85rem 1rem;
	border: none;
	border-radius: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	color: var(--hc-text-primary, #fff);
	cursor: pointer;
}

.helpdesk-wrapper .helpdesk-video-card__title {
	color: #111827;
}

/* 카드·제목 호버 시에도 배경이 채워지지 않게 (테마 button:hover 덮어씀) */
.helpdesk-video-card__title:hover,
.helpdesk-video-card__title:focus,
.helpdesk-video-card__title:active,
.helpdesk-video-card:hover .helpdesk-video-card__title {
	background: transparent !important;
	box-shadow: none !important;
	color: var(--hc-text-primary, #fff) !important;
}

.helpdesk-wrapper .helpdesk-video-card__title:hover,
.helpdesk-wrapper .helpdesk-video-card__title:focus,
.helpdesk-wrapper .helpdesk-video-card__title:active,
.helpdesk-wrapper .helpdesk-video-card:hover .helpdesk-video-card__title {
	color: #111827 !important;
}

.helpdesk-video-card__title:focus-visible {
	outline: 2px solid var(--hc-accent, #6366f1);
	outline-offset: 2px;
}

.helpdesk-video-card__num {
	position: absolute;
	top: 8px;
	left: 8px;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	z-index: 2;
}

/* 재생 모달: 공통 상단 패딩 90px (helpdesk-common .helpdesk-modal)
 * z-index: hc-joyn-menu 트리거 9990 · #hcMenuOverlay 9991 · #hcMenuWrapper 9992 보다 낮게 (펼침 메뉴가 위) */
#helpdesk-video-modal.helpdesk-modal {
	z-index: 9970 !important;
	align-items: flex-start;
	justify-content: center;
	padding-top: 90px;
	padding-bottom: var(--hc-space-lg, 1.25rem);
	padding-left: var(--hc-space-lg, 1.25rem);
	padding-right: var(--hc-space-lg, 1.25rem);
	box-sizing: border-box;
}

.helpdesk-video-modal__dialog {
	position: relative;
	max-width: min(960px, 96vw);
	width: 100%;
	max-height: calc(100vh - 90px - 2.5rem);
	max-height: min(90vh, calc(100dvh - 90px - 2.5rem));
	padding: 0;
	overflow: hidden;
	border-radius: 14px;
}

.helpdesk-video-modal__head {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 1rem 1.25rem 0.5rem;
	min-height: 0;
	border-bottom: 1px solid var(--hc-border, rgba(255, 255, 255, 0.12));
}

/* 제목 왼쪽에 닫기 (한 줄 그룹) */
.helpdesk-video-modal__title-row {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

#helpdesk-video-modal .helpdesk-video-modal__title-row .helpdesk-modal-close {
	flex-shrink: 0;
}

/* 재생 모달 헤더는 보라 그라데이션이 아니므로 닫기 버튼 대비 보강 */
#helpdesk-video-modal .helpdesk-video-modal__close {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: rgba(255, 255, 255, 0.95) !important;
}

#helpdesk-video-modal .helpdesk-video-modal__close:hover,
#helpdesk-video-modal .helpdesk-video-modal__close:focus-visible {
	background: rgba(255, 255, 255, 0.24);
}

#helpdesk-video-modal .helpdesk-video-modal__close i {
	color: rgba(255, 255, 255, 0.95) !important;
}

.helpdesk-wrapper #helpdesk-video-modal .helpdesk-video-modal__close {
	background: rgba(0, 0, 0, 0.06);
	border: 1px solid rgba(0, 0, 0, 0.12);
	color: #111827 !important;
}

.helpdesk-wrapper #helpdesk-video-modal .helpdesk-video-modal__close:hover,
.helpdesk-wrapper #helpdesk-video-modal .helpdesk-video-modal__close:focus-visible {
	background: rgba(0, 0, 0, 0.1);
}

.helpdesk-wrapper #helpdesk-video-modal .helpdesk-video-modal__close i {
	color: #111827 !important;
}

.helpdesk-video-modal__title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.35;
	flex: 1;
	min-width: 0;
	color: var(--hc-text-primary, #fff);
}

.helpdesk-wrapper .helpdesk-video-modal__title {
	color: #111827;
}

.helpdesk-video-modal__ratio {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	background: #000;
	margin: 0 1.25rem;
	max-width: calc(100% - 2.5rem);
	box-sizing: border-box;
	border-radius: 10px;
	overflow: hidden;
}

.helpdesk-video-modal__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.helpdesk-video-modal__desc {
	padding: 1rem 1.25rem 1.25rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--hc-text-secondary, rgba(255, 255, 255, 0.78));
	max-height: 40vh;
	overflow-y: auto;
}

.helpdesk-wrapper .helpdesk-video-modal__desc {
	color: #374151;
}

/* 재생 모달 하단 공유 (Web Share / URL 복사 — joyn-lms 강의 상단 공유와 동일 패턴) */
.helpdesk-video-modal__share-wrap {
	flex-shrink: 0;
	padding: 0.75rem 1.25rem 1rem;
	border-top: 1px solid var(--hc-border, rgba(255, 255, 255, 0.12));
	background: var(--hc-surface, rgba(0, 0, 0, 0.22));
}

.helpdesk-wrapper .helpdesk-video-modal__share-wrap {
	border-top-color: #e5e7eb;
	background: #f3f4f6;
}

.helpdesk-video-modal__share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 44px;
	padding: 0.65rem 1rem;
	margin: 0;
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.1);
	color: var(--hc-text-primary, #fff);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.helpdesk-video-modal__share-btn i {
	font-size: 1.25rem;
	line-height: 1;
	color: inherit !important;
}

.helpdesk-wrapper .helpdesk-video-modal__share-btn {
	border-color: #e5e7eb;
	background: #fff;
	color: #1f2937;
}

.helpdesk-video-modal__share-btn:hover,
.helpdesk-video-modal__share-btn:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	border-color: var(--hc-accent, #6366f1);
	color: var(--hc-text-primary, #fff);
	outline: none;
}

.helpdesk-wrapper .helpdesk-video-modal__share-btn:hover,
.helpdesk-wrapper .helpdesk-video-modal__share-btn:focus-visible {
	border-color: var(--hc-accent, #4f46e5);
	color: var(--hc-accent, #4f46e5);
}

.helpdesk-video-modal__error {
	color: #f87171;
	margin: 0;
}

.helpdesk-wrapper .helpdesk-video-modal__error {
	color: #dc2626;
}

@media (max-width: 600px) {
	.helpdesk-video-modal__ratio {
		margin: 0;
		max-width: 100%;
		border-radius: 0;
	}
}

/* 모바일: 썸네일 가로 2열 · 재생 모달 상단 90px 패딩(공통) */
@media (max-width: 768px) {
	.helpdesk-video-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.7rem 0.55rem;
	}

	/* 썸네일 재생 원: 데스크톱과 동일(밝은 하늘색 + 흰 플레이) — 모바일 브라우저·테마 덮어쓰기 방지 */
	.helpdesk-video-card__play-icon {
		background: #38bdf8 !important;
		color: #ffffff !important;
		box-shadow: 0 4px 14px rgba(56, 189, 248, 0.55);
	}

	.helpdesk-wrapper .helpdesk-video-card__play-icon {
		box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
	}

	.helpdesk-video-card__play-svg {
		color: #ffffff !important;
	}

	.helpdesk-video-card__play-svg path {
		fill: #ffffff !important;
	}

	.helpdesk-video-card:active .helpdesk-video-card__play-icon {
		background: #7dd3fc !important;
		box-shadow: 0 5px 16px rgba(56, 189, 248, 0.5);
	}

	#helpdesk-video-modal.helpdesk-modal {
		align-items: flex-start !important;
		justify-content: center !important;
		padding: 90px 16px 16px !important;
		box-sizing: border-box !important;
	}

	#helpdesk-video-modal .helpdesk-modal-container.helpdesk-video-modal__dialog {
		border-radius: 14px !important;
		max-height: calc(100vh - 90px - 32px) !important;
		max-height: min(92vh, calc(100dvh - 90px - 32px)) !important;
		margin: 0 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow: hidden;
	}
}

/* 등록·편집 모달: 상단 90px(다른 게시판 모달과 동일) */
#helpdesk-video-write-modal.helpdesk-modal {
	z-index: 9970 !important;
	align-items: flex-start;
	justify-content: center;
	padding-top: 90px;
	padding-bottom: var(--hc-space-lg, 1.25rem);
	padding-left: var(--hc-space-lg, 1.25rem);
	padding-right: var(--hc-space-lg, 1.25rem);
	box-sizing: border-box;
}

#helpdesk-video-write-modal .helpdesk-modal-container {
	max-height: calc(100vh - 90px - 2.5rem);
	max-height: min(90vh, calc(100dvh - 90px - 2.5rem));
}

@media (max-width: 768px) {
	#helpdesk-video-write-modal.helpdesk-modal {
		align-items: flex-start !important;
		justify-content: center !important;
		padding: 90px 16px 16px !important;
		box-sizing: border-box !important;
	}

	#helpdesk-video-write-modal .helpdesk-modal-container {
		border-radius: 20px !important;
		max-height: calc(100vh - 90px - 32px) !important;
		max-height: min(92vh, calc(100dvh - 90px - 32px)) !important;
		margin: 0 auto !important;
		width: 100% !important;
		max-width: 100% !important;
	}
}
