/* ==========================================================================
   ChimpVine Stories Plugin Stylesheet
   ========================================================================== */

/* Main Container */
.cv-stories-container {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.cv-stories-container *, .cv-stories-container *::before, .cv-stories-container *::after {
	box-sizing: border-box;
}

/* Category Filter Tabs */
.cv-stories-tabs-wrapper {
	margin-bottom: 28px;
	display: flex;
	justify-content: center;
}

.cv-stories-tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	padding: 6px;
	margin: 0;
	background: #F1F5F9;
	border-radius: 999px;
	border: 1px solid #E2E8F0;
}

.cv-tab-item {
	padding: 8px 20px;
	font-size: 14px;
	font-weight: 600;
	color: #64748B;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	user-select: none;
}

.cv-tab-item:hover {
	color: #1E1B4B;
	background: rgba(255, 255, 255, 0.6);
}

.cv-tab-item.active {
	background: #7C3AED;
	color: #FFFFFF;
	box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Showcase Layout (Split 2 Columns) */
.cv-showcase-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 28px;
	align-items: start;
}

@media (max-width: 900px) {
	.cv-showcase-grid {
		grid-template-columns: 1fr;
	}
}

/* LEFT FEATURED CARD */
.cv-featured-card {
	background: #0F0C20;
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 20px 40px rgba(15, 12, 32, 0.25);
	transition: all 0.3s ease;
}

.cv-featured-video-box {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cv-featured-video-box::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(15, 12, 32, 0.8) 100%);
	z-index: 1;
}

/* Category Badge Overlay */
.cv-badge-overlay {
	position: absolute;
	top: 16px;
	right: 16px;
	background: rgba(15, 12, 32, 0.75);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #E2E8F0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.8px;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	z-index: 3;
	text-transform: uppercase;
}

/* Big Central Play Button */
.cv-play-btn {
	position: relative;
	z-index: 4;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	outline: none;
}

.cv-play-btn svg {
	margin-left: 3px;
	transition: transform 0.2s ease;
}

.cv-play-btn:hover {
	transform: scale(1.12);
	box-shadow: 0 14px 30px rgba(124, 58, 237, 0.6);
}

.cv-play-btn:hover svg {
	transform: scale(1.15);
}

/* HTML5 Video Element */
.cv-video-player-container {
	position: absolute;
	inset: 0;
	z-index: 5;
	background: #000;
}

.cv-video-player-container video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* =========================================================================
   CUSTOM VIDEO PLAYER ENGINE
   ========================================================================= */

.cv-custom-player-wrap {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
	overflow: hidden;
	z-index: 5;
}

.cv-custom-player-wrap:fullscreen {
	width: 100vw;
	height: 100vh;
}

.cv-player-media-host {
	width: 100%;
	height: 100%;
	position: relative;
}

.cv-player-media-host iframe,
.cv-player-media-host video {
	width: 100%;
	height: 100%;
	border: none;
	object-fit: cover;
	display: block;
}

/* Click overlay for play/pause */
.cv-player-click-overlay {
	position: absolute;
	inset: 0;
	z-index: 8;
	cursor: pointer;
}

/* Big center play/pause button */
.cv-custom-big-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 12;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(124, 58, 237, 0.88);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 2px solid rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 12px 40px rgba(124, 58, 237, 0.55), 0 0 0 0 rgba(124, 58, 237, 0.3);
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	outline: none;
	animation: cv-pulse-glow 2s ease-in-out infinite;
}

@keyframes cv-pulse-glow {
	0%, 100% { box-shadow: 0 12px 40px rgba(124, 58, 237, 0.55), 0 0 0 0 rgba(124, 58, 237, 0.3); }
	50%      { box-shadow: 0 12px 40px rgba(124, 58, 237, 0.55), 0 0 0 14px rgba(124, 58, 237, 0); }
}

.cv-custom-big-play:hover {
	transform: translate(-50%, -50%) scale(1.12);
	background: rgba(124, 58, 237, 0.95);
}

.cv-custom-big-play svg {
	margin-left: 3px;
}

.cv-custom-big-play.cv-hidden {
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0.6);
}

/* Bottom Gradient Controls Bar */
.cv-custom-controls-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 15;
	padding: 0 16px 14px 16px;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
	display: flex;
	align-items: center;
	gap: 12px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.cv-custom-player-wrap:hover .cv-custom-controls-bar,
.cv-custom-player-wrap:fullscreen .cv-custom-controls-bar {
	opacity: 1;
}

/* Control Buttons */
.cv-ctrl-btn {
	background: none;
	border: none;
	color: #FFF;
	cursor: pointer;
	padding: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	outline: none;
	border-radius: 6px;
	flex-shrink: 0;
}

.cv-ctrl-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	transform: scale(1.08);
}

/* Progress Scrubber Container */
.cv-progress-wrap {
	flex: 1;
	height: 20px;
	display: flex;
	align-items: center;
	position: relative;
	cursor: pointer;
}

.cv-progress-track {
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	overflow: hidden;
	position: relative;
	transition: height 0.15s ease;
	pointer-events: none;
}

.cv-progress-wrap:hover .cv-progress-track {
	height: 6px;
}

.cv-progress-buffered {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 999px;
}

.cv-progress-filled {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, #A78BFA 0%, #7C3AED 100%);
	border-radius: 999px;
	transition: width 0.08s linear;
}

/* Range input scrubber overlay (invisible but interactive) */
.cv-progress-scrubber {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	z-index: 3;
}

.cv-progress-scrubber::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #7C3AED;
}

/* Time Display */
.cv-time-display {
	color: rgba(255, 255, 255, 0.85);
	font-size: 12px;
	font-weight: 500;
	min-width: 85px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.3px;
	flex-shrink: 0;
	font-family: 'Inter', -apple-system, sans-serif;
}

/* Dark Quote Section Below Video */
.cv-featured-content-box {
	padding: 30px 32px 32px 32px;
	background: #0F0C20;
}

.cv-featured-quote {
	font-size: 17px;
	line-height: 1.6;
	font-weight: 400;
	color: #F8FAFC;
	margin: 0 0 24px 0;
	padding: 0;
	border: none;
	font-style: normal;
	position: relative;
}

.cv-featured-quote::before,
.cv-featured-quote::after {
	content: none !important;
}

.cv-featured-person-meta {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cv-person-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.15);
	flex-shrink: 0;
}

.cv-person-avatar[src=""],
.cv-person-avatar[src="#"],
.cv-person-avatar:not([src]) {
	display: none !important;
}

.cv-person-info {
	display: flex;
	flex-direction: column;
}

.cv-person-name {
	font-size: 15px;
	font-weight: 700;
	color: #FFFFFF;
	margin: 0 0 2px 0;
}

.cv-person-role {
	font-size: 13px;
	font-weight: 400;
	color: #94A3B8;
}

/* RIGHT SIDEBAR CARDS */
.cv-showcase-right {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.cv-sidebar-cards-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Accent Card Varieties */
.cv-side-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1.5px solid transparent;
	background: #FFFFFF;
}

.cv-side-card:hover {
	transform: translateY(-3px);
}

.cv-side-card.active-side-card {
	border-color: #7C3AED !important;
	box-shadow: 0 8px 24px rgba(124, 58, 237, 0.22) !important;
	transform: translateY(-2px);
}

/* VIDEO MODAL LIGHTBOX FOR GRID ARCHIVE */
.cv-story-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(15, 12, 32, 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: cvFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-story-modal-box {
	position: relative;
	width: 100%;
	max-width: 820px;
	background: #0F0C20;
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.cv-story-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 15;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	color: #FFFFFF;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	outline: none;
}

.cv-story-modal-close:hover {
	background: rgba(255, 255, 255, 0.4);
	transform: scale(1.1);
}

.cv-story-modal-video-wrap {
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	position: relative;
}

.cv-story-modal-body {
	padding: 28px 32px;
	background: #0F0C20;
}

.cv-modal-quote {
	font-size: 17px;
	line-height: 1.6;
	color: #F8FAFC;
	margin: 16px 0 22px 0;
	padding: 0;
	border: none;
	font-style: normal;
}

.cv-modal-person-meta {
	display: flex;
	align-items: center;
	gap: 14px;
}

@keyframes cvFadeIn {
	from { opacity: 0; transform: scale(0.96); }
	to { opacity: 1; transform: scale(1); }
}

/* Color Accent Themes */
.cv-accent-purple {
	background: #F5F3FF;
	border-color: #DDD6FE;
	box-shadow: 0 4px 14px rgba(124, 58, 237, 0.08);
}
.cv-accent-purple .cv-side-badge { color: #7C3AED; }

.cv-accent-pink {
	background: #FFF1F2;
	border-color: #FECDD3;
	box-shadow: 0 4px 14px rgba(225, 29, 72, 0.08);
}
.cv-accent-pink .cv-side-badge { color: #E11D48; }

.cv-accent-blue {
	background: #F0F9FF;
	border-color: #BAE6FD;
	box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}
.cv-accent-blue .cv-side-badge { color: #0284C7; }

.cv-accent-yellow {
	background: #FFFBEB;
	border-color: #FDE68A;
	box-shadow: 0 4px 14px rgba(217, 119, 6, 0.08);
}
.cv-accent-yellow .cv-side-badge { color: #D97706; }

/* Side Card Inner Elements */
.cv-side-thumb-box {
	position: relative;
	width: 90px;
	height: 64px;
	border-radius: 12px;
	background-size: cover;
	background-position: center;
	flex-shrink: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cv-side-thumb-box::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
}

.cv-side-play-icon {
	position: relative;
	z-index: 2;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.35);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.cv-side-play-icon svg {
	margin-left: 2px;
}

.cv-side-content {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cv-side-badge {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.cv-side-person-name {
	font-size: 15px;
	font-weight: 700;
	color: #1E1B4B;
	margin: 0 0 2px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cv-side-person-role {
	font-size: 12px;
	color: #64748B;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Mascot Asset Wrapper Below Sidebar */
.cv-mascot-asset-wrapper {
	display: flex;
	justify-content: flex-end;
	padding-top: 10px;
	padding-right: 20px;
}

.cv-mascot-img {
	max-width: 170px;
	height: auto;
	filter: drop-shadow(0 10px 15px rgba(0,0,0,0.05));
	animation: cvFloat 4s ease-in-out infinite;
}

@keyframes cvFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-6px); }
}

/* RESPONSIVE GRID ARCHIVE LAYOUT */
.cv-grid-layout {
	display: grid !important;
	gap: 24px !important;
	margin-top: 20px !important;
}

.cv-grid-col-1 { grid-template-columns: 1fr !important; }
.cv-grid-col-2 { grid-template-columns: repeat(2, 1fr) !important; }
.cv-grid-col-3 { grid-template-columns: repeat(3, 1fr) !important; }
.cv-grid-col-4 { grid-template-columns: repeat(4, 1fr) !important; }

@media (max-width: 1024px) {
	.cv-grid-col-4 { grid-template-columns: repeat(2, 1fr) !important; }
	.cv-grid-col-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 640px) {
	.cv-grid-col-4, .cv-grid-col-3, .cv-grid-col-2 { grid-template-columns: 1fr !important; }
}

.cv-grid-card {
	background: #FFFFFF;
	border-radius: 20px;
	border: 1px solid #E2E8F0;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
	transition: all 0.25s ease;
	width: 100% !important;
	display: flex;
	flex-direction: column;
}

.cv-grid-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(124, 58, 237, 0.12);
}

.cv-grid-video-box {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cv-grid-video-box::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.25);
}

.cv-grid-play-btn {
	position: relative;
	z-index: 3;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #7C3AED;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
	transition: transform 0.2s ease;
	pointer-events: none;
}

.cv-grid-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
	justify-content: space-between;
}

.cv-featured-quote,
.cv-grid-quote,
.cv-modal-quote {
	font-style: normal !important;
	position: relative !important;
}

.cv-featured-quote::before, .cv-featured-quote::after,
.cv-grid-quote::before, .cv-grid-quote::after,
.cv-modal-quote::before, .cv-modal-quote::after {
	content: none !important;
	display: none !important;
}

.cv-grid-quote {
	font-size: 14px;
	color: #334155;
	line-height: 1.5;
	margin: 0 0 16px 0;
	border: none;
	padding: 0;
}

.cv-grid-person-meta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cv-grid-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
}

.cv-grid-person-name {
	font-size: 14px;
	font-weight: 700;
	color: #1E1B4B;
	margin: 0 0 2px 0;
}

.cv-grid-person-role {
	font-size: 12px;
	color: #64748B;
}

/* Pagination */
.cv-grid-pagination {
	margin-top: 36px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.cv-grid-pagination .page-numbers {
	padding: 8px 16px;
	border-radius: 10px;
	background: #F1F5F9;
	color: #475569;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.2s ease;
}

.cv-grid-pagination .page-numbers.current,
.cv-grid-pagination .page-numbers:hover {
	background: #7C3AED;
	color: #FFFFFF;
}

.cv-no-stories {
	text-align: center;
	padding: 40px 20px;
	color: #64748B;
	font-size: 15px;
}

/* Loading Overlay for AJAX */
.cv-loading-state {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
