﻿/* public/style.css - HR Beauty Studio v3 (Sexy Edition) Light Theme */
:root {
  --bg-main: #fcf8fa;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e8ecf2;
  --border-pink: #f7d6e6;
  --border-focus: #f43f5e;

  --accent-pink: #f43f5e;
  --accent-purple: #c026d3;
  --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #c026d3 100%);
  --accent-soft: #fdf2f8;
  --accent-glow: rgba(244, 63, 94, 0.28);

  --text-main: #0f172a;       /* 짙은 잉크 블랙 - 최고 가독성 */
  --text-body: #1e293b;       /* 짙은 본문 텍스트 */
  --text-muted: #475569;      /* 또렷한 설명 텍스트 */
  --text-dim: #64748b;        /* 보조 힌트 텍스트 */
  --text-green: #047857;      /* 선명한 다크 에메랄드 */
  --text-accent: #be185d;     /* 진한 마젠타 로즈 */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 10px 30px -5px rgba(219, 39, 119, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 8px 24px rgba(244, 63, 94, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-main);
  background: radial-gradient(circle at 15% 15%, rgba(244, 63, 94, 0.07) 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(192, 38, 211, 0.07) 0%, transparent 45%),
              linear-gradient(180deg, #fef6f9 0%, #f8fafc 100%);
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation */
.top-nav {
  height: 74px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border-pink);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.025);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.sparkle {
  font-size: 24px;
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #be185d 0%, #7e22ce 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
  -webkit-text-fill-color: initial;
}

.logo-text .sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cost-summary-pill {
  display: flex;
  align-items: center;
  background: #fdf2f8;
  border: 1.5px solid #fbcfe8;
  border-radius: 30px;
  padding: 7px 18px;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.pill-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pill-item .label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.val-highlight {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-green);
}

.val-highlight small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.val-credits {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-accent);
}

.pill-divider {
  width: 1.5px;
  height: 26px;
  background: #f472b6;
  opacity: 0.4;
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
}

.dot.online {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 28px;
  padding: 28px 32px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Left Control Panel */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.panel-card:hover {
  border-color: #fbcfe8;
  box-shadow: 0 12px 36px -5px rgba(219, 39, 119, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-with-icon .icon {
  font-size: 1.3rem;
}

.title-with-icon h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.badge-mini {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.hint-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* Form Controls */
.form-select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.form-select:hover {
  border-color: #f472b6;
}

.form-select:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

/* Model Info Box */
.model-info-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #fafafa;
  border: 1.5px solid #eef2f6;
}

.model-desc {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 14px;
  font-weight: 500;
}

.model-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-cell {
  background: #ffffff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.cell-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cell-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-green { color: var(--text-green) !important; }
.text-accent { color: var(--text-accent) !important; }

/* Preset Chips */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #334155;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.chip:hover {
  background: #fdf2f8;
  border-color: #f472b6;
  color: #be185d;
  transform: translateY(-1px);
}

.chip.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35);
}

/* Option Builder Group */
.option-builder-group {
  border-top: 1.5px solid #f1f5f9;
  padding-top: 16px;
  margin-bottom: 16px;
}

.option-builder-group:first-of-type {
  border-top: none;
  padding-top: 0;
}

.builder-group-title {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-group-title .icon {
  font-size: 1.1rem;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-btn:hover {
  background: #fdf2f8;
  border-color: #f472b6;
  color: #be185d;
  transform: translateY(-1px);
}

.tag-btn.active {
  background: #fce7f3;
  border-color: #ec4899;
  color: #9d174d;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.15);
}

/* Prompt Box */
.prompt-box-wrapper textarea {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.prompt-box-wrapper textarea:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s;
}

.btn-text-action:hover {
  color: var(--accent-pink);
}

.btn-text-action.danger:hover {
  color: #dc2626;
}

/* Accordion */
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.accordion-header:hover {
  color: var(--text-main);
}

.accordion-body {
  margin-top: 10px;
}

.accordion-body.hidden {
  display: none;
}

.accordion-body textarea {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #334155;
  font-size: 0.84rem;
  outline: none;
  font-family: inherit;
}

/* Aspect Ratio Selector */
.ratio-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  margin-top: 8px;
}

.ratio-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
}

.ratio-btn:hover {
  border-color: #f472b6;
  color: #0f172a;
}

.ratio-btn.active {
  background: #fdf2f8;
  border-color: var(--accent-pink);
  color: #be185d;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.12);
}

.ratio-box {
  background: #94a3b8;
  border-radius: 3px;
}

.ratio-btn.active .ratio-box {
  background: var(--accent-pink);
}

.r-1-1 { width: 20px; height: 20px; }
.r-9-16 { width: 15px; height: 26px; }
.r-3-4 { width: 18px; height: 24px; }
.r-16-9 { width: 26px; height: 15px; }
.r-4-3 { width: 24px; height: 18px; }

.ratio-txt {
  font-size: 0.76rem;
  line-height: 1.2;
  text-align: center;
  font-weight: 700;
}

.ratio-txt small {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Option Row Split */
.option-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.option-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 8px;
  font-weight: 700;
}

.seed-input-group {
  display: flex;
  gap: 8px;
}

.seed-input-group input {
  flex: 1;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}

.seed-input-group input:focus {
  border-color: var(--accent-pink);
}

.btn-icon-sub {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.btn-icon-sub:hover {
  background: #fdf2f8;
  border-color: #f472b6;
}

/* Action Button */
.action-btn-area {
  margin-top: 24px;
}

.btn-generate {
  width: 100%;
  position: relative;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  color: #ffffff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(244, 63, 94, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(244, 63, 94, 0.55);
}

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

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

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.btn-icon {
  font-size: 1.4rem;
}

.btn-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.btn-cost-tag {
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.22);
  padding: 4px 10px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff0f5;
}

/* Right Result Panel */
.result-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-height: 580px;
  box-shadow: var(--shadow-card);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.indicator.live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.8);
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.btn-preview-action {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-preview-action:hover {
  background: #fdf2f8;
  border-color: #f472b6;
  color: #be185d;
}

.btn-preview-action.primary {
  background: var(--accent-pink);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.btn-preview-action.primary:hover {
  background: #e11d48;
}

/* Canvas Container */
.preview-canvas-container {
  flex: 1;
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 480px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  max-width: 460px;
}

.empty-icon {
  font-size: 3.8rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #0f172a;
}

.empty-state p {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.65;
  margin-bottom: 22px;
  font-weight: 500;
}

.empty-state p strong {
  color: #be185d;
}

.model-quick-tips {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #fbcfe8;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.82rem;
  color: #1e293b;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tip-badge {
  color: #d97706;
  font-weight: 800;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.loading-state.hidden {
  display: none;
}

.spinner-core {
  position: relative;
  width: 74px;
  height: 74px;
}

.ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid transparent;
}

.ring.r1 {
  border-top-color: #f43f5e;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.ring.r2 {
  border-right-color: #c026d3;
  animation: spin 1.6s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}

.ring.r3 {
  border-bottom-color: #10b981;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.loading-model-name {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 600;
}

.timer-badge {
  font-family: monospace;
  font-size: 1.05rem;
  background: #ffffff;
  border: 1.5px solid #fbcfe8;
  padding: 6px 16px;
  border-radius: 14px;
  color: #be185d;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

/* Image View State */
.image-view-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: zoom-in;
}

.image-view-wrapper.hidden {
  display: none;
}

.image-view-wrapper img {
  max-width: 100%;
  max-height: 620px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.image-view-wrapper img:hover {
  transform: scale(1.01);
}

.image-overlay-info {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  border: 1.5px solid #fbcfe8;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.info-model {
  font-weight: 800;
  color: #be185d;
}

.info-meta {
  color: #334155;
  font-weight: 600;
}

/* History Gallery */
.gallery-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gallery-count {
  font-size: 0.78rem;
  font-weight: 700;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 12px;
  color: var(--text-main);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 14px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 6px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.gallery-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-pink);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.hidden {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
}

.lightbox-content {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.2rem;
  cursor: pointer;
}

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