/* Bright & Premium Light Theme for SeeDance Studio */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f8fafc;
  --bg-accent-soft: #fdf2f8;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --primary: #ec4899;
  --primary-hover: #db2777;
  --primary-light: #fce7f3;
  --primary-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  --secondary: #8b5cf6;
  --accent-cyan: #06b6d4;

  --border-light: #e2e8f0;
  --border-focus: #ec4899;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 10px 25px -5px rgba(236, 72, 153, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.theme-bright {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-mark .sparkle {
  font-size: 22px;
}

.logo-text h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.version-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.logo-text .sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cost-summary-pill {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 14px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.pill-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pill-item .label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pill-item .val-highlight {
  font-size: 14px;
  font-weight: 800;
  color: #db2777;
}

.pill-item .val-highlight small {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: normal;
}

.pill-item .val-credits {
  font-size: 13px;
  font-weight: 700;
  color: #7c3aed;
}

.pill-divider {
  width: 1px;
  height: 14px;
  background: var(--border-light);
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: 999px;
}

.dot.online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Workspace */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 24px;
  padding: 24px 28px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 86px;
  height: fit-content;
}

/* Hero Random Card */
.random-hero-card {
  background: linear-gradient(135deg, #fff1f2 0%, #f5f3ff 100%);
  border: 1px solid #fbcfe8;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #db2777;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  border: 1px solid #fbcfe8;
}

.hero-text-wrap h3 {
  font-size: 17px;
  font-weight: 800;
  color: #881337;
  margin-bottom: 4px;
}

.hero-text-wrap p {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.4;
}

.btn-random-mega {
  flex-shrink: 0;
  background: var(--primary-gradient);
  border: none;
  color: #ffffff;
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-random-mega:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px -4px rgba(236, 72, 153, 0.4);
}

.btn-random-mega .dice-icon {
  font-size: 26px;
}

.btn-random-mega .btn-text-block {
  text-align: left;
}

.btn-random-mega .btn-text-block strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.btn-random-mega .btn-text-block small {
  font-size: 11px;
  color: #fce7f3;
  opacity: 0.95;
}

/* Panel Card */
.panel-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.panel-card.highlight-border {
  border: 1.5px solid #f472b6;
  background: #fffdfd;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-with-icon .icon {
  font-size: 18px;
}

.title-with-icon h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-mini {
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-accent {
  font-size: 12px;
  font-weight: 800;
  color: #db2777;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  padding: 3px 10px;
  border-radius: 6px;
}

.sub-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Models Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.model-card {
  background: #f8fafc;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.model-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.model-card.active {
  background: #ffffff;
  border-color: #ec4899;
  box-shadow: 0 4px 14px -2px rgba(236, 72, 153, 0.2);
}

.model-card.active::after {
  content: "✓ 선택됨";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #ec4899;
}

.card-top {
  margin-bottom: 6px;
}

.model-tag-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #db2777;
  background: #fdf2f8;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.model-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.model-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.card-bottom-costs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.krw-cost {
  font-size: 15px;
  font-weight: 800;
  color: #db2777;
}

.usd-cost {
  font-size: 11px;
  color: var(--text-muted);
}

.speed-tag {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Chip Groups */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.chip.active {
  background: #fdf2f8;
  border-color: #f472b6;
  color: #be185d;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Form Selects */
.select-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-box.full-width {
  grid-column: 1 / -1;
}

.field-box label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-select {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.form-select:focus {
  border-color: var(--primary);
  background: #ffffff;
}

/* Specs & Duration Grid */
.specs-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .specs-grid {
    grid-template-columns: 1fr;
  }
}

.specs-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.btn-group-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
}

.btn-toggle {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s;
}

.btn-toggle strong {
  font-size: 12px;
  color: var(--text-primary);
}

.btn-toggle small {
  font-size: 10.5px;
  color: var(--text-muted);
}

.btn-toggle .badge-price {
  font-size: 11px;
  font-weight: 800;
  color: #db2777;
  background: #fdf2f8;
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 2px;
}

.btn-toggle:hover {
  background: #f1f5f9;
}

.btn-toggle.active {
  background: #ffffff;
  border-color: #ec4899;
  box-shadow: 0 0 0 1px #ec4899;
}

.btn-toggle.active strong {
  color: #db2777;
}

/* Textarea & Magic Prompt */
.btn-link {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: #7c3aed;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-link:hover {
  background: #f5f3ff;
}

.textarea-wrap textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.textarea-wrap textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
}

/* Bottom Action Bar */
.action-bar-card {
  background: #ffffff;
  border: 1.5px solid #fbcfe8;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  bottom: 16px;
  z-index: 50;
}

.action-cost-info .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-krw {
  font-size: 19px;
  font-weight: 900;
  color: #db2777;
}

.price-usd {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-generate-main {
  background: var(--primary-gradient);
  border: none;
  color: #ffffff;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-generate-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -3px rgba(236, 72, 153, 0.45);
}

.btn-generate-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Stage Panel (Right) */
.video-stage-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ec4899;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-res {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

.btn-icon-action {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-action:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Video Viewer */
.video-container {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 580px;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-inner);
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Diffusion Overlay */
.render-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #ffffff;
  z-index: 20;
}

.render-overlay.hidden {
  display: none;
}

.diffusion-spinner {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #ec4899;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring.ring-2 {
  inset: 6px;
  border-top-color: #8b5cf6;
  animation: spin 1.6s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}

.dance-symbol {
  font-size: 24px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.render-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.render-info p {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.progress-bar-wrap {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.render-timer {
  font-size: 12px;
  font-weight: 700;
  color: #f472b6;
}

/* Video Meta */
.video-meta-bar {
  padding-top: 4px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.meta-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.meta-cost-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #db2777;
  background: #fdf2f8;
  padding: 3px 8px;
  border-radius: 6px;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tags .tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Showcase Grid */
.showcase-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.showcase-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.showcase-count {
  font-size: 11px;
  color: var(--text-muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover {
  border-color: #ec4899;
  transform: scale(1.04);
}

.gallery-item .overlay-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: #ffffff;
  margin-top: auto;
}
