/* Phase 7E, 7H & 7H.1: Momen Tamu Photo Booth Styles.
 * Modern, premium, mobile-first photobooth styling.
 * Scoped and loaded only when Photo Booth is active.
 */

:root {
	--folk-pb-brand: var(--folk-brand, #25b9ba);
	--folk-pb-brand-dark: var(--folk-brand-dark, #1d9697);
	--folk-pb-brand-light: #f0fdfa;
	--folk-pb-border: var(--folk-card-border, #e2e8f0);
	--folk-pb-radius-sm: 8px;
	--folk-pb-radius-md: 12px;
	--folk-pb-radius-lg: 16px;
	--folk-pb-text-dark: var(--folk-text-dark, #0f172a);
	--folk-pb-text: var(--folk-text, #334155);
	--folk-pb-muted: var(--folk-muted, #64748b);
	--folk-pb-shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05);
	--folk-pb-shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
	--folk-pb-shadow-glow: 0 0 0 3px rgba(37, 185, 186, 0.25);
	--folk-pb-success: #10b981;
	--folk-pb-success-dark: #059669;
	--folk-pb-danger: #ef4444;
}

.folkt-momen-photobooth {
	width: 100%;
	max-width: 540px;
	margin-top: 16px;
	box-sizing: border-box;
}

.folkt-momen-photobooth *,
.folkt-momen-photobooth *::before,
.folkt-momen-photobooth *::after {
	box-sizing: border-box;
}

/* ----------------------------------------------------
   1. Photo Booth Entry CTA
   ---------------------------------------------------- */
.folkt-momen-photobooth button.folkt-momen-photobooth-entry {
	display: inline-flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 11px 20px;
	border: 1px solid var(--folk-pb-brand);
	border-radius: var(--folk-pb-radius-md);
	background: var(--folk-pb-brand);
	color: #ffffff;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.25;
	cursor: pointer;
	box-shadow: var(--folk-pb-shadow-subtle);
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.folkt-momen-photobooth-entry .folkt-momen-photobooth-entry-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
}

.folkt-momen-photobooth-entry:hover:not(:disabled) {
	background: var(--folk-pb-brand-dark);
	border-color: var(--folk-pb-brand-dark);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 185, 186, 0.25);
}

.folkt-momen-photobooth-entry:active:not(:disabled) {
	transform: translateY(0) scale(0.99);
}

/* Disabled & Focus States */
.folkt-momen-photobooth button.folkt-momen-photobooth-entry:disabled,
.folkt-momen-photobooth button.folkt-momen-photobooth-capture:disabled,
.folkt-momen-photobooth button.folkt-momen-photobooth-retake:disabled,
.folkt-momen-photobooth button.folkt-momen-photobooth-download:disabled,
.folkt-momen-photobooth button.folkt-momen-photobooth-submit:disabled,
.folkt-momen-photobooth button.folkt-momen-photobooth-again:disabled {
	opacity: 0.65;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

.folkt-momen-photobooth-entry:focus-visible,
.folkt-momen-photobooth-capture:focus-visible,
.folkt-momen-photobooth-retake:focus-visible,
.folkt-momen-photobooth-download:focus-visible,
.folkt-momen-photobooth-submit:focus-visible,
.folkt-momen-photobooth-again:focus-visible,
.folkt-momen-frame-category-btn:focus-visible,
.folkt-momen-frame-card:focus-visible {
	outline: 2px solid var(--folk-pb-brand);
	outline-offset: 2px;
}

/* ----------------------------------------------------
   2. Photo Booth Panel
   ---------------------------------------------------- */
.folkt-momen-photobooth-panel {
	margin-top: 14px;
	padding: 24px 24px 28px;
	background: var(--folk-card-bg, #ffffff);
	border: 1px solid var(--folk-pb-border);
	border-radius: var(--folk-radius-lg, var(--folk-pb-radius-lg));
	box-shadow: var(--folk-pb-shadow-card);
	text-align: center;
	animation: folktPbFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes folktPbFadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.folkt-momen-photobooth-header {
	margin-bottom: 16px;
}

.folkt-momen-photobooth-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 9999px;
	background: #ecfeff;
	border: 1px solid #cffafe;
	color: var(--folk-pb-brand-dark);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.folkt-momen-photobooth-panel h2,
.folkt-momen-photobooth-panel h3 {
	margin: 0 0 6px;
	color: var(--folk-pb-text-dark);
	font-size: 19px;
	line-height: 1.3;
	font-weight: 700;
}

.folkt-momen-photobooth-help {
	margin: 0 0 16px;
	color: var(--folk-pb-muted);
	font-size: 13px;
	line-height: 1.5;
}

/* ----------------------------------------------------
   3. Frame Library & Category Navigation
   ---------------------------------------------------- */
.folkt-momen-frame-library {
	margin: 0 0 18px;
	text-align: left;
}

.folkt-momen-frame-categories {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px 2px 8px;
	margin-bottom: 12px;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.folkt-momen-frame-categories::-webkit-scrollbar {
	display: none;
}

.folkt-momen-frame-category-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 6px 14px;
	border-radius: 9999px;
	border: 1px solid var(--folk-pb-border);
	background: #ffffff;
	color: var(--folk-pb-text);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.18s ease;
	user-select: none;
}

.folkt-momen-frame-category-btn:hover {
	border-color: var(--folk-pb-brand);
	color: var(--folk-pb-brand);
	background: #fafafa;
}

.folkt-momen-frame-category-btn.is-active {
	background: var(--folk-pb-brand);
	border-color: var(--folk-pb-brand);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(37, 185, 186, 0.3);
}

/* ----------------------------------------------------
   4. Frame Cards Grid
   ---------------------------------------------------- */
.folkt-momen-frame-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	max-height: 275px;
	overflow-y: auto;
	padding: 4px;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.folkt-momen-frame-grid::-webkit-scrollbar {
	width: 6px;
}

.folkt-momen-frame-grid::-webkit-scrollbar-track {
	background: transparent;
}

.folkt-momen-frame-grid::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 9999px;
}

.folkt-momen-frame-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 8px 10px;
	border: 2px solid var(--folk-pb-border);
	border-radius: var(--folk-pb-radius-md);
	background: #ffffff;
	cursor: pointer;
	text-align: center;
	font-family: inherit;
	transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
	user-select: none;
}

.folkt-momen-frame-card:hover {
	border-color: var(--folk-pb-brand);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

.folkt-momen-frame-card:active {
	transform: translateY(0);
}

.folkt-momen-frame-card.is-selected {
	border-color: var(--folk-pb-brand);
	background-color: var(--folk-pb-brand-light);
	box-shadow: 0 0 0 2px var(--folk-pb-brand), 0 4px 12px rgba(37, 185, 186, 0.18);
}

.folkt-momen-frame-card.is-selected::after {
	content: '✓';
	position: absolute;
	top: 6px;
	right: 6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--folk-pb-brand);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
	animation: folktCheckPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes folktCheckPop {
	from {
		transform: scale(0.6);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.folkt-momen-frame-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: contain;
	border-radius: 6px;
	background: #f8fafc;
	pointer-events: none;
	transition: transform 0.18s ease;
}

.folkt-momen-frame-card:hover .folkt-momen-frame-thumb {
	transform: scale(1.02);
}

.folkt-momen-frame-name {
	display: block;
	width: 100%;
	margin-top: 6px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--folk-pb-text-dark);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: none;
	line-height: 1.3;
}

.folkt-momen-frame-badge {
	display: none;
	font-size: 10px;
	font-weight: 700;
	color: var(--folk-pb-brand-dark);
	background: #ccfbf1;
	padding: 1px 6px;
	border-radius: 4px;
	margin-top: 4px;
	line-height: 1.2;
}

.folkt-momen-frame-card.is-selected .folkt-momen-frame-badge {
	display: inline-block;
}

/* ----------------------------------------------------
   5. Camera & Live Overlay
   ---------------------------------------------------- */
.folkt-momen-camera {
	position: relative;
	width: 100%;
	max-width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--folk-pb-radius-md);
	background: #0f172a;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.folkt-momen-camera video {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: cover;
}

.folkt-momen-camera-frame-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	border-radius: inherit;
	z-index: 2;
	transition: opacity 0.2s ease;
}

.folkt-momen-camera-guide {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(15, 23, 42, 0.75);
	color: #ffffff;
	padding: 5px 14px;
	border-radius: 9999px;
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1.3;
	backdrop-filter: blur(4px);
	pointer-events: none;
	z-index: 3;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	white-space: nowrap;
}

/* ----------------------------------------------------
   6. Capture Button (Photobooth Shutter Feel)
   ---------------------------------------------------- */
.folkt-momen-photobooth button.folkt-momen-photobooth-capture {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 58px;
	min-height: 58px;
	width: 62px;
	height: 62px;
	padding: 0;
	margin: 6px auto;
	border-radius: 50%;
	border: 3px solid #ffffff;
	background: var(--folk-pb-brand);
	box-shadow: 0 0 0 3px var(--folk-pb-brand), 0 4px 14px rgba(37, 185, 186, 0.4);
	cursor: pointer;
	position: relative;
	transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background-color 0.15s ease;
}

.folkt-momen-photobooth button.folkt-momen-photobooth-capture:hover:not(:disabled) {
	background: var(--folk-pb-brand-dark);
	box-shadow: 0 0 0 4px var(--folk-pb-brand-dark), 0 6px 18px rgba(37, 185, 186, 0.5);
	transform: scale(1.06);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-capture:active:not(:disabled) {
	transform: scale(0.92);
}

.folkt-momen-photobooth-capture .folkt-momen-capture-btn-inner {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: transparent;
	border: 2px solid rgba(255, 255, 255, 0.85);
	transition: transform 0.12s ease, background-color 0.12s ease;
	pointer-events: none;
}

.folkt-momen-photobooth button.folkt-momen-photobooth-capture:hover:not(:disabled) .folkt-momen-capture-btn-inner {
	background-color: rgba(255, 255, 255, 0.18);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-capture:active:not(:disabled) .folkt-momen-capture-btn-inner {
	transform: scale(0.85);
	background-color: rgba(255, 255, 255, 0.4);
}

.folkt-momen-photobooth-capture .folkt-momen-capture-btn-label {
	position: absolute;
	bottom: -22px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 11.5px;
	font-weight: 600;
	color: var(--folk-pb-text);
	white-space: nowrap;
	pointer-events: none;
}

/* ----------------------------------------------------
   7. Composed Preview Canvas
   ---------------------------------------------------- */
.folkt-momen-preview-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin: 0 auto;
	animation: folktPbFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.folkt-momen-captured {
	display: block;
	width: 100%;
	max-width: 360px;
	aspect-ratio: 2 / 3;
	border-radius: var(--folk-pb-radius-md);
	background: #0f172a;
	object-fit: contain;
	box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.16), 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------------------
   8. Action Buttons Hierarchy
   ---------------------------------------------------- */
.folkt-momen-photobooth-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
}

.folkt-momen-photobooth button.folkt-momen-photobooth-retake,
.folkt-momen-photobooth button.folkt-momen-photobooth-download,
.folkt-momen-photobooth button.folkt-momen-photobooth-submit,
.folkt-momen-photobooth button.folkt-momen-photobooth-again {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: var(--folk-pb-radius-md);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
	user-select: none;
}

/* Primary Action: Submit */
.folkt-momen-photobooth button.folkt-momen-photobooth-submit {
	order: 1;
	border: 1px solid var(--folk-pb-brand);
	background: var(--folk-pb-brand);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(37, 185, 186, 0.35);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-submit:hover:not(:disabled) {
	background: var(--folk-pb-brand-dark);
	border-color: var(--folk-pb-brand-dark);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 185, 186, 0.4);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-submit:active:not(:disabled) {
	transform: translateY(0);
}

/* Secondary Action: Download */
.folkt-momen-photobooth button.folkt-momen-photobooth-download {
	order: 2;
	border: 1px solid var(--folk-pb-success);
	background: var(--folk-pb-success);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-download:hover:not(:disabled) {
	background: var(--folk-pb-success-dark);
	border-color: var(--folk-pb-success-dark);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-download:active:not(:disabled) {
	transform: translateY(0);
}

/* Tertiary Action: Retake */
.folkt-momen-photobooth button.folkt-momen-photobooth-retake {
	order: 3;
	border: 1.5px solid #cbd5e1;
	background: transparent;
	color: var(--folk-pb-text);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-retake:hover:not(:disabled) {
	background: #f8fafc;
	border-color: #94a3b8;
	color: var(--folk-pb-text-dark);
	transform: translateY(-1px);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-retake:active:not(:disabled) {
	transform: translateY(0);
}

/* Success Action: Ambil Foto Lagi */
.folkt-momen-photobooth button.folkt-momen-photobooth-again {
	order: 1;
	border: 1px solid var(--folk-pb-brand);
	background: var(--folk-pb-brand);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(37, 185, 186, 0.35);
}

.folkt-momen-photobooth button.folkt-momen-photobooth-again:hover:not(:disabled) {
	background: var(--folk-pb-brand-dark);
	border-color: var(--folk-pb-brand-dark);
	transform: translateY(-1px);
}

/* ----------------------------------------------------
   9. State & Feedback Messages
   ---------------------------------------------------- */
.folkt-momen-photobooth-state {
	min-height: 20px;
	margin: 14px 0 0;
	padding: 0;
	color: var(--folk-pb-muted);
	font-size: 13px;
	line-height: 1.5;
	font-weight: 500;
	transition: all 0.2s ease;
}

.folkt-momen-photobooth-state.is-error {
	color: var(--folk-pb-danger);
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--folk-pb-radius-sm);
	padding: 8px 12px;
}

.folkt-momen-photobooth-state.is-success {
	color: var(--folk-pb-success-dark);
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: var(--folk-pb-radius-sm);
	padding: 10px 14px;
	font-weight: 600;
}

/* ----------------------------------------------------
   10. Mobile Responsiveness (375x812 & 390x844)
   ---------------------------------------------------- */
@media (max-width: 640px) {
	.folkt-momen-photobooth-panel {
		padding: 20px 14px 24px;
	}

	.folkt-momen-photobooth-panel h2,
	.folkt-momen-photobooth-panel h3 {
		font-size: 17.5px;
	}

	.folkt-momen-frame-grid {
		grid-template-columns: repeat(2, 1fr);
		max-height: 240px;
		gap: 8px;
	}

	.folkt-momen-frame-card {
		padding: 6px 6px 8px;
	}

	.folkt-momen-photobooth-actions {
		gap: 8px;
	}

	.folkt-momen-photobooth-actions > button:not(.folkt-momen-photobooth-capture) {
		flex: 1 1 calc(50% - 6px);
		min-width: 120px;
	}

	.folkt-momen-photobooth button.folkt-momen-photobooth-submit {
		flex: 1 1 100%;
	}

	.folkt-momen-captured {
		max-width: 100%;
	}
}

@media (max-width: 380px) {
	.folkt-momen-photobooth-actions > button:not(.folkt-momen-photobooth-capture) {
		flex: 1 1 100%;
	}
}

/* ----------------------------------------------------
   11. Reduced Motion Accessibility
   ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.folkt-momen-photobooth,
	.folkt-momen-photobooth *,
	.folkt-momen-photobooth *::before,
	.folkt-momen-photobooth *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ----------------------------------------------------
   12. Touch reliability
   ---------------------------------------------------- */
.folkt-momen-photobooth button.folkt-momen-photobooth-entry,
.folkt-momen-photobooth button.folkt-momen-photobooth-capture,
.folkt-momen-photobooth button.folkt-momen-photobooth-retake,
.folkt-momen-photobooth button.folkt-momen-photobooth-download,
.folkt-momen-photobooth button.folkt-momen-photobooth-submit,
.folkt-momen-photobooth button.folkt-momen-photobooth-again,
.folkt-momen-frame-category-btn,
.folkt-momen-frame-card {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

/* Touch devices do not have a persistent hover state; neutralize hover-only
   transforms so the first tap always activates the control instead of being
   consumed by an emulated hover state. */
@media (hover: none) {
	.folkt-momen-photobooth-entry:hover:not(:disabled),
	.folkt-momen-photobooth-capture:hover:not(:disabled),
	.folkt-momen-photobooth-retake:hover:not(:disabled),
	.folkt-momen-photobooth-download:hover:not(:disabled),
	.folkt-momen-photobooth-submit:hover:not(:disabled),
	.folkt-momen-photobooth-again:hover:not(:disabled),
	.folkt-momen-frame-category-btn:hover,
	.folkt-momen-frame-card:hover {
		transform: none;
	}

	.folkt-momen-frame-card:hover .folkt-momen-frame-thumb {
		transform: none;
	}
}
