/* MediaViewer Component Styles */

.media-viewer-container {
	margin: 2rem 0;
}

/* Skeleton loader */
.media-viewer-skeleton {
	padding: 2rem 0;
}

.skeleton-section {
	margin-bottom: 3rem;
}

.skeleton-title {
	height: 24px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: skeleton-shimmer 1.5s infinite;
	border-radius: 4px;
	margin-bottom: 1rem;
	width: 200px;
}

.skeleton-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
}

.skeleton-card {
	height: 200px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: skeleton-shimmer 1.5s infinite;
	border-radius: 8px;
}

@keyframes skeleton-shimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

/* Media sections */
.media-section {
	margin-bottom: 3rem;
}

.media-section-title {
	color: #333;
	font-weight: 600;
	border-bottom: 2px solid #f0f0f0;
	padding-bottom: 0.75rem;
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
}

.media-section-title i {
	color: #6c757d;
}

/* Media cards */
.media-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
	transition: all 0.3s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.media-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.media-preview {
	position: relative;
	overflow: hidden;
	flex-grow: 1;
}

.image-card .media-preview {
	height: 200px;
}

.video-card .media-preview {
	height: auto;
}

.media-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.media-card:hover .media-image {
	transform: scale(1.05);
}

.media-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.media-card:hover .media-overlay {
	opacity: 1;
}

.media-overlay .btn {
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.media-info {
	padding: 1rem;
	background: #fff;
}

.media-title {
	font-weight: 600;
	color: #333;
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.media-size {
	color: #6c757d;
	font-size: 0.8rem;
}

/* Swiper customization */
.media-section .swiper {
	padding-bottom: 3rem;
}

.media-section .swiper-pagination {
	bottom: 0;
}

.media-section .swiper-pagination-bullet {
	width: 12px;
	height: 12px;
	background: #dee2e6;
	opacity: 1;
	transition: all 0.3s ease;
}

.media-section .swiper-pagination-bullet-active {
	background: #007bff;
	transform: scale(1.2);
}

.media-section .swiper-button-next,
.media-section .swiper-button-prev {
	color: #007bff;
	background: rgba(255,255,255,0.9);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
}

.media-section .swiper-button-next:hover,
.media-section .swiper-button-prev:hover {
	background: #fff;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.media-section .swiper-button-next::after,
.media-section .swiper-button-prev::after {
	font-size: 16px;
	font-weight: 600;
}

/* Document and file lists */
.list-group-item {
	border: 1px solid #e9ecef;
	margin-bottom: 0.5rem;
	border-radius: 8px !important;
	transition: all 0.2s ease;
}

.list-group-item:hover {
	background-color: #f8f9fa;
	transform: translateX(4px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.list-group-item h6 {
	margin: 0;
	font-weight: 500;
	color: #333;
}

.list-group-item .text-muted {
	font-size: 0.85rem;
}

/* Audio players */
.audio-list .list-group-item {
	padding: 1.25rem;
}

.audio-list audio {
	margin-top: 0.75rem;
	border-radius: 6px;
}

/* Image lightbox modal */
#mediaImageModal .modal-content {
	background: #000;
}

.lightbox-container {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lightbox-image {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	transition: transform 0.3s ease;
	cursor: grab;
}

.lightbox-image:active {
	cursor: grabbing;
}

.lightbox-controls {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	gap: 0.5rem;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.lightbox-container:hover .lightbox-controls {
	opacity: 1;
	pointer-events: auto;
}

.lightbox-controls .btn {
	background: rgba(0,0,0,0.7);
	border: none;
	color: white;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lightbox-controls .btn:hover {
	background: rgba(0,0,0,0.9);
}

/* PDF viewer modal */
#mediaPdfModal .modal-xl {
	max-width: 90%;
}

.pdf-viewer-container {
	height: 80vh;
	display: flex;
	flex-direction: column;
}

.pdf-controls {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.pdf-canvas-container {
	flex: 1;
	overflow: auto;
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	background: #f8f9fa;
	padding: 20px;
}

#pdf-canvas {
	display: block;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 768px) {
	.media-viewer-container {
		margin: 1rem 0;
	}
	
	.media-section {
		margin-bottom: 2rem;
	}
	
	.media-section-title {
		font-size: 1.1rem;
		margin-bottom: 1rem;
	}
	
	.image-card .media-preview {
		height: 150px;
	}
	
	.media-card {
		box-shadow: 0 1px 6px rgba(0,0,0,0.1);
	}
	
	.media-card:hover {
		transform: none;
		box-shadow: 0 2px 12px rgba(0,0,0,0.15);
	}
	
	.lightbox-controls {
		opacity: 1;
		pointer-events: auto;
	}
	
	.pdf-controls {
		padding: 0.75rem !important;
		gap: 0.5rem;
	}
	
	.pdf-controls .btn-group {
		margin-left: 0 !important;
		margin-top: 0.5rem;
	}
}

@media (max-width: 576px) {
	.skeleton-cards {
		grid-template-columns: 1fr;
	}
	
	.media-section .swiper-button-next,
	.media-section .swiper-button-prev {
		display: none;
	}
}