/* ==============================================================================
   UpẢnh Siêu Tốc - Design System & Cloud Actions
   ============================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Dark Theme */
  --bg-app: #0A0E17;
  --bg-card: rgba(20, 26, 42, 0.78);
  --bg-card-solid: #141A2A;
  --bg-hover: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366F1;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  /* Neon Violet & Cyan & Gold Gradients */
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  --ai-gradient: linear-gradient(135deg, #EC4899 0%, #8B5CF6 50%, #06B6D4 100%);
  --cloud-gradient: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  --vip-gradient: linear-gradient(135deg, #F59E0B 0%, #D97706 50%, #B45309 100%);
  --accent-cyan: #06B6D4;
  --danger: #EF4444;
  --success: #10B981;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);
  --shadow-card: 0 12px 32px -5px rgba(0, 0, 0, 0.55), 0 0 1px 1px rgba(255, 255, 255, 0.06);
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html:not(.dark) {
  --bg-app: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-solid: #FFFFFF;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #4F46E5;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 0 1px 1px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-beta {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.4);
}

.badge-vip {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-solid);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.nav-tab-ai.active {
  background: var(--ai-gradient);
  box-shadow: 0 2px 14px rgba(236, 72, 153, 0.4);
}

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

.pill-count {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

/* Tab Panels Layout */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .panel-layout {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.form-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chip:hover, .chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* AI Banner & Controls */
.ai-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ai-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ai-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.ai-banner strong {
  color: #F472B6;
  display: block;
  font-size: 0.88rem;
}

.bg-style-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bg-style-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bg-style-btn:hover, .bg-style-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: var(--text-primary);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dot-trans {
  background: repeating-conic-gradient(#808080 0% 25%, #c0c0c0 0% 50%) 50% / 6px 6px;
}
.dot-white { background: #FFFFFF; }
.dot-black { background: #0F172A; }
.dot-grad { background: linear-gradient(135deg, #1E293B, #334155); }
.dot-spot-white { background: radial-gradient(circle, #FFFFFF 30%, #CBD5E1 100%); }
.dot-spot-black { background: radial-gradient(circle, #334155 30%, #020617 100%); }

/* PhotoRoom Studio Shadow Box */
.shadow-card-inner {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.shadow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Checker pattern background for transparency preview */
.checker-pattern {
  background: repeating-conic-gradient(#1a202c 0% 25%, #111827 0% 50%) 50% / 20px 20px !important;
}

/* Shape Selector */
.shape-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.shape-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.shape-btn:hover, .shape-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Dynamic Cropper Viewport Shapes */
.cropper-shape-circle .cropper-view-box,
.cropper-shape-circle .cropper-face {
  border-radius: 50% !important;
  outline: 2px solid rgba(99, 102, 241, 0.8) !important;
}

.cropper-shape-rounded .cropper-view-box,
.cropper-shape-rounded .cropper-face {
  border-radius: 28px !important;
  outline: 2px solid rgba(99, 102, 241, 0.8) !important;
}

/* Position Matrix */
.position-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 160px;
}

.pos-btn {
  height: 34px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pos-btn:hover, .pos-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Inputs & Form Controls */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 34px !important;
}

input[type="number"], input[type="text"], input[type="password"], select, .form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-fast);
}

input:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.range-slider {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Switches */
.switch-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch-container input { display: none; }

.switch-slider {
  width: 36px;
  height: 20px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  position: relative;
  transition: var(--transition-fast);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.switch-container input:checked + .switch-slider {
  background: var(--primary);
}

.switch-container input:checked + .switch-slider::before {
  transform: translateX(16px);
  background: white;
}

.switch-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-cloud-action {
  background: var(--cloud-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-cloud-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-vip-cloud {
  background: var(--vip-gradient);
  color: #FFFBEB;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  font-weight: 700;
}

.btn-vip-cloud:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

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

.btn-icon:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* Canvas Card & Dropzone */
.canvas-card {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dropzone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  margin: 16px;
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.03);
  text-align: center;
  transition: var(--transition-fast);
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.dropzone-icon i { width: 32px; height: 32px; }

kbd {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.cropper-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

.image-wrapper {
  flex: 1;
  min-height: 420px;
  max-height: 480px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper img { max-width: 100%; display: block; }

.cropper-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.btn-group { display: flex; align-items: center; gap: 4px; }

.btn-tool {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-tool:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  border-color: var(--primary);
}

/* Filter / Watermark / Collage Preview Canvas */
.filter-preview-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #000;
  margin: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.filter-preview-box canvas {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* Before & After Split Slider */
.before-after-box {
  position: relative;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.before-after-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-after-wrapper {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
}

.ba-after-wrapper img {
  width: 200%;
}

.ba-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 20;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10;
}

.ba-handle::after {
  content: '⟷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Batch Processing List */
.batch-preview-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.batch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 460px;
  overflow-y: auto;
}

.batch-item {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

/* Gallery Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: var(--bg-card-solid);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.storage-meter {
  padding: 12px 20px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-color);
}

.storage-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.item-thumb-wrapper {
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.item-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-dims { font-size: 0.8rem; font-weight: 700; }
.item-meta { font-size: 0.7rem; color: var(--text-muted); }

.item-actions {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-hover);
  flex-wrap: wrap;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}

/* Lightbox & Result Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close { position: absolute; top: -42px; right: 0; }

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-card-solid);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* 🌟 Result Modal Box */
.result-modal-box {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card-solid);
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(99, 102, 241, 0.2);
  gap: 14px;
}

.result-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.result-preview-box {
  width: 100%;
  max-height: 220px;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.result-preview-box img {
  max-height: 220px;
  max-width: 100%;
  object-fit: contain;
}

.result-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  width: 100%;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 182, 212, 0.3);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.share-link-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.copy-input-box {
  display: flex;
  gap: 6px;
}

.copy-input-box input {
  font-family: monospace;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.4);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10B981;
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  z-index: 999;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
