/**
 * User Stories Manager - Styles
 * @version 1.0.0
 */

:root {
	--qa-safe-top-base: 0px;
	--qa-safe-bottom-base: 0px;
	--qa-safe-top: var(--qa-safe-top-base);
	--qa-safe-bottom: var(--qa-safe-bottom-base);
	--qa-viewport-height: 100vh;
}

@supports (padding: env(safe-area-inset-top)) {
	:root {
		--qa-safe-top-base: env(safe-area-inset-top);
		--qa-safe-bottom-base: env(safe-area-inset-bottom);
		--qa-safe-top: var(--qa-safe-top-base);
		--qa-safe-bottom: var(--qa-safe-bottom-base);
	}
}

/* ========================================
   STORY BAR
   ======================================== */

.qa-story-bar-container {
	/* padding: 5px 10px; */
	padding-top: 5px;
	padding-bottom: 0px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	position: relative;
	z-index: 50;
	order: -1; /* Place before other content */
	/* Scrollbar'ı gizle ama kaydırma özelliği kalsın */
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
}

/* Chrome, Safari, Opera için scrollbar'ı gizle */
.qa-story-bar-container::-webkit-scrollbar {
	display: none;
}

/* Position story bar in correct place on homepage */
body .qa-story-bar-container {
	margin-bottom: 0;
}

.qa-story-bar {
	display: flex;
	gap: 15px;
	padding: 0 20px;
	max-width: 1200px;
	margin: 0 auto;
	min-height: 70px;
}

.qa-story-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	flex-shrink: 0;
	width: 70px;
	transition: transform 0.2s;
}

.qa-story-item:hover {
	transform: scale(1.05);
}

.qa-story-avatar-wrapper {
	position: relative;
	margin-bottom: 8px;
	width: 70px;
	height: 70px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.qa-story-ring {
	padding: 1.5px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	width: 70px;
	height: 70px;
	box-sizing: border-box;
}

.qa-story-ring-viewed {
	background: #c0c0c0 !important;
}

.qa-story-ring-unviewed {
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	animation: pulse 1.5s ease-in-out 2;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

.qa-story-avatar {
	width: 62px !important;
	height: 62px !important;
	border-radius: 50%;
	object-fit: cover;
	object-position: center;
	background: #fff;
	border: 2px solid #fff;
	display: block;
	box-sizing: border-box;
}

/* Initial Avatar - when no profile picture */
.qa-story-avatar-initial {
	width: 62px !important;
	height: 62px !important;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	font-weight: 600;
	color: #fff;
	text-transform: uppercase;
	user-select: none;
	box-sizing: border-box;
}

.qa-story-avatar-initial-inner {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qa-story-username {
	font-size: 12px;
	text-align: center;
	width: 70px;
	max-width: 70px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #333;
	line-height: 1.2;
	min-height: 14px;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
	.qa-story-bar {
		gap: 10px;
		padding: 0 15px;
	}
	
	.qa-story-item {
		width: 64px;
	}
	
	.qa-story-avatar-wrapper {
		width: 64px;
		height: 64px;
		margin-bottom: 6px;
	}
	
	.qa-story-ring {
		width: 64px;
		height: 64px;
		padding: 1.5px;
	}
	
	.qa-story-avatar,
	.qa-story-avatar-initial {
		width: 59px !important;
		height: 59px !important;
		border: 2px solid #fff;
	}
	
	.qa-story-avatar-initial {
		font-size: 22px;
	}
	
	.qa-story-avatar-initial-inner {
		width: 100%;
		height: 100%;
	}
	
	.qa-story-username {
		font-size: 11px;
		width: 64px;
		max-width: 64px;
		min-height: 13px;
	}
	
	/* Story count badge kaldırıldı - mobil */
	
	.qa-story-add-icon {
		width: 20px;
		height: 20px;
		font-size: 14px;
		border: 2px solid #fff;
	}
}

.qa-story-count {
	display: none !important;
	/* Story sayısı badge'i kaldırıldı */
}

/* Add Story Button */
.qa-story-add .qa-story-ring {
	background: #e0e0e0;
}

.qa-story-add-icon {
	position: absolute;
	bottom: 0;
	right: 0;
	background: #4CAF50;
	color: #fff;
	font-size: 18px;
	font-weight: bold;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

/* ========================================
   STORY MODAL
   ======================================== */

.qa-story-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	overflow-y: auto; /* Allow modal to scroll */
}

.qa-story-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	z-index: 0; /* Below content to allow scrolling */
}

.qa-story-modal-content {
	position: relative;
	width: 100%;
	max-width: 500px;
	height: min(90vh, var(--qa-viewport-height, 90vh));
	max-height: min(900px, var(--qa-viewport-height, 900px));
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding-top: var(--qa-safe-top);
	padding-bottom: var(--qa-safe-bottom);
}

/* Close Button */
.qa-story-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 24px;
	cursor: pointer;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: background 0.2s;
}

.qa-story-modal-close:hover {
	background: rgba(0, 0, 0, 0.8);
}

/* Story Header */
.qa-story-modal-header {
	position: absolute;
	top: 15px;
	left: 15px;
	right: 60px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 20;
	background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
	padding: 10px;
	border-radius: 8px 8px 0 0;
}

.qa-story-modal-avatar {
	width: 40px !important;
	height: 40px !important;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
	box-sizing: border-box;
	cursor: pointer;
	transition: opacity 0.2s;
}

.qa-story-modal-avatar:hover {
	opacity: 0.8;
}

/* Initial avatar in modal */
.qa-story-modal-header .qa-story-avatar-initial {
	width: 40px !important;
	height: 40px !important;
	font-size: 18px;
	border: 2px solid #fff;
	box-sizing: border-box;
	flex-shrink: 0;
	cursor: pointer;
	transition: opacity 0.2s;
}

.qa-story-modal-header .qa-story-avatar-initial:hover {
	opacity: 0.8;
}

.qa-story-modal-header .qa-story-avatar-initial-inner {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	color: #fff;
}

.qa-story-modal-user-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
}

.qa-story-modal-username {
	font-weight: bold;
	color: #fff;
	font-size: 14px;
	cursor: pointer;
	transition: opacity 0.2s;
	line-height: 1.2;
}

.qa-story-modal-username:hover {
	opacity: 0.8;
	text-decoration: underline;
}

.qa-story-modal-time {
	color: rgba(255, 255, 255, 0.6);
	font-size: 11px;
	line-height: 1;
}

/* Progress Bars */
.qa-story-modal-progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	gap: 4px;
	padding: 8px 15px;
	z-index: 20;
}

.qa-story-progress-bar {
	flex: 1;
	height: 3px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	overflow: hidden;
}

.qa-story-progress-fill {
	height: 100%;
	background: #fff;
	width: 0%;
	transition: width 0.1s linear;
}

.qa-story-progress-fill.active {
	animation: none;
}

/* Media Container */
.qa-story-modal-media-container {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
	position: relative;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	overflow: hidden; /* Contain overlay within this container */
}

/* Blur effect for thumbnail background */
.qa-story-modal-media-container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: inherit;
	background-size: inherit;
	background-position: inherit;
	filter: blur(20px);
	opacity: 0.6;
	z-index: 1;
}

/* Loading Indicator */
.qa-story-loading-indicator {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
}

.qa-story-loading-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.qa-story-loading-text {
	color: #fff;
	font-size: 14px;
	margin-top: 15px;
	text-align: center;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.qa-story-modal-image,
.qa-story-modal-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	position: relative;
	z-index: 10;
	/* Context menüyü engelle (iOS & Android) */
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	pointer-events: auto;
}

/* Overlay image for videos (text/emoji layer) */
#qaStoryModalOverlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	pointer-events: none; /* Don't interfere with video controls */
	z-index: 11; /* Above video (video is z-index: 10) */
}

/* Caption */
.qa-story-modal-caption {
	position: absolute;
	bottom: 70px;
	left: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	padding: 12px;
	border-radius: 8px;
	font-size: 14px;
	z-index: 15;
}

/* Navigation Buttons */
.qa-story-modal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 28px;
	cursor: pointer;
	z-index: 15;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.qa-story-modal-nav:hover {
	background: rgba(0, 0, 0, 0.7);
}

.qa-story-modal-prev {
	left: 15px;
}

.qa-story-modal-next {
	right: 15px;
}

/* Story Report Button - Minimal Icon Only */
.qa-story-modal-report {
	position: absolute;
	top: 20px;
	right: 75px;
	z-index: 20;
}

.qa-story-report-btn {
	background: rgba(0, 0, 0, 0.4);
	color: rgba(255, 255, 255, 0.7);
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(10px);
	transition: all 0.3s;
}

.qa-story-report-btn:hover {
	background: rgba(0, 0, 0, 0.6);
	color: #f44336;
	transform: scale(1.15);
	box-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

.qa-story-report-btn:active {
	transform: scale(0.95);
}

.qa-story-report-icon {
	font-size: 22px;
	line-height: 1;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.qa-story-report-btn.reported {
	background: rgba(34, 197, 94, 0.9);
	cursor: default;
	color: #fff;
}

.qa-story-report-btn.reported:hover {
	transform: scale(1.05);
	background: rgba(34, 197, 94, 0.9);
	color: #fff;
}

.qa-story-report-btn.reported .qa-story-report-icon {
	display: none;
}

.qa-story-report-btn.reported::after {
	content: '✓';
	font-size: 22px;
	font-weight: bold;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

@media (max-width: 768px) {
	.qa-story-modal-report {
		top: 15px;
		right: 65px;
	}
	.qa-story-report-btn {
		width: 36px;
		height: 36px;
	}
	.qa-story-report-icon {
		font-size: 20px;
	}
	.qa-story-report-btn.reported::after {
		font-size: 20px;
	}
}

/* Story Actions */
.qa-story-modal-actions {
	position: absolute;
	bottom: 15px;
	left: 15px;
	right: 15px;
	display: flex;
	gap: 10px;
	z-index: 15;
}

.qa-story-action-btn {
	flex: 1;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	padding: 10px 15px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: background 0.2s;
}

.qa-story-action-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Story Reply */
.qa-story-reply-container {
	position: absolute;
	left: 15px;
	right: 15px;
	bottom: 15px;
	z-index: 15;
	display: none;
}

.qa-story-reply-form {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(0, 0, 0, 0.75);
	border-radius: 12px;
	padding: 10px 12px;
	backdrop-filter: blur(6px);
}

.qa-story-reply-input {
	flex: 1;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 32px;
	color: #fff;
	-webkit-text-fill-color: #fff;
	caret-color: #fff;
	font-size: 14px;
	padding: 10px 14px;
	resize: none;
	overflow: hidden;
	min-height: 40px;
	max-height: 40px;
	line-height: 1.4;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.qa-story-reply-input::placeholder {
	color: rgba(255, 255, 255, 0.7);
}

.qa-story-reply-input:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.45);
	background: rgba(0, 0, 0, 0.75);
}

.qa-story-reply-status {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.8);
	white-space: nowrap;
	min-width: 0;
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qa-story-reply-status--success {
	color: #a2f3a2;
}

.qa-story-reply-status--error {
	color: #ffc3c3;
}

.qa-story-reply-send {
	background: #4CAF50;
	color: #fff;
	border: none;
	padding: 0 18px;
	border-radius: 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.qa-story-reply-send:hover:not(:disabled) {
	background: #43a047;
}

.qa-story-reply-send:active:not(:disabled) {
	transform: scale(0.98);
}

.qa-story-reply-send:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ========================================
   REPORT MODAL
   ======================================== */

.qa-story-report-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qa-story-report-content {
	background: white;
	border-radius: 12px;
	width: 90%;
	max-width: 500px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 30px;
	position: relative;
	z-index: 1000000;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	margin: auto;
}

.qa-story-report-content h2 {
	text-align: center;
}

.qa-story-report-content > p {
	text-align: center;
}

.qa-story-report-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.qa-story-report-option {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 15px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
}

.qa-story-report-option:hover {
	background: #f5f5f5;
	border-color: #bdbdbd;
}

.qa-story-report-option input[type="radio"] {
	margin-top: 4px;
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
}

.qa-story-report-option input[type="radio"]:checked ~ .qa-story-report-option-label {
	color: #f44336;
}

.qa-story-report-option:has(input:checked) {
	background: #ffebee;
	border-color: #f44336;
}

.qa-story-report-option-label {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.qa-story-report-option-label strong {
	font-size: 15px;
	color: #333;
	display: block;
}

.qa-story-report-option-label small {
	font-size: 12px;
	color: #666;
	display: block;
	line-height: 1.4;
}

@media (max-width: 768px) {
	.qa-story-report-content {
		width: 95%;
		padding: 20px;
		max-height: 85vh;
	}
	
	.qa-story-report-option {
		padding: 12px;
	}
	
	.qa-story-report-option-label strong {
		font-size: 14px;
	}
	
	.qa-story-report-option-label small {
		font-size: 11px;
	}
}

/* ========================================
   UPLOAD MODAL
   ======================================== */

.qa-story-upload-modal {
	/* Override parent flex layout for upload modal */
	align-items: flex-start !important;
	padding-top: 20px;
	padding-bottom: 20px;
	overflow-y: auto !important;
}

.qa-story-upload-modal .qa-story-modal-overlay {
	background: rgba(0, 0, 0, 0.85);
	position: fixed;
}

.qa-story-upload-content {
	position: relative;
	width: 90%;
	max-width: 520px; /* Wider for bigger 18:9 canvas */
	max-height: calc(100vh - 40px); /* Full height minus padding */
	background: #fff;
	border-radius: 12px;
	padding: 30px;
	margin: 0 auto; /* Center horizontally */
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
	z-index: 1; /* Above overlay to allow scrolling */
	pointer-events: auto; /* Allow interactions with content */
}

.qa-story-upload-content h2 {
	margin: 0 0 25px 0;
	font-size: 24px;
	color: #333;
}

/* Scrollbar styling for upload modal */
.qa-story-upload-content::-webkit-scrollbar {
	width: 8px;
}

.qa-story-upload-content::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.qa-story-upload-content::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.qa-story-upload-content::-webkit-scrollbar-thumb:hover {
	background: #555;
}

.qa-story-upload-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Drop Zone */
.qa-story-upload-drop {
	border: 3px dashed #ccc;
	border-radius: 12px;
	padding: 60px 20px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s;
}

.qa-story-upload-drop:hover,
.qa-story-upload-drop.qa-story-upload-dragover {
	border-color: #4CAF50;
	background: #f0f8f0;
}

.qa-story-upload-icon {
	font-size: 48px;
	margin-bottom: 15px;
}

.qa-story-upload-drop p {
	margin: 0 0 5px 0;
	font-size: 16px;
	color: #333;
	font-weight: 500;
}

.qa-story-upload-drop small {
	color: #666;
	font-size: 13px;
}

/* Preview */
.qa-story-upload-preview {
	max-height: 400px;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qa-story-upload-preview img,
.qa-story-upload-preview video {
	max-width: 100%;
	max-height: 400px;
	object-fit: contain;
}

/* Form Fields */
.qa-story-upload-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.qa-story-upload-field label {
	font-weight: 500;
	color: #333;
	font-size: 14px;
}

.qa-story-upload-field input,
.qa-story-upload-field select {
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
}

.qa-story-upload-field input:focus,
.qa-story-upload-field select:focus {
	outline: none;
	border-color: #4CAF50;
}

/* Submit Button */
.qa-story-upload-submit {
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	color: #fff;
	border: none;
	padding: 14px 24px;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}

.qa-story-upload-submit:hover:not(:disabled) {
	opacity: 0.9;
}

.qa-story-upload-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ========================================
   STORY EDITOR (Instagram-style)
   ======================================== */

/* Editor Container */
.qa-story-editor-container {
	width: 100%;
	max-width: 400px; /* Wider for bigger 18:9 canvas */
	max-height: none; /* Dynamic height based on canvas */
	margin: 20px auto;
	background: #1a1a1a;
	border-radius: 12px;
	overflow: hidden;
	position: relative;
}

/* Canvas wrapper - Fabric.js creates this */
.qa-story-editor-container .canvas-container {
	margin: 0 auto;
	display: block;
	position: relative;
	background: #000;
	width: 100%;
}

/* Force Fabric.js canvases to display correctly */
.qa-story-editor-container .canvas-container canvas {
	display: block;
	width: 100%;
	height: auto;
	touch-action: manipulation; /* Allow pinch-zoom */
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

/* Both Fabric.js canvas layers */
.qa-story-editor-container .lower-canvas,
.qa-story-editor-container .upper-canvas {
	position: absolute;
	left: 0;
	top: 0;
}

/* Editor Toolbar */
.qa-story-editor-toolbar {
	display: flex;
	justify-content: center;
	gap: 15px;
	padding: 15px;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(10px);
	position: relative;
	margin-top: 10px;
	border-radius: 0 0 12px 12px;
}

.qa-editor-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	padding: 10px 15px;
	border-radius: 10px;
	color: #fff;
	cursor: pointer;
	transition: all 0.2s;
	min-width: 70px;
}

.qa-editor-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(1.05);
}

.qa-editor-btn:active {
	transform: scale(0.95);
}

.qa-editor-icon {
	font-size: 24px;
	line-height: 1;
}

.qa-editor-label {
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Text Editor Panel */
.qa-text-editor-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.95);
	padding: 20px;
	border-radius: 12px;
	z-index: 1000;
	min-width: 300px;
	max-width: 90%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.qa-text-editor-panel input[type="text"] {
	width: 100%;
	padding: 12px;
	font-size: 18px;
	border: 2px solid #fff;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	margin-bottom: 15px;
	font-weight: 600;
}

.qa-text-editor-panel input[type="text"]::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

.qa-text-options {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.qa-text-options input[type="color"] {
	width: 50px;
	height: 40px;
	border: 2px solid #fff;
	border-radius: 6px;
	cursor: pointer;
	background: transparent;
}

.qa-text-options select {
	padding: 8px 12px;
	border: 2px solid #fff;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.qa-text-options label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-size: 14px;
	cursor: pointer;
}

.qa-text-options input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
}

#qaTextDone {
	padding: 8px 20px;
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}

#qaTextDone:hover {
	opacity: 0.9;
}

/* Emoji Picker */
.qa-emoji-picker {
	position: absolute;
	bottom: 80px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.95);
	padding: 15px;
	border-radius: 12px;
	z-index: 1000;
	max-width: 90%;
	max-height: 250px;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.qa-emoji-grid {
	display: grid;
	grid-template-columns: repeat(15, 1fr);
	gap: 8px;
	font-size: 28px;
	user-select: none;
	text-align: center;
}

.qa-emoji-grid span {
	cursor: pointer;
	transition: transform 0.1s;
	text-align: center;
	padding: 5px;
	border-radius: 6px;
}

.qa-emoji-grid span:hover {
	transform: scale(1.3);
	background: rgba(255, 255, 255, 0.1);
}

.qa-emoji-grid span:active {
	transform: scale(1.1);
}

/* Scrollbar for emoji picker */
.qa-emoji-picker::-webkit-scrollbar {
	width: 8px;
}

.qa-emoji-picker::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
}

.qa-emoji-picker::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.3);
	border-radius: 4px;
}

.qa-emoji-picker::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.qa-story-editor-container {
		max-width: 100%;
		border-radius: 0;
		margin: 10px auto;
	}
	
	.qa-editor-btn {
		min-width: 60px;
		padding: 8px 10px;
	}
	
	.qa-editor-icon {
		font-size: 20px;
	}
	
	.qa-editor-label {
		font-size: 10px;
	}
	
	.qa-text-editor-panel {
		min-width: 280px;
		padding: 15px;
	}
	
	.qa-emoji-picker {
		max-width: 95%;
		max-height: 200px;
	}
	
	.qa-emoji-grid {
		grid-template-columns: repeat(10, 1fr);
		font-size: 24px;
		gap: 6px;
	}
}

/* ========================================
   VIEWERS MODAL
   ======================================== */

.qa-story-viewers-content {
	position: relative;
	width: 90%;
	max-width: 400px;
	max-height: 80vh;
	background: #fff;
	border-radius: 12px;
	padding: 30px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	z-index: 1; /* Above overlay */
	margin: auto; /* Center horizontally and vertically */
}

.qa-story-viewers-content h2 {
	margin: 0 0 20px 0;
	font-size: 20px;
	color: #333;
}

.qa-story-viewers-list {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.qa-story-viewer-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 8px;
	transition: background 0.2s;
}

.qa-story-viewer-item:hover {
	background: #f5f5f5;
}

.qa-story-viewer-avatar {
	width: 44px !important;
	height: 44px !important;
	border-radius: 50%;
	object-fit: cover;
}

.qa-story-viewer-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.qa-story-viewer-username {
	font-weight: 500;
	color: #333;
	font-size: 14px;
}

.qa-story-viewer-time {
	color: #666;
	font-size: 12px;
}

.qa-story-no-viewers {
	text-align: center;
	color: #999;
	padding: 40px 20px;
}

/* ========================================
   WIDGET
   ======================================== */

.qa-story-widget {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 20px;
}

.qa-story-widget h3 {
	margin: 0 0 15px 0;
	font-size: 16px;
	color: #333;
}

.qa-story-widget-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.qa-story-widget-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s;
}

.qa-story-widget-item:hover {
	background: #f5f5f5;
}

.qa-story-widget-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #e0e0e0;
}

.qa-story-widget-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.qa-story-widget-username {
	font-weight: 500;
	color: #333;
	font-size: 13px;
}

.qa-story-widget-count {
	color: #666;
	font-size: 11px;
}

.qa-story-widget-badge {
	background: #ff4458;
	color: #fff;
	font-size: 10px;
	font-weight: bold;
	padding: 3px 8px;
	border-radius: 12px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Desktop/Tablet - Keep modal centered and normal size */
@media (min-width: 769px) {
	.qa-story-modal-content {
		width: 100%;
		max-width: 500px; /* Fixed width on desktop */
		height: 90vh;
		max-height: 900px;
		border-radius: 8px;
		margin: auto; /* Center */
	}
}

/* Mobile only - Full screen */
@media (max-width: 768px) {
	/* Story modal - full screen on mobile */
	.qa-story-modal {
		align-items: stretch;
		justify-content: stretch;
		height: min(100vh, var(--qa-viewport-height, 100vh));
		height: calc(var(--vh, 1vh) * 100); /* Use JS-calculated height */
	}
	
	@supports (height: 100dvh) {
		.qa-story-modal {
			height: 100dvh;
		}
	}
	
	.qa-story-modal-content {
		max-width: 100%;
		width: 100%;
		height: min(var(--qa-viewport-height, 100vh), 100vh);
		max-height: none;
		border-radius: 0;
		margin: 0;
	}
	
	/* Upload modal */
	.qa-story-upload-content {
		width: 95%;
		padding: 20px;
		max-height: 95vh;
		overflow-y: scroll; /* Force scrollbar on mobile */
	}
	
	/* Editor container */
	.qa-story-editor-container {
		max-height: none; /* Dynamic height for 18:9 canvas */
		margin: 10px auto;
	}
	
	.qa-story-upload-content h2 {
		font-size: 20px;
		margin-bottom: 20px;
	}
	
	.qa-story-upload-drop {
		padding: 40px 15px;
	}
	
	/* Navigation buttons */
	.qa-story-modal-nav {
		width: 36px;
		height: 36px;
		font-size: 24px;
	}
	
	/* Header elements - better positioning */
	.qa-story-modal-header {
		padding: 15px;
	}
	
	/* Actions - ensure visibility on mobile */
	.qa-story-modal-actions {
		background: rgba(0, 0, 0, 0.8); /* Dark background for visibility */
		border-radius: 8px;
		padding: 12px;
		left: 12px;
		right: 12px;
		bottom: calc(12px + var(--qa-safe-bottom));
	}

	.qa-story-reply-container {
		left: 12px;
		right: 12px;
		bottom: calc(12px + var(--qa-safe-bottom));
	}

	.qa-story-reply-form {
		padding: 10px;
		gap: 8px;
	}
	
	/* Viewers modal - keep centered on mobile */
	.qa-story-viewers-modal {
		align-items: center !important;
		justify-content: center !important;
	}
	
	.qa-story-viewers-content {
		margin: 20px auto; /* Add some spacing from edges */
		max-width: 90%;
	}
}

/* Fullscreen mode styles */
.qa-story-modal:fullscreen,
.qa-story-modal:-webkit-full-screen,
.qa-story-modal:-moz-full-screen,
.qa-story-modal:-ms-fullscreen {
	width: 100vw;
	height: 100vh;
}

.qa-story-modal:fullscreen .qa-story-modal-content,
.qa-story-modal:-webkit-full-screen .qa-story-modal-content {
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.qa-story-modal {
	animation: fadeIn 0.2s ease-in-out;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.qa-story-bar-container::-webkit-scrollbar,
.qa-story-viewers-list::-webkit-scrollbar {
	height: 6px;
	width: 6px;
}

.qa-story-bar-container::-webkit-scrollbar-track,
.qa-story-viewers-list::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.qa-story-bar-container::-webkit-scrollbar-thumb,
.qa-story-viewers-list::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 3px;
}

.qa-story-bar-container::-webkit-scrollbar-thumb:hover,
.qa-story-viewers-list::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* =====================================
   VALIDATION POPUP STYLES
   ===================================== */

.qa-validation-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.qa-validation-popup-show {
	opacity: 1;
	pointer-events: all;
}

.qa-validation-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
}

.qa-validation-popup-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 32px 28px;
	max-width: 420px;
	width: 90%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	transform: scale(0.8);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qa-validation-popup-show .qa-validation-popup-content {
	transform: scale(1);
}

.qa-validation-popup-icon {
	font-size: 64px;
	line-height: 1;
	margin-bottom: 16px;
	animation: qa-popup-icon-bounce 0.6s ease;
}

@keyframes qa-popup-icon-bounce {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

.qa-validation-popup-title {
	font-size: 22px;
	font-weight: 700;
	color: #333;
	margin: 0 0 12px 0;
	line-height: 1.3;
}

.qa-validation-popup-message {
	font-size: 15px;
	color: #666;
	line-height: 1.6;
	margin: 0 0 24px 0;
}

.qa-validation-popup-message strong {
	color: #e74c3c;
	font-weight: 600;
}

.qa-validation-popup-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
	padding: 14px 40px;
	border-radius: 25px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
	outline: none;
}

.qa-validation-popup-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.qa-validation-popup-btn:active {
	transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 480px) {
	.qa-validation-popup-content {
		padding: 24px 20px;
		max-width: 340px;
	}
	
	.qa-validation-popup-icon {
		font-size: 48px;
		margin-bottom: 12px;
	}
	
	.qa-validation-popup-title {
		font-size: 18px;
		margin-bottom: 10px;
	}
	
	.qa-validation-popup-message {
		font-size: 14px;
		margin-bottom: 20px;
	}
	
	.qa-validation-popup-btn {
		padding: 12px 32px;
		font-size: 15px;
	}
}
