/* ==========================================================================
   CM PUNK — Free 4K Picture Enhancer & Collage Maker Design System
   Professional Dark Theme • #FFD400 Signature Yellow • Responsive Mobile/Desktop
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #080A0E;
  --bg-surface: #0E1219;
  --bg-card: #141923;
  --bg-card-hover: #1A212E;
  --bg-input: #101520;
  
  --border-subtle: #1F2737;
  --border-medium: #2C374D;
  --border-bright: #3E4D6C;

  /* Signature Yellow */
  --yellow-primary: #FFD400;
  --yellow-hover: #FFE033;
  --yellow-active: #E6BE00;
  --yellow-glow: rgba(255, 212, 0, 0.22);
  --yellow-glow-subtle: rgba(255, 212, 0, 0.08);

  /* Functional Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dark: #090B0E;

  --status-ready: #38BDF8;
  --status-ready-bg: rgba(56, 189, 248, 0.12);
  --status-processing: #FBBF24;
  --status-processing-bg: rgba(251, 191, 36, 0.12);
  --status-success: #10B981;
  --status-success-bg: rgba(16, 185, 129, 0.12);
  --status-error: #F43F5E;
  --status-error-bg: rgba(244, 63, 94, 0.12);

  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Sizing & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.65);
  --shadow-yellow: 0 0 24px rgba(255, 212, 0, 0.35);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base Container */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Typography Helpers */
h1, h2, h3, h4, .brand-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

/* ==========================================================================
   Header Navigation & Mode Switcher
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 10, 14, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo-badge {
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-weight: 900;
  font-size: 1.15rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  box-shadow: 0 0 12px var(--yellow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--yellow-primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* App Mode Navigation Switcher */
.mode-nav-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  gap: 0.25rem;
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  user-select: none;
}

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

.mode-tab-btn.active {
  background: var(--yellow-primary);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(255, 212, 0, 0.25);
}

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

.btn-header-ghost {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-header-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--yellow-primary);
}

.status-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--status-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--status-success);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 2.5rem 0 1.75rem 0;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--yellow-primary);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.hero-pill-badge {
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  font-weight: 800;
}

.hero-title-gradient {
  background: linear-gradient(135deg, #FFFFFF 30%, var(--yellow-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  max-width: 640px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.6;
}

.hero-specs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.spec-dot {
  color: var(--yellow-primary);
}

/* ==========================================================================
   Upload Zone
   ========================================================================== */
.upload-wrapper {
  margin: 1.5rem 0 2.5rem 0;
}

.dropzone {
  background: var(--bg-surface);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.dropzone:hover, .dropzone.drag-active {
  border-color: var(--yellow-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-yellow), var(--shadow-lg);
  transform: translateY(-2px);
}

.dropzone.drag-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--yellow-glow-subtle);
  pointer-events: none;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.dropzone-icon-box {
  width: 68px;
  height: 68px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.dropzone:hover .dropzone-icon-box {
  transform: scale(1.08);
  border-color: var(--yellow-primary);
  background: var(--yellow-glow-subtle);
}

.dropzone-primary-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.dropzone-secondary-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.dropzone-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 212, 0, 0.3);
  transition: all var(--transition-fast);
}

.dropzone-cta-btn:hover {
  background: var(--yellow-hover);
  transform: scale(1.03);
}

.dropzone-badges {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-tag {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.badge-tag.highlight {
  color: var(--yellow-primary);
  border-color: rgba(255, 212, 0, 0.2);
}

/* ==========================================================================
   Queue Section (Enhancer Mode)
   ========================================================================== */
.queue-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-counter {
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Image Card */
.image-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  animation: cardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.image-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.image-card.card-enhanced {
  border-color: rgba(255, 212, 0, 0.35);
  box-shadow: 0 0 16px rgba(255, 212, 0, 0.08);
}

.card-top-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-thumb-box {
  width: 84px;
  height: 84px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.card-thumb-box.enhanced-thumb {
  border: 2px solid var(--yellow-primary);
}

.card-meta-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.card-dim-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.card-size-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  align-self: flex-start;
}

.card-remove-btn:hover {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.card-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-status.ready {
  background: var(--status-ready-bg);
  color: var(--status-ready);
}

.badge-status.processing {
  background: var(--status-processing-bg);
  color: var(--status-processing);
}

.badge-status.enhanced {
  background: var(--yellow-primary);
  color: var(--text-dark);
}

.badge-status.failed {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.card-actions-row {
  display: flex;
  gap: 0.5rem;
}

.btn-card-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-card-action:hover {
  border-color: var(--yellow-primary);
  color: var(--yellow-primary);
}

.btn-card-action.primary-download {
  background: var(--yellow-primary);
  color: var(--text-dark);
  border-color: var(--yellow-primary);
  font-weight: 700;
}

.btn-card-action.primary-download:hover {
  background: var(--yellow-hover);
}

/* ==========================================================================
   Enhancement Control Panel
   ========================================================================== */
.control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.control-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.setting-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.setting-value-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-value-pill .accent-dot {
  color: var(--yellow-primary);
}

.primary-action-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.btn-enhance-main {
  width: 100%;
  max-width: 440px;
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 1.1rem 2rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-yellow), var(--shadow-md);
  transition: all var(--transition-normal);
  user-select: none;
}

.btn-enhance-main:hover:not(:disabled) {
  background: var(--yellow-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(255, 212, 0, 0.45);
}

.btn-enhance-main:active:not(:disabled) {
  transform: translateY(0);
}

.btn-enhance-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Progress UI */
.progress-container {
  width: 100%;
  max-width: 500px;
  margin: 0.5rem auto 0 auto;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--yellow-primary);
  box-shadow: 0 0 10px var(--yellow-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-step-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.45rem;
}

/* ==========================================================================
   Completed Results Section
   ========================================================================== */
.results-section {
  margin: 3rem 0;
}

.results-banner {
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.12) 0%, rgba(14, 18, 25, 0.95) 100%);
  border: 1px solid rgba(255, 212, 0, 0.3);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.results-banner-text h2 {
  font-size: 1.6rem;
  color: var(--yellow-primary);
  margin-bottom: 0.3rem;
}

.results-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-download-all {
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 800;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-yellow);
  transition: all var(--transition-fast);
}

.btn-download-all:hover {
  background: var(--yellow-hover);
  transform: scale(1.02);
}

.btn-reset-batch {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-reset-batch:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-primary);
}

/* Comparison Preview Card */
.comparison-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.preview-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.preview-label-tag {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-label-tag.enhanced {
  background: var(--yellow-primary);
  color: var(--text-dark);
  border-color: var(--yellow-primary);
}

.preview-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Interactive Split Comparison Slider */
.slider-compare-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
}

.slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.slider-img.img-original {
  z-index: 1;
}

.slider-img-wrapper-enhanced {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.slider-img-wrapper-enhanced .slider-img {
  width: 100%;
  height: 100%;
}

.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--yellow-primary);
  z-index: 10;
  cursor: ew-resize;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255, 212, 0, 0.6);
}

.slider-handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  background: var(--yellow-primary);
  color: var(--text-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Collage Studio Studio Section
   ========================================================================== */
.collage-studio-section {
  margin: 1.5rem 0 3rem 0;
}

.collage-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

/* Live Collage Canvas Container */
.collage-preview-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.collage-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.collage-viewport-frame {
  width: 100%;
  background: #000000;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 380px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.collage-viewport-frame img {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

/* Collage Controls Sidebar */
.collage-controls-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Aspect Ratio Selector Pills */
.aspect-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.aspect-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.aspect-btn:hover {
  border-color: var(--yellow-primary);
  color: var(--text-primary);
}

.aspect-btn.active {
  background: var(--yellow-primary);
  color: var(--text-dark);
  border-color: var(--yellow-primary);
  font-weight: 800;
}

/* Layout Template Buttons Grid */
.layout-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.layout-pick-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.layout-pick-btn:hover {
  border-color: var(--yellow-primary);
}

.layout-pick-btn.active {
  border-color: var(--yellow-primary);
  background: var(--yellow-glow-subtle);
  color: var(--yellow-primary);
  font-weight: 700;
}

.layout-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Sliders */
.range-slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-slider-input {
  flex: 1;
  accent-color: var(--yellow-primary);
  height: 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.range-val-badge {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--yellow-primary);
  min-width: 32px;
  text-align: right;
}

/* Image Slot Thumbnails in Sidebar */
.collage-thumbs-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.collage-slot-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.collage-slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-download-collage {
  width: 100%;
  background: var(--yellow-primary);
  color: var(--text-dark);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-yellow);
  transition: all var(--transition-fast);
}

.btn-download-collage:hover {
  background: var(--yellow-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   Privacy & Info Section
   ========================================================================== */
.privacy-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2rem 0;
}

.privacy-icon-box {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow-primary);
  flex-shrink: 0;
}

.privacy-text h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

.privacy-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal Dialog (About & Deploy Guide)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--yellow-primary);
}

.modal-title {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-body h3 {
  color: var(--yellow-primary);
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem 0;
}

.modal-body ol, .modal-body ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.4rem;
}

.code-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--yellow-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-left: 4px solid var(--yellow-primary);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease forwards;
}

.toast.error {
  border-left-color: var(--status-error);
}

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

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

.footer a {
  color: var(--yellow-primary);
  text-decoration: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 860px) {
  .collage-workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .mode-nav-tabs {
    align-self: center;
  }

  .dropzone {
    padding: 2.25rem 1rem;
  }
  
  .queue-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .results-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-banner-actions {
    width: 100%;
  }

  .btn-download-all, .btn-reset-batch {
    width: 100%;
    justify-content: center;
  }

  .btn-enhance-main {
    font-size: 1.05rem;
    padding: 0.95rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.85rem;
  }

  .card-top-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .card-meta-col {
    align-items: center;
  }

  .card-remove-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
  }

  .aspect-selector-grid, .layout-picker-grid {
    grid-template-columns: 1fr;
  }
}
