* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;
}




/* Fix for mobile viewport height */
html {
	height: -webkit-fill-available;
}

body {
	min-height: 100vh;
	min-height: -webkit-fill-available;
}

/* Main container */
.video-swiper-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh; /* Use dynamic viewport height */
	height: -webkit-fill-available; /* iOS fix */
	background: #000;
	overflow: hidden;
	margin-block-start: 0rem;
}

/* Swiper styles */
.swiper {
	width: 100%;
	height: 100%;
}

.swiper-slide {
	position: relative;
	width: 100%;
	height: 100vh !important;
	min-height: 100vh !important;
	max-height: 100vh !important;
	overflow: hidden;
	transform: translate3d(0, 0, 0) !important;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

/* Video container - Full screen */
.video-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000;
	z-index: 1;
}

.video-wrapper iframe {
	width: 100%;
	height: 100%;
	border: none;
	position: absolute;
	top: 0;
	left: 0;
}

/* Black overlay for tapping/swiping */
.video-tap-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 85vh;
	z-index: 3;
	cursor: pointer;
	touch-action: pan-y;
}

/* Bottom overlay with controls */
.video-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 15px 12px 15px 12px;
	background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.7) 60%, rgb(0, 0, 0) 100%);
	z-index: 2;
}

.overlay-content {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 10px;
}

/* User info */
.user-info {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.user-avatar-link {
	display: flex;
	align-items: center;
	gap: 8px;
	color: white;
	text-decoration: none;
}

.user-avatar-link img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.3);
}

.username {
	font-size: 14px;
	font-weight: 600;
	color: white;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Video actions */
.video-actions {
	display: flex;
	align-items: center;
	gap: 15px;
	flex-shrink: 0;
}

.like-container {
	display: flex;
	align-items: center;
}

.like-btn, .like-display {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 8px;
	min-width: 44px;
	min-height: 44px;
}

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

.like-btn .heart, .like-display .heart {
	font-size: 20px;
	display: block;
}

.like-btn .like-count, .like-display .like-count {
	font-size: 11px;
	font-weight: 600;
	display: block;
}

/* Add video button */
.add-video-btn {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #FF0000;
	color: white;
	border: none;
	font-size: 22px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.add-video-btn:active {
	transform: scale(0.95);
}

/* Tags */
.video-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.post-tag {
	background: rgba(255, 255, 255, 0.2);
	color: white;
	padding: 5px 10px;
	border-radius: 15px;
	font-size: 12px;
	cursor: pointer;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

/* No videos message */
.no-videos-message {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #000;
	color: white;
	text-align: center;
	padding: 20px;
	z-index: 1;
	cursor: pointer;
}

.no-videos-message p {
	font-size: 16px;
	font-weight: 500;
	margin-bottom: 10px;
}

/* Login prompt */
.video-login-prompt {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background: rgba(0, 0, 0, 0.9);
	color: white;
	padding: 12px 15px;
	font-size: 13px;
	z-index: 10000;
	text-align: center;
	backdrop-filter: blur(10px);
}

.video-login-prompt a {
	color: #FF0000;
	text-decoration: none;
	font-weight: 600;
}

/* Modal styles */
.video-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 10000;
	backdrop-filter: blur(10px);
}

.video-modal-content {
	position: relative;
	background: #1a1a1a;
	margin: 20px;
	padding: 20px;
	border-radius: 12px;
	animation: modalSlideIn 0.3s ease;
}

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

.video-close {
	position: absolute;
	right: 15px;
	top: 15px;
	font-size: 24px;
	cursor: pointer;
	color: white;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
}

/* Form styles */
#video-modal h3 {
	color: white;
	margin-bottom: 20px;
	font-size: 18px;
	text-align: center;
}

.form-group {
	margin-bottom: 15px;
}

.form-group label {
	display: block;
	margin-bottom: 6px;
	color: white;
	font-size: 14px;
	font-weight: 500;
}

.form-group input[type="text"] {
	width: 100%;
	padding: 14px;
	border: 1px solid #333;
	border-radius: 8px;
	font-size: 15px;
	background: #2a2a2a;
	color: white;
}

.form-group input[type="text"]:focus {
	outline: none;
	border-color: #FF0000;
}

.tags-container {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.tag-button {
	padding: 10px 14px;
	background: #333;
	border: 1px solid #444;
	border-radius: 20px;
	cursor: pointer;
	font-size: 13px;
	color: #ccc;
}

.tag-button.selected {
	background: #FF0000;
	color: white;
	border-color: #FF0000;
}

.selected-tags {
	background: #2a2a2a;
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 12px;
	font-size: 13px;
	color: #aaa;
	border: 1px solid #333;
}

.form-group button[type="submit"],
.form-group button[type="button"] {
	padding: 14px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	width: 100%;
	margin-bottom: 10px;
}

.form-group button[type="submit"] {
	background: #FF0000;
	color: white;
}

.form-group button[type="button"] {
	background: #333;
	color: #ccc;
}

#video-form-message {
	margin-top: 15px;
	padding: 12px;
	border-radius: 8px;
	font-size: 13px;
	text-align: center;
}

.success-message {
	background: rgba(76, 175, 80, 0.2);
	color: #4CAF50;
	border: 1px solid rgba(76, 175, 80, 0.3);
}

.error-message {
	background: rgba(244, 67, 54, 0.2);
	color: #F44336;
	border: 1px solid rgba(244, 67, 54, 0.3);
}

.info-message {
	background: rgba(33, 150, 243, 0.2);
	color: #2196F3;
	border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Grid styles for modals */
.video-videos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 2fr));
	gap: 12px;
	margin-top: 20px;
}

.video-video-item {
	border-radius: 10px;
	overflow: hidden;
	background: #2a2a2a;
}

.video-thumbnail {
	position: relative;
	aspect-ratio: 9/16;
	overflow: hidden;
	background: #000;
	cursor: pointer;
}

.video-thumbnail-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.video-play-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s;
}

.video-thumbnail:hover .video-play-overlay {
	opacity: 1;
}

.play-icon {
	color: white;
	font-size: 24px;
}

.video-info-grid {
	padding: 12px;
}

.video-author {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.video-author img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
}

.video-author span {
	font-size: 12px;
	color: white;
	font-weight: 500;
}

.video-stats {
	display: flex;
	justify-content: flex-end;
}

.like-count {
	font-size: 11px;
	color: #aaa;
	display: flex;
	align-items: center;
	gap: 4px;
}

/* User profile header */
.user-profile-header {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #333;
}

.user-avatar-large img {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 3px solid #444;
}

.user-info h3 {
	margin: 0 0 4px 0;
	font-size: 20px;
	color: white;
}

.video-count {
	color: #FF0000;
	font-size: 13px;
	font-weight: 600;
}

.tag-header {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #333;
}

.tag-header h3 {
	margin: 0 0 4px 0;
	font-size: 20px;
	color: white;
}

.no-videos {
	text-align: center;
	color: #aaa;
	padding: 40px 20px;
	grid-column: 1 / -1;
	font-size: 14px;
}

/* Loading spinner */
.modal-loading {
	text-align: center;
	padding: 40px 20px;
	color: white;
}

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top: 3px solid #FF0000;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 15px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Large modal */
.video-modal-content.large-modal {
	margin: 5% auto;
	width: 90%;
	max-width: 500px;
	max-height: 80vh;
	overflow-y: auto;
}

/* Tablet styles */
@media (min-width: 768px) {
	.video-overlay {
		padding: 20px 20px 30px 20px;
	}
	
	.user-avatar-link img {
		width: 40px;
		height: 40px;
	}
	
	.username {
		font-size: 15px;
	}
	
	.add-video-btn {
		width: 48px;
		height: 48px;
		font-size: 24px;
	}
	
	.video-modal-content {
		margin: 10% auto;
		width: 90%;
		max-width: 500px;
	}
	
	.video-videos-grid {
		grid-template-columns: repeat(auto-fill, minmax(180px, 4fr));
		gap: 15px;
	}
}

/* Desktop styles */
@media (min-width: 1024px) {
	.video-videos-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 4fr));
		gap: 20px;
	}
	
	.video-modal-content {
		max-width: 600px;
	}
}

/* iOS safe area support */
@supports (padding: max(0px)) {
	.video-overlay {
		padding-bottom: max(25px, env(safe-area-inset-bottom) + 15px);
		padding-left: max(12px, env(safe-area-inset-left) + 12px);
		padding-right: max(12px, env(safe-area-inset-right) + 12px);
	}
	
	.video-login-prompt {
		padding-top: max(12px, env(safe-area-inset-top) + 12px);
	}
	
	.video-swiper-container {
		padding-top: env(safe-area-inset-top);
		padding-bottom: env(safe-area-inset-bottom);
		height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
	}
}

/* Force 100vh on mobile */
@media (max-width: 768px) {
	.video-swiper-container,
	.swiper-slide,
	.video-wrapper {
		height: 100vh !important;
		min-height: 100vh !important;
		max-height: 100vh !important;
		transform: translate3d(0, 0, 0);
	}
}



/* Play/Pause indicator */
.play-pause-indicator {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80px;
	height: 80px;
	background: rgba(0, 0, 0, 0.7);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	color: white;
	z-index: 10000;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
}

/* Make overlay buttons clickable */
.video-overlay .overlay-content > *,
.video-overlay .video-tags > * {
	pointer-events: auto;
}

/* Prevent overlay from blocking interactions */
.video-overlay {
	pointer-events: none;
}

.video-overlay .overlay-content,
.video-overlay .video-tags {
	pointer-events: auto;
}

/* Add to existing CSS file */

/* Loading slide styles */
.loading-slide {
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100% !important; 
}

.loading-more-videos {
	text-align: center;
	color: white;
	width: 100%;
	box-sizing: border-box;
	padding: 40px 20px;
}

.loading-more-videos .loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top: 3px solid #FF0000;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 15px;
}

.loading-more-videos p {
	font-size: 14px;
	color: #aaa;
}

/* Ensure iframes don't overlap */
.video-wrapper iframe {
	z-index: 1;
}

/* Preload container */
#video-preload-container {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Video states */
.video-slide.video-loading .video-wrapper {
	opacity: 0.5;
}

.video-slide.video-loaded .video-wrapper {
	opacity: 1;
	transition: opacity 0.3s;
}

/* Smooth transitions */
.swiper-slide {
	transition: transform 0.4s ease !important;
}

/* Active video indicator */
.video-slide.active-slide .video-overlay {
	background: linear-gradient(transparent 0%, rgba(255, 0, 0, 0.1) 60%, rgba(0, 0, 0, 0.9) 100%);
}

/* Better touch feedback */
.video-tap-overlay:active {
	background: rgba(255, 255, 255, 0.05);
}

/* Mobile optimizations */
@media (max-width: 768px) {
	.video-wrapper iframe {
		transform: scale(1.02); /* Slight zoom to cover edges */
	}
	
	.loading-more-videos {
		padding: 30px 15px;
	}
}

/* Performance optimizations */
.video-wrapper iframe {
	will-change: transform;
	backface-visibility: hidden;
	transform: translateZ(0);
}

/* Loading animation for initial load */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.swiper-slide {
	animation: fadeInUp 0.5s ease-out;
}


/* Add to your video-posts.css file */

/* Fix for Swiper slide gaps */
.swiper-slide {
	position: relative;
	width: 100%;
	height: 100vh !important;
	min-height: 100vh !important;
	max-height: 100vh !important;
	overflow: hidden;
	transform: translate3d(0, 0, 0) !important;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

/* Ensure wrapper maintains height */
.video-swiper-container,
.swiper,
.swiper-wrapper {
	height: 100vh !important;
	min-height: 100vh !important;
	max-height: 100vh !important;
	transform: translate3d(0, 0, 0);
}

/* Fix for mobile viewport */
@media (max-width: 768px) {
	.swiper-slide,
	.video-swiper-container,
	.swiper,
	.swiper-wrapper {
		height: 100vh !important;
		height: -webkit-fill-available !important;
		min-height: 100vh !important;
		min-height: -webkit-fill-available !important;
	}
}

/* Prevent Swiper from adding margins/padding */
.swiper-wrapper {
	padding: 0 !important;
	margin: 0 !important;
	box-sizing: border-box !important;
}

/* Loading slide specific styles */
.loading-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.loading-more-videos {
	text-align: center;
	color: white;
	padding: 40px;
}

.loading-more-videos .loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top: 3px solid #FF0000;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 15px;
}

.loading-more-videos p {
	font-size: 14px;
	color: #aaa;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}