/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */
:root {
  --bg-primary: #0a0b0e;
  --bg-secondary: #13151b;
  --bg-card: rgba(25, 28, 36, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.25);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(10, 11, 14, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
  color: #fff;
  border-radius: var(--radius-sm);
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 15px var(--accent-glow);
}

.icon {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
}

/* Sections visibility toggle */
.slider-section, .grid-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.slider-section.active, .grid-section.active {
  display: block;
}

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

/* ==========================================================================
   Slider Section
   ========================================================================== */
.slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Stage */
.slider-stage {
  position: relative;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 420px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  cursor: grab;
  user-select: none;
}

.slider-stage:active {
  cursor: grabbing;
}

.slides-container {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform var(--transition-normal);
  will-change: transform;
}

.slide-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060709;
}

.slide-item img, 
.slide-item video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: auto;
  transition: transform var(--transition-fast);
}

.slide-item:hover img {
  transform: scale(1.008);
}

/* Nav Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 17, 23, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

.prev-btn { left: 1.5rem; }
.next-btn { right: 1.5rem; }

.nav-btn:hover {
  background: rgba(99, 102, 241, 0.85);
  border-color: var(--accent-color);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Zoom Hint */
.zoom-hint {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  background: rgba(15, 17, 23, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
  opacity: 0.85;
}

/* Slider Meta (Counter & Progress Bar) */
.slider-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0.25rem;
}

.counter-display {
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  color: var(--text-primary);
}

.current-idx {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
}

.divider {
  color: var(--text-muted);
}

.total-idx {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.progress-bar-container {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), #a855f7);
  border-radius: 999px;
  transition: width var(--transition-normal);
}

.keyboard-guide {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.keyboard-guide kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Thumbnail Strip
   ========================================================================== */
.thumbnail-strip-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.thumbnail-strip-wrapper::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-strip-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.thumbnail-strip {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.thumb-item {
  flex: 0 0 100px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 2px solid transparent;
  cursor: pointer;
  background-color: var(--bg-secondary);
  transition: all var(--transition-fast);
  opacity: 0.5;
}

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

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

.thumb-item.active {
  opacity: 1;
  border-color: var(--accent-color);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-3px);
}

.thumb-item .thumb-video-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.65rem;
  color: #fff;
  line-height: 1;
}

/* ==========================================================================
   Grid Gallery Section
   ========================================================================== */
.grid-section {
  padding-top: 1rem;
}

.grid-header {
  margin-bottom: 2rem;
  text-align: center;
}

.grid-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.grid-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.grid-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card img,
.grid-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.grid-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.grid-card:hover img,
.grid-card:hover video {
  transform: scale(1.05);
}

.grid-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.grid-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-content {
  position: relative;
  z-index: 10;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.96);
  transition: transform var(--transition-normal);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-media-wrapper {
  max-width: 90vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media-wrapper img,
.lightbox-media-wrapper video {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.lightbox-caption {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-close svg {
  width: 20px;
  height: 20px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ==========================================================================
   Responsive Queries
   ========================================================================== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
  }
  
  .slider-stage {
    height: 55vh;
    min-height: 320px;
  }

  .nav-btn {
    width: 42px;
    height: 42px;
  }
  .prev-btn { left: 0.75rem; }
  .next-btn { right: 0.75rem; }

  .thumb-item {
    flex: 0 0 76px;
    height: 56px;
  }

  .keyboard-guide {
    display: none;
  }

  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}
