/* Gallery Styles */

/* Admin link styling */
.admin-link {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
  font-size: 0.9em !important;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Gallery Controls */
.gallery-controls {
  background: #DEE2E5;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.5rem 0;
}

.controls-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  background: white;
  color: #6b7280;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.view-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.view-btn.active {
  background: #3A84C5;
  color: white;
  border-color: #3A84C5;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-controls select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  color: #374151;
  font-size: 0.875rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  width: 200px;
  font-size: 0.875rem;
}

.search-box svg {
  position: absolute;
  right: 0.75rem;
  color: #6b7280;
  pointer-events: none;
}

/* Loading and Empty States */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.loading-spinner svg {
  animation: spin 1s linear infinite;
  color: #1e3a8a;
  margin-bottom: 1rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state svg {
  color: #9ca3af;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.empty-state p {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Slideshow Styles */
.slideshow-container {
  position: relative;
  background: #DEE2E5;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.slideshow-main {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.slide-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide-content {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.slide-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.slide-media img:hover {
  transform: scale(1.02);
}

.slide-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.youtube-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16/9;
}

.youtube-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Navigation Arrows */
.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(222, 226, 229, 0.95);
  color: white;
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.slide-nav:hover {
  background: rgba(222, 226, 229, 1);
  transform: translateY(-50%) scale(1.1);
}

.slide-nav.prev {
  left: 1rem;
}

.slide-nav.next {
  right: 1rem;
}

/* Fullscreen Button */
.fullscreen-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(222, 226, 229, 0.95);
  color: white;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.fullscreen-btn:hover {
  background: rgba(222, 226, 229, 1);
}

/* Slide Info */
.slide-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(222,226,229,0.95));
  color: white;
  padding: 2rem 1.5rem 1.5rem;
  z-index: 10;
}

.slide-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.slide-info p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.slide-counter {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Thumbnail Navigation */
.thumbnail-nav {
  background: #DEE2E5;
  padding: 1rem;
}

.thumbnail-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scroll-behavior: smooth;
}

.thumbnail-container::-webkit-scrollbar {
  height: 4px;
}

.thumbnail-container::-webkit-scrollbar-track {
  background: #cbd5e0;
}

.thumbnail-container::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 2px;
}

.thumbnail {
  flex: 0 0 auto;
  width: 80px;
  height: 60px;
  position: relative;
  border-radius: 0.375rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.thumbnail:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.thumbnail.active {
  border-color: #3b82f6;
  transform: scale(1.1);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-overlay {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-overlay svg {
  width: 12px;
  height: 12px;
}

/* Slide Dots */
.slide-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #DEE2E5;
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.2);
}

.dot.active {
  background: #3A84C5;
  transform: scale(1.3);
}

/* Autoplay Controls */
.autoplay-controls {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
}

.play-pause-btn {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-pause-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

/* Grid View */
.grid-container {
  margin-top: 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.grid-item {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.grid-item-media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.grid-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.grid-item:hover .grid-item-media img {
  transform: scale(1.05);
}

.grid-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.grid-item:hover .grid-item-overlay {
  opacity: 1;
}

.grid-item-type {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.grid-item-actions {
  display: flex;
  gap: 0.5rem;
}

.grid-action-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.grid-action-btn:hover {
  background: white;
  transform: scale(1.1);
}

.grid-item-info {
  padding: 1rem;
}

.grid-item-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.grid-item-info p {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(222, 226, 229, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  color: white;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-media {
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-info {
  color: white;
  text-align: center;
  margin-top: 1rem;
  max-width: 600px;
}

.lightbox-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.lightbox-info p {
  font-size: 0.875rem;
  opacity: 0.9;
  line-height: 1.5;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 2rem;
}

.lightbox-prev, .lightbox-next {
  background: rgba(222, 226, 229, 0.95);
  color: white;
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(222, 226, 229, 1);
  transform: scale(1.1);
}

/* Lazy Loading */
.lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy.loaded {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .controls-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .filter-controls {
    width: 100%;
    justify-content: space-between;
  }

  .search-box input {
    width: 150px;
  }

  .slideshow-main {
    aspect-ratio: 4/3;
  }

  .slide-nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .slide-nav.prev {
    left: 0.5rem;
  }

  .slide-nav.next {
    right: 0.5rem;
  }

  .slide-info {
    padding: 1.5rem 1rem 1rem;
  }

  .slide-info h3 {
    font-size: 1.125rem;
  }

  .thumbnail {
    width: 60px;
    height: 45px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox-nav {
    padding: 0 1rem;
  }

  .lightbox-prev, .lightbox-next {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 480px) {
  .view-toggle {
    width: 100%;
  }

  .view-btn {
    flex: 1;
    justify-content: center;
  }

  .filter-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .search-box input {
    width: 100%;
  }

  .slideshow-main {
    aspect-ratio: 1/1;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lightbox-close {
    top: -2.5rem;
  }
}

/* Fullscreen styles */
.slideshow-container:fullscreen {
  border-radius: 0;
}

.slideshow-container:fullscreen .slideshow-main {
  aspect-ratio: auto;
  height: 100vh;
}

/* Print styles */
@media print {
  .gallery-controls,
  .slide-nav,
  .fullscreen-btn,
  .autoplay-controls,
  .thumbnail-nav,
  .slide-dots {
    display: none !important;
  }
}
