:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.4);
  
  --primary: #00f2fe;
  --primary-glow: #4facfe;
  --accent-pink: #ff007f;
  --accent-purple: #a855f7;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  --shadow-glow: 0 10px 30px -10px rgba(0, 242, 254, 0.3);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Orbs */
.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #00f2fe, #4facfe);
  top: -150px;
  left: -100px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #a855f7, #6366f1);
  bottom: -200px;
  right: -100px;
  animation-duration: 25s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ff007f, #ec4899);
  top: 40%;
  left: 45%;
  opacity: 0.15;
  animation-duration: 18s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* App Container */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #090d16;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.pulse-ring {
  position: absolute;
  inset: -4px;
  border: 2px solid #00f2fe;
  border-radius: calc(var(--radius-md) + 4px);
  opacity: 0.4;
  animation: pulse 2.5s infinite ease-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 0; }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff007f, #a855f7);
  -webkit-text-fill-color: #ffffff;
  box-shadow: 0 2px 10px rgba(255, 0, 127, 0.4);
  vertical-align: middle;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.header-badges {
  display: flex;
  gap: 0.75rem;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  backdrop-filter: blur(10px);
}

.tech-badge i {
  color: var(--primary);
}

/* Studio Grid Layout */
.studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 1.75rem;
  align-items: start;
}

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

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  padding: 1.75rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  transition: border-color var(--transition-smooth);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-card);
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
}

.panel-header h2 i {
  color: var(--primary);
  font-size: 1.1rem;
}

.step-count, .status-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

/* Form Groups & Inputs */
.form-flow {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

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

.label-with-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
}

.group-label span i {
  color: var(--primary);
  margin-right: 0.4rem;
}

.label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.mode-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  font-weight: 600;
}

/* Dropzones */
.dropzone {
  position: relative;
  background: rgba(10, 15, 26, 0.6);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.dropzone:hover {
  border-color: var(--primary);
  background: rgba(0, 242, 254, 0.03);
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.1);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.drop-icon {
  font-size: 1.8rem;
  color: var(--primary);
  opacity: 0.8;
  transition: transform var(--transition-fast);
}

.dropzone:hover .drop-icon {
  transform: translateY(-3px);
  opacity: 1;
}

.drop-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drop-text strong {
  color: var(--text-main);
}

.drop-text span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Audio Preview Card */
.file-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-align: left;
  position: relative;
  z-index: 10;
}

.file-info-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Image Gallery Preview Grid */
.image-gallery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.6rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.25rem;
  position: relative;
  z-index: 10;
}

.thumb-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-card);
  background: #000;
}

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

.thumb-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.thumb-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.thumb-wrapper:hover .thumb-delete {
  opacity: 1;
}

.thumb-delete:hover {
  background: #ef4444;
}

/* Aspect Ratio Selector */
.ratio-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

@media (max-width: 600px) {
  .ratio-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ratio-card {
  position: relative;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ratio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.ratio-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 242, 254, 0.3);
}

.ratio-card.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.ratio-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.ratio-16-9 { width: 36px; height: 20px; }
.ratio-9-16 { width: 20px; height: 36px; }
.ratio-1-1 { width: 26px; height: 26px; }
.ratio-16-9-hd { width: 36px; height: 20px; }

.ratio-card.active .ratio-box {
  background: rgba(0, 242, 254, 0.3);
  border-color: var(--primary);
}

.ratio-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.ratio-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

/* Accordion */
.accordion-section {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: rgba(10, 15, 26, 0.4);
  overflow: hidden;
}

.accordion-header {
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.accordion-header span i {
  color: var(--accent-purple);
  margin-right: 0.4rem;
}

.toggle-arrow {
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: transform var(--transition-smooth);
}

.accordion-section.open .toggle-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 1.1rem;
  display: none;
  flex-direction: column;
  gap: 1.1rem;
  border-top: 1px solid var(--border-card);
}

.accordion-section.open .accordion-body {
  display: flex;
}

.sub-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sub-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}

.segment-opt {
  flex: 1;
  position: relative;
}

.segment-opt input {
  position: absolute;
  opacity: 0;
}

.segment-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segment-opt input:checked + span {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

/* Switches Grid */
.switches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .switches-grid {
    grid-template-columns: 1fr;
  }
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toggle-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
}

.toggle-title i {
  color: var(--primary);
  margin-right: 0.3rem;
}

.toggle-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.switch-input {
  display: none;
}

.switch-slider {
  width: 38px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.switch-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-fast);
}

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

.switch-input:checked + .switch-slider::after {
  transform: translateX(16px);
  background: #090d16;
}

/* Color Presets */
.color-presets {
  display: flex;
  gap: 0.5rem;
}

.color-preset {
  cursor: pointer;
  position: relative;
}

.color-preset input {
  position: absolute;
  opacity: 0;
}

.swatch {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.color-preset input:checked + .swatch {
  transform: scale(1.2);
  border-color: #ffffff;
  box-shadow: 0 0 10px var(--c);
}

/* Inputs & Select */
.text-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.text-input, .custom-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: #ffffff;
  font-size: 0.85rem;
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--transition-fast);
}

.text-input:focus, .custom-select:focus {
  border-color: var(--primary);
}

.custom-select {
  cursor: pointer;
}

.custom-select option {
  background: #0f172a;
  color: #ffffff;
}

/* Primary Generate Button */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6366f1 100%);
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #090d16;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(0, 242, 254, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-arrow {
  transition: transform 0.2s;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Preview Panel States */
.preview-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  text-align: center;
}

.preview-state.hidden {
  display: none !important;
}

/* State 1: Idle */
.idle-graphic {
  margin-bottom: 1.25rem;
}

.pulse-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-dim);
}

#stateIdle h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

#stateIdle p {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 360px;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.features-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
  max-width: 420px;
  text-align: left;
}

.feature-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-item i {
  color: #10b981;
  font-size: 0.8rem;
}

/* State 2: Processing Card */
.render-progress-card {
  width: 100%;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.progress-title-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 242, 254, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-title-block h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

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

.percent-display {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}

.progress-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #4facfe, #a855f7);
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.25s ease;
  animation: shimmerBar 2s linear infinite;
}

@keyframes shimmerBar {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.render-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.active-status {
  color: var(--primary);
}

.processing-tips {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  text-align: left;
}

.processing-tips i {
  color: #f59e0b;
}

/* State 3: Completed & Player */
.video-player-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  margin-bottom: 1.25rem;
}

.rendered-video {
  width: 100%;
  max-height: 380px;
  display: block;
  object-fit: contain;
}

.output-success-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.success-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
}

.success-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.output-file-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-download {
  flex: 1;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all var(--transition-fast);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition-fast);
}

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

/* State 4: Error */
.error-graphic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-title {
  color: #ffffff;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  max-width: 400px;
  margin-bottom: 1.25rem;
}

/* Gallery Section */
.gallery-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-card);
}

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h2 i {
  color: var(--primary);
}

.section-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.btn-icon-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-icon-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

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

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-dim);
}

.gallery-empty i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

.video-card-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.video-card-body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.video-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.video-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.btn-card-action {
  flex: 1;
  padding: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-action:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-card-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

/* Helper hidden */
.hidden {
  display: none !important;
}
