/* ===========================================================================
   Omni Video Studio - Main Styles
   Built on the siriusly.ai design system (see css/design-system.css, which the
   templates link ahead of this file and which carries every token used here).
   =========================================================================== */

/* Base Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--text-strong);
  background-color: var(--surface-page);
}

/* Animations */
@keyframes omni-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes omni-halo {
  0% {
    transform: scale(0.7);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.7);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes omni-dot {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(208, 126, 69, 0.38);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}

@keyframes omni-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(220%);
  }
}

@keyframes omni-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Container & Layout */
.app-container {
  min-height: 100vh;
  padding: 32px 28px 64px;
}

.app-inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gradient-signature);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.brand-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand-title {
  font-family: var(--font-body);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-strong);
}

.brand-title-accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--text-body);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: omni-dot 2.4s var(--ease-out) infinite;
}

.status-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-body);
}

/* Grid Layout */
.studio-grid {
  display: grid;
  grid-template-columns: 476px 1fr;
  gap: 26px;
  align-items: start;
}

/* Card Base */
.studio-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Config Panel */
.config-section {
  padding: 22px 24px 6px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.config-content {
  padding: 14px 24px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.field-label-required {
  color: var(--status-danger);
}

/* Upload Areas */
.upload-area {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-card);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.upload-area:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-icon-image {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.upload-icon-video {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.upload-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* File Preview */
.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  background: var(--surface-hover);
}

.file-thumbnail {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0F0F10;
}

.file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

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

.file-status-video {
  color: var(--color-accent);
}

.file-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s var(--ease-out);
}

.file-remove-btn:hover {
  background: var(--status-danger);
  color: white;
  border-color: var(--status-danger);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-default);
  margin: 18px 0 0;
}

/* Settings Controls */
.settings-content {
  padding: 12px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.setting-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

/* Button Group */
.button-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-hover);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.button-group-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}

.button-group-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-group-item.active {
  font-weight: 600;
  border-color: var(--border-default);
  background: var(--surface-card);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}

.button-group-item:not(:disabled):hover {
  color: var(--text-strong);
}

/* Seed Input */
.seed-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.seed-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-strong);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s var(--ease-out);
}

.seed-input:focus {
  border-color: var(--color-primary);
}

/* Auto-growing textarea (speech + prompt inputs) */
.prompt-textarea {
  flex: none; /* .seed-input's flex:1 collapses height inside the column .form-field */
  font-family: var(--font-body);
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  max-height: 65vh;
  overflow-y: auto;
}

.seed-random-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}

.seed-random-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

/* Language Select */
.language-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.language-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-strong);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 10px 40px 10px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.language-select:hover {
  border-color: var(--text-body);
}

.language-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46, 122, 40, 0.1);
}

.language-select-icon {
  position: absolute;
  right: 14px;
  pointer-events: none;
  color: var(--text-muted);
  transition: color 0.15s var(--ease-out);
}

.language-select-wrapper:hover .language-select-icon {
  color: var(--text-body);
}

/* Helper Text */
.helper-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Generate Button Section */
.generate-section {
  padding: 18px 24px 24px;
  margin-top: 6px;
  border-top: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-generate {
  width: 100%;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--color-primary);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s var(--ease-out);
  position: relative;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 24, 22, 0.3);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-out);
}

.btn-generate:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

/* Output Panel */
.output-panel {
  position: sticky;
  top: 32px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.output-header {
  padding: 22px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Output States */
.output-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 40px;
  gap: 18px;
}

.output-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  border: 1.5px solid var(--border-default);
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.output-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 300px;
}

.output-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.output-description {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Generating State */
.generating-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  gap: 26px;
}

.progress-spinner {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(208, 126, 69, 0.38);
  animation: omni-halo 2.6s var(--ease-out) infinite;
}

.progress-halo:nth-child(2) {
  animation-delay: 1.3s;
}

.progress-ring {
  position: absolute;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--color-primary), rgba(46, 122, 40, 0) 72%);
  -webkit-mask: radial-gradient(farthest-side, transparent 60%, #000 62%);
  mask: radial-gradient(farthest-side, transparent 60%, #000 62%);
  animation: omni-spin 1.1s linear infinite;
}

.progress-label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.progress-percent {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 500;
  color: var(--text-strong);
}

.progress-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: 4px;
}

.progress-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.progress-stage {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  animation: omni-rise 0.35s var(--ease-out);
}

.progress-bar-container {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-hover);
  overflow: hidden;
}

.progress-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.25s var(--ease-out);
}

.progress-bar-shimmer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: omni-shimmer 1.6s linear infinite;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Result State */
.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 26px 24px;
  gap: 16px;
}

.result-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 14px;
  min-height: 300px;
}

.result-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0F0F10;
  border-radius: 12px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-body);
  background: var(--surface-hover);
  border: 1px solid var(--border-default);
  padding: 5px 10px;
  border-radius: 999px;
}

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

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

.btn-download {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--color-primary);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s var(--ease-out);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 24, 22, 0.3);
}

.btn-regenerate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-card);
  color: var(--text-strong);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 13px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}

.btn-regenerate:hover {
  background: var(--surface-hover);
}

.btn-new-video {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: var(--surface-hover);
  border: 1.5px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}

.btn-new-video:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-new-video svg {
  flex-shrink: 0;
}

/* Three-dotted spinner for loading states */
.btn-loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.btn-loading-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
  animation: dotPulse 1.4s infinite ease-in-out;
}

.btn-loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.btn-loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

  .output-panel {
    position: relative;
    top: 0;
  }
}
