:root {
  --bg-main: #0c0e14;
  --bg-surface: #141822;
  --bg-surface-hover: #1c2230;
  --bg-elevated: #1e2434;
  --border-subtle: #252c3d;
  --border-active: #f59e0b;
  --border-selected: #10b981;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --gold-primary: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  --shadow-selected: 0 0 0 2px var(--gold-primary), 0 12px 30px -4px var(--gold-glow);
  --shadow-complete: 0 0 0 2px var(--emerald-primary), 0 12px 30px -4px var(--emerald-glow);
  
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 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-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px;
}

/* Header & Sticky Controls */
.header {
  background: linear-gradient(180deg, #131722 0%, #0e111a 100%);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 50;
}

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

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge-chuseok {
  display: inline-flex;
  align-items: center;
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  width: fit-content;
}

.title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.subtitle strong {
  color: var(--gold-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
}

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

.btn-primary {
  background: #f59e0b;
  color: #0b0d13;
}
.btn-primary:hover {
  background: #fbbf24;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: #3b4458;
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}
.btn-accent:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Sticky Progress & Tab Bar */
.sticky-bar {
  position: sticky;
  top: 0;
  background: rgba(15, 18, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 40;
}

.sticky-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.counter-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  min-width: 280px;
}

.counter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

.dot-indicator.complete {
  background: var(--emerald-primary);
  box-shadow: 0 0 10px var(--emerald-primary);
}

.counter-badge {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.counter-badge span {
  color: var(--gold-primary);
  font-size: 18px;
}

.counter-box.complete .counter-badge span {
  color: var(--emerald-primary);
}

.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 80px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.counter-box.complete .progress-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-count {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
}

.tab-count.highlight {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-primary);
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 28px auto;
  padding: 0 20px;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card Styling */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #3b4458;
  box-shadow: 0 16px 32px -6px rgba(0, 0, 0, 0.6);
}

.card.selected {
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-selected);
  background: linear-gradient(180deg, #181d2a 0%, #131722 100%);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.card-badge {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-num-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--gold-primary);
  font-weight: 700;
}

.card-order-tag {
  display: none;
  background: var(--gold-primary);
  color: #0b0d13;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.card.selected .card-order-tag {
  display: inline-block;
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #090a0f;
  cursor: pointer;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.card:hover .card-img {
  transform: scale(1.03);
}

/* Card Image Overlay Actions */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.card-img-wrap:hover .card-overlay {
  opacity: 1;
}

.overlay-btn {
  background: rgba(20, 24, 34, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.overlay-btn:hover {
  background: var(--gold-primary);
  color: #0b0d13;
  transform: scale(1.1);
}

.card-footer {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.card-select-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transition: var(--transition);
}

.card-select-btn:hover {
  background: #273043;
  border-color: #4a5568;
}

.card.selected .card-select-btn {
  background: var(--gold-primary);
  color: #0b0d13;
  border-color: var(--gold-primary);
}

.card.selected .card-select-btn:hover {
  background: #fbbf24;
}

/* Empty State */
.empty-view {
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  max-width: 600px;
  margin: 40px auto;
}

.empty-view.hidden {
  display: none;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-view h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-view p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.lightbox-backdrop.hidden {
  display: none;
  opacity: 0;
}

.lightbox-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.lightbox-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-right: 60px;
}

.lightbox-badge {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-primary);
  margin-right: 10px;
}

.lightbox-filename {
  font-size: 13px;
  color: var(--text-muted);
}

.lightbox-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: 10px;
  background: #08090d;
}

.lightbox-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 68vh;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.nav-arrow {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 5;
}

.nav-arrow:hover {
  background: var(--gold-primary);
  color: #0b0d13;
}

.lightbox-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

/* Mobile Bar */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 22, 32, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  z-index: 45;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-count {
  font-weight: 800;
  font-size: 15px;
  color: var(--gold-primary);
  display: block;
}

.mobile-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.mobile-bar-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 768px) {
  .mobile-bar {
    display: flex;
  }
  .header-actions {
    display: none;
  }
  .title {
    font-size: 20px;
  }
  .counter-box {
    min-width: 100%;
  }
  .sticky-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-tabs {
    width: 100%;
  }
  .tab-btn {
    flex: 1;
    justify-content: center;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: rgba(22, 27, 38, 0.96);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
  border-left: 4px solid var(--emerald-primary);
}

.toast.warning {
  border-left: 4px solid var(--gold-primary);
}

.toast.error {
  border-left: 4px solid #ef4444;
}

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