/**
 * Technoalig Web Stories: Fullscreen Instagram & WhatsApp Status Style Viewer
 * 
 * Supports smooth progress bars, touch swipe, tap navigation, and mobile responsiveness.
 * Developed by Techno Alig.
 */

.tmh-story-modal {
	position: fixed;
	inset: 0;
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000000;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.tmh-story-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.92);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.tmh-story-viewport {
	position: relative;
	width: 100%;
	max-width: 440px;
	height: 100%;
	max-height: 92vh;
	background: #000000;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0,0,0,0.8);
	display: flex;
	flex-direction: column;
	z-index: 2;
}

@media (max-width: 500px) {
	.tmh-story-viewport {
		max-width: 100%;
		max-height: 100vh;
		border-radius: 0;
	}
}

/* Top Segment Progress Bars */
.tmh-story-progress-bar-wrap {
	position: absolute;
	top: 12px;
	left: 10px;
	right: 10px;
	display: flex;
	gap: 4px;
	z-index: 20;
}

.tmh-progress-segment {
	flex: 1;
	height: 2.5px;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	overflow: hidden;
	position: relative;
}

.tmh-progress-fill {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 0%;
	background: #FFFFFF;
	border-radius: 2px;
	transition: width 0.1s linear;
}

.tmh-progress-segment.is-active .tmh-progress-fill {
	/* width animated dynamically via requestAnimationFrame or setInterval */
}

.tmh-progress-segment.is-complete .tmh-progress-fill {
	width: 100% !important;
}

/* Top Header Bar */
.tmh-story-header {
	position: absolute;
	top: 22px;
	left: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	z-index: 20;
	color: #FFFFFF;
}

.tmh-story-brand {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tmh-story-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1.5px solid #F5B025;
	object-fit: cover;
	background: #8E0B16;
}

.tmh-story-info {
	display: flex;
	flex-direction: column;
}

.tmh-story-author {
	font-size: 12.5px;
	font-weight: 800;
	color: #FFFFFF;
	text-shadow: 0 1px 3px rgba(0,0,0,0.8);
	line-height: 1.2;
}

.tmh-story-badge {
	font-size: 9.5px;
	font-weight: 700;
	color: #F5B025;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.tmh-story-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.tmh-story-btn {
	background: rgba(0,0,0,0.35);
	border: none;
	color: #FFFFFF;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: background 0.2s, transform 0.2s;
}

.tmh-story-btn:hover {
	background: rgba(0,0,0,0.65);
	transform: scale(1.05);
}

.tmh-story-btn .material-symbols-outlined {
	font-size: 20px;
}

/* Story Media Stage */
.tmh-story-stage {
	position: relative;
	width: 100%;
	height: 100%;
	background: #0F172A;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tmh-story-media {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	animation: tmh-media-zoom 6s linear forwards;
}

@keyframes tmh-media-zoom {
	0% {
		transform: scale(1);
	}
	100% {
		transform: scale(1.04);
	}
}

.tmh-story-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0.4) 100%);
	pointer-events: none;
	z-index: 5;
}

/* Tap Navigation Zones */
.tmh-story-tap-zone {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 40%;
	z-index: 15;
	cursor: pointer;
}

.tmh-tap-left {
	left: 0;
}

.tmh-tap-right {
	right: 0;
	width: 60%;
}

/* Text Overlay & Swipe Up CTA */
.tmh-story-overlay {
	position: absolute;
	bottom: 24px;
	left: 18px;
	right: 18px;
	z-index: 18;
	color: #FFFFFF;
	pointer-events: auto;
}

.tmh-story-slide-title {
	font-size: 18px;
	font-weight: 800;
	color: #FFFFFF;
	line-height: 1.35;
	margin: 0 0 8px;
	text-shadow: 0 2px 6px rgba(0,0,0,0.8);
	font-family: var(--sd-font-gujarati, inherit);
}

.tmh-story-slide-desc {
	font-size: 13.5px;
	color: #E2E8F0;
	line-height: 1.45;
	margin: 0 0 16px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 1px 3px rgba(0,0,0,0.8);
	font-family: var(--sd-font-gujarati, inherit);
}

.tmh-story-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 12px 18px;
	background: linear-gradient(135deg, #F5B025 0%, #D97706 100%);
	color: #111111;
	border-radius: 28px;
	font-size: 13.5px;
	font-weight: 800;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(245,176,37,0.4);
	transition: transform 0.2s, box-shadow 0.2s;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.tmh-story-cta-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(245,176,37,0.5);
	color: #111111;
}

/* Nav Arrows for Desktop */
.tmh-nav-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	border: 1px solid rgba(255,255,255,0.25);
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 30;
	backdrop-filter: blur(10px);
	transition: background 0.2s, transform 0.2s;
}

.tmh-nav-arrow:hover {
	background: rgba(255,255,255,0.4);
	transform: translateY(-50%) scale(1.1);
}

.tmh-nav-prev {
	left: -65px;
}

.tmh-nav-next {
	right: -65px;
}

@media (max-width: 650px) {
	.tmh-nav-arrow {
		display: none !important;
	}
}

