/* public/style.css - Bright Clean K-POP Studio Theme */
:root {
  --bg-page: #f8faff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --border-subtle: rgba(226, 232, 240, 0.9);
  --border-active: #ff3377;
  --primary-pink: #ff2d78;
  --primary-glow: rgba(255, 45, 120, 0.25);
  --accent-purple: #8b5cf6;
  --accent-coral: #ff6b81;
  --accent-gold: #f59e0b;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.theme-bright {
  background-color: var(--bg-page);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(255, 45, 120, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(56, 189, 248, 0.08) 0%, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation (Bright & Clean) */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff2d78, #ff6b81, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 18px rgba(255, 45, 120, 0.3);
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #0f172a;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: linear-gradient(90deg, #ff2d78, #8b5cf6);
  color: #fff;
}

.logo-text .sub {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cost-summary-pill {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 6px 16px;
  border-radius: 30px;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.pill-item {
  display: flex;
  flex-direction: column;
}

.pill-item .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.pill-item .val-highlight {
  font-size: 14px;
  font-weight: 800;
  color: #ff2d78;
  font-family: var(--font-display);
}

.pill-item .val-credits {
  font-size: 14px;
  font-weight: 800;
  color: #8b5cf6;
  font-family: var(--font-display);
}

.pill-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.dot.online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Workspace Layout */
.workspace {
  display: grid;
  grid-template-columns: 520px 1fr;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
  gap: 24px;
}

/* Control Panel */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 110px);
  padding-right: 6px;
}

.control-panel::-webkit-scrollbar {
  width: 6px;
}
.control-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Random Mega Hero (Bright Gradient) */
.random-hero-card {
  background: linear-gradient(135deg, #fff0f5, #f5f0ff, #eef9ff);
  border: 1.5px solid rgba(255, 45, 120, 0.25);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(255, 45, 120, 0.1);
}

.hero-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  background: #ff2d78;
  color: #fff;
  letter-spacing: 0.3px;
}

.hero-text-wrap h3 {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 4px;
}

.hero-text-wrap p {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.btn-random-mega {
  background: linear-gradient(90deg, #ff2d78, #ff6b81, #8b5cf6);
  background-size: 200% 200%;
  animation: rainbowGlow 4s ease infinite;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 22px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(255, 45, 120, 0.35);
}

@keyframes rainbowGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-random-mega:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 45, 120, 0.5);
}

.btn-random-mega:active {
  transform: scale(0.98);
}

.dice-icon {
  font-size: 28px;
  animation: diceRoll 3s ease-in-out infinite;
}

@keyframes diceRoll {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

.btn-text-block {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.btn-text-block strong {
  font-size: 16px;
  font-weight: 900;
}

.btn-text-block small {
  font-size: 12px;
  opacity: 0.95;
  font-weight: 500;
  font-family: var(--font-display);
}

/* Panel Cards (Pure White Glass) */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-with-icon .icon {
  font-size: 18px;
}

.title-with-icon h3 {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.badge-mini {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 14px;
  background: #fff0f5;
  color: #ff2d78;
  font-weight: 700;
  border: 1px solid rgba(255, 45, 120, 0.2);
}

.btn-text-action {
  background: none;
  border: none;
  color: #ff2d78;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-text-action:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Models Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.model-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.model-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.model-card.active {
  border-color: var(--primary-pink);
  background: #fff5f8;
  box-shadow: 0 4px 16px rgba(255, 45, 120, 0.18);
}

.model-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.model-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.model-cost-tag {
  font-size: 12px;
  font-weight: 800;
  color: #ff2d78;
  font-family: var(--font-display);
}

.model-provider {
  font-size: 10.5px;
  color: var(--text-muted);
}

.model-badge-txt {
  font-size: 10.5px;
  color: #8b5cf6;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Option Group & Chips (Bright) */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 13px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.chip:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

.chip.active {
  background: linear-gradient(135deg, #ff2d78, #8b5cf6);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 45, 120, 0.3);
}

/* Specs Row */
.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.custom-select {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  color: #0f172a;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.custom-select:focus {
  border-color: var(--primary-pink);
}

/* Prompt Preview Wrap */
.prompt-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.korean-desc-bar {
  font-size: 12.5px;
  color: #ff2d78;
  font-weight: 700;
  line-height: 1.4;
}

#videoPromptInput {
  background: transparent;
  border: none;
  color: #334155;
  font-size: 11.5px;
  font-family: monospace;
  resize: vertical;
  outline: none;
  line-height: 1.4;
}

.prompt-meta-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}

.meta-tag {
  font-size: 11px;
  color: #8b5cf6;
  font-weight: 600;
}

.btn-copy-sm {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-sm:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Main Generate Button */
.generate-actions {
  margin-top: 4px;
}

.btn-generate-main {
  width: 100%;
  background: linear-gradient(90deg, #ff2d78, #8b5cf6);
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(255, 45, 120, 0.35);
}

.btn-generate-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255, 45, 120, 0.45);
}

.btn-generate-main .btn-title {
  font-size: 15.5px;
  font-weight: 800;
}

.btn-generate-main .btn-cost {
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-display);
}

/* Right Result Panel & Stage */
.result-panel {
  display: flex;
  flex-direction: column;
}

.stage-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 600px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

/* Stage Placeholder */
.stage-placeholder {
  text-align: center;
  max-width: 480px;
}

.halo-circle {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0f5, #f5f0ff);
  border: 2px solid rgba(255, 45, 120, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(255, 45, 120, 0.15);
}

.stage-placeholder h2 {
  font-size: 23px;
  font-weight: 900;
  margin-bottom: 10px;
  color: #0f172a;
}

.stage-placeholder p {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 24px;
}

.quick-feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.quick-feature-tags span {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* Stage Loading */
.stage-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  max-width: 420px;
}

.loader-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary-pink);
  border-right-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.stage-loading h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.stage-loading p {
  font-size: 13px;
  color: var(--text-muted);
}

.progress-bar-wrap {
  width: 280px;
  height: 7px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, #ff2d78, #8b5cf6);
  animation: progressAnim 2.5s ease-in-out infinite;
}

@keyframes progressAnim {
  0% { width: 10%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 30%; margin-left: 70%; }
}

.loading-model-info {
  font-size: 12px;
  color: #ff2d78;
  font-weight: 700;
  font-family: var(--font-display);
}

/* Video Player Stage */
.video-player-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.video-media-box {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(255, 45, 120, 0.15);
  border: 2px solid #ffffff;
}

.video-media-box.landscape {
  aspect-ratio: 16 / 9;
  max-width: 720px;
}

.video-media-box.square {
  aspect-ratio: 1 / 1;
  max-width: 560px;
}

#mainVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-overlay-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2d78;
  box-shadow: 0 0 6px #ff2d78;
}

/* Video Controls Bar */
.video-controls-bar {
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.btn-ctrl:hover {
  background: #e2e8f0;
}

.speed-selector {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.btn-speed {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-speed.active {
  background: #ff2d78;
  color: #fff;
  border-color: #ff2d78;
}

.btn-download {
  background: linear-gradient(90deg, #ff2d78, #8b5cf6);
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(255, 45, 120, 0.25);
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 45, 120, 0.35);
}

/* Video Details Card */
.video-details-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.status-success {
  font-size: 11.5px;
  color: #10b981;
  font-weight: 800;
  display: block;
}

.det-title h4 {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.det-cost-badge {
  text-align: right;
}

.det-usd {
  font-size: 16px;
  font-weight: 900;
  color: #ff2d78;
  font-family: var(--font-display);
}

.det-krw {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 4px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.det-col {
  display: flex;
  flex-direction: column;
}

.det-col .k {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.det-col .v {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.details-prompt-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 8px;
}

.det-prompt-title {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

#detPromptText {
  font-size: 11.5px;
  color: #334155;
  font-family: monospace;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .control-panel {
    max-height: none;
  }
}
