:root {
  --bg-color: #0b0d13;
  --bg-secondary: #141721;
  --bg-card: rgba(22, 27, 38, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-active: #ffffff;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --glass-bg: rgba(18, 22, 33, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* Background Subtle Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, rgba(35, 45, 65, 0.4), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.gallery-app {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 32px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slide-counter {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: var(--bg-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Slider Layout */
.slider-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.slider-container {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 480px;
  max-height: 720px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

.slider-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: scale(0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-in;
}

.slide-item.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 2;
}

.slide-image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.slide-item:hover .slide-image-wrapper {
  transform: scale(1.015);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

.slide-image {
  max-width: 100%;
  max-height: calc(60vh - 48px);
  object-fit: contain;
  display: block;
  border-radius: 10px;
  background-color: #0f1117;
}

/* Hover overlay badge */
.zoom-hint-badge {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 18, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all var(--transition-fast);
  pointer-events: none;
}

.slide-item:hover .zoom-hint-badge {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Nav Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* Autoplay Progress Bar */
.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 15;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.1s linear;
}

/* Indicators & Thumbnails */
.slider-navigation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.dots-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.dot.active {
  width: 24px;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* Thumbnail Strip */
.thumbnail-strip-container {
  width: 100%;
  max-width: 720px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.thumbnail-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.thumb-item {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: all var(--transition-fast);
  background-color: #12151e;
}

.thumb-item:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.thumb-item.active {
  opacity: 1;
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  transform: translateY(-3px) scale(1.05);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shortcut-hints {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  color: #fff;
}

/* ========================================= */
/* Interactive Zoom & Pan Modal Viewer       */
/* ========================================= */
.zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.zoom-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 10, 15, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1;
}

/* Modal Toolbar */
.modal-toolbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: rgba(14, 17, 26, 0.65);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.zoom-level-badge {
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  min-width: 48px;
  text-align: center;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.control-btn.close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.control-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

/* Modal Viewport (Zoom & Pan Area) */
.zoom-viewport {
  position: relative;
  z-index: 5;
  flex: 1;
  width: 100%;
  height: calc(100vh - 120px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.zoom-viewport.dragging {
  cursor: grabbing;
}

.zoom-image-wrapper {
  position: absolute;
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  user-select: none;
  pointer-events: none;
}

/* Modal Footer Helper */
.modal-footer-tip {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 12px;
  background: rgba(14, 17, 26, 0.4);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .gallery-app {
    padding: 16px;
  }

  .title {
    font-size: 16px;
  }

  .slider-container {
    height: 50vh;
    min-height: 380px;
  }

  .nav-btn {
    width: 42px;
    height: 42px;
  }

  .prev-btn { left: 10px; }
  .next-btn { right: 10px; }

  .thumb-item {
    width: 52px;
    height: 52px;
  }

  .shortcut-hints {
    display: none;
  }

  .modal-toolbar {
    padding: 12px 16px;
  }

  .modal-footer-tip {
    font-size: 11px;
    gap: 12px;
    flex-wrap: wrap;
  }
}
