/* Modern Gallery & Admin - Responsive & Accessible */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* Shared Components */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* Gallery Styles */
.gallery-container {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.main-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.main-slider .media-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: scale(1);
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.main-slider.fade-out .media-wrapper {
  opacity: 0;
  transform: scale(1.05);
}

.media-wrapper {
  width: 100%;
  height: 100vh;
  position: relative;
}

.media-wrapper img,
.media-wrapper video {
    width:100%;
    height:100%;
    object-fit:cover;
}

/* CAPTION */
.caption {
    position:absolute;
    bottom:0;
    width:100%;
    padding:20px;
    color:#fff;
    font-size:16px;
    background:linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

/* THUMBNAIL */
.logo-overlay {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 200px;
  max-height: 110px;
  width: auto;
  height: auto;
  opacity: 0.95;
  z-index: 40;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.thumbnail-container {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 160px;
  max-height: 75vh;
  overflow-y: auto;
  background: transparent;
  padding: 8px 12px;
  z-index: 20;
}

.thumbnail-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  backdrop-filter: none;
  border-radius: 12px;
  z-index: -1;
}



/* Admin Link Header */
.header-overlay {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 30;
}

.thumbnail {
  margin-bottom: 10px;
  cursor: pointer;
  opacity: 0.85;
  transition: all 0.3s ease;
  border-radius: 10px;
  overflow: hidden;
}



.thumbnail.active,
.thumbnail:hover {
    opacity: 1;
}

.thumbnail img,
.thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Loading */

.slideshow-indicator {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-weight: 600;
  z-index: 25;
}

.progress-circle {
  position: relative;
  width: 60px;
  height: 60px;
}

.loading {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(25px);
  border-radius: 50px;
  padding: 12px 20px;
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.15);
}



.slideshow-indicator .spinner {
  border-top-color: #667eea;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-circle .red-spinner {
  position: absolute;
  top: 65%;
  right: 15%;
  border: 2px solid rgba(255,51,51,0.3);
  border-top: 2px solid #ef4444;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.slideshow-indicator .progress-circle {
  position: relative;
  width: 60px;
  height: 60px;
}

.progress-circle circle {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-width: 2px;
  fill: none;
}

.progress-circle .bg {
  stroke: none;
}

.progress-circle .progress {
  stroke: rgba(102,126,234,0.9);
  stroke-linecap: round;
  stroke-dasharray: 282;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 20s linear;
}

.progress-circle.paused .progress {
  transition: none;
}

.slideshow-indicator .countdown-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state h2 {
  font-size: 28px;
  margin-bottom: 12px;
  color: #374151;
}

/* Admin Styles */
.admin-header {
  background: white;
  padding: 24px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 32px;
}

.admin-title {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.upload-section {
  background: white;
  padding: 40px;
  border-radius: 20px;
  margin-bottom: 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.upload-form {
  display: grid;
  gap: 20px;
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group textarea {
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.admin-card {
  padding: 24px;
}

.admin-card img,
.admin-card video {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
}

.message {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
  .thumbnail-container {
    position: fixed !important;
    bottom: 90px !important;
    right: 16px !important;
    top: auto !important;
    left: auto !important;
    width: 52px !important;
    height: 52px !important;
    max-height: 35vh !important;
    max-width: 52px !important;
    padding: 6px 4px !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  }
  
  .thumbnail {
    width: 42px !important;
    height: 24px !important;
    margin-bottom: 4px !important;
    border-radius: 6px !important;
  }
  
  .media-wrapper {
    height: 100vh;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .upload-section {
    padding: 24px;
  }
  
  .caption {
    padding: 20px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .thumbnail-container {
    bottom: 80px !important;
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    padding: 5px 3px !important;
  }
  
  .thumbnail {
    width: 36px !important;
    height: 20px !important;
    margin-bottom: 3px !important;
    border-radius: 5px !important;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .admin-title {
    font-size: 24px;
  }
}

.admin-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 12px 20px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 50;
}

.admin-btn:hover {
  background: rgba(0,0,0,0.8);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

@media (max-width: 480px) {
  .admin-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }
}
