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

body {
  font-family: 'Inter', sans-serif;
  background-color: #0b1117;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

.container {
  width: 100%;
  max-width: 960px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  background: #131c24;
  border: 1px solid #1e2a36;
  border-radius: 14px;
  padding: 20px 28px;
}

.header-left {
  flex: 1;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: #7a8a9e;
  font-weight: 400;
}

.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 10px;
  padding: 10px 16px;
}

.demo-icon {
  flex-shrink: 0;
}

.demo-text {
  display: flex;
  flex-direction: column;
}

.demo-label {
  font-size: 13px;
  font-weight: 600;
  color: #00d4ff;
}

.demo-remaining {
  font-size: 11px;
  color: #00d4ff;
  opacity: 0.7;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #4a5a6e;
  background: transparent;
  border: 1px solid #1e2a36;
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.logout-btn:hover {
  color: #ff6b6b;
  border-color: rgba(255, 80, 80, 0.35);
  background: rgba(255, 80, 80, 0.06);
}

.main {
  display: flex;
  gap: 32px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 240px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: default;
  transition: all 0.3s ease;
}

.step.active {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.35);
}

.step:not(.active) {
  border: 1px solid transparent;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1.5px solid #3a4a5c;
  color: #5a6a7e;
  background: transparent;
}

.step-number.active {
  background: #00b8d4;
  border-color: #00b8d4;
  color: #ffffff;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: #7a8a9e;
}

.step.active .step-label {
  color: #ffffff;
}

.step-connector {
  width: 1.5px;
  height: 28px;
  background: #2a3a4c;
  margin: 4px 0 4px 34px;
  align-self: flex-start;
}

.content-panel {
  flex: 1;
  background: #1a2633;
  border: 1px solid #2a3a4c;
  border-radius: 14px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  margin-bottom: 24px;
}

.step-indicator {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #00b8d4;
  letter-spacing: 0.5px;
  text-align: right;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.panel-description {
  font-size: 13px;
  color: #7a8a9e;
  line-height: 1.6;
}

.upload-section {
  flex: 1;
}

.upload-title {
  font-size: 14px;
  font-weight: 600;
  color: #c0ccd8;
  margin-bottom: 16px;
}

.upload-cards {
  display: flex;
  gap: 16px;
}

.upload-card {
  width: 130px;
  height: 130px;
  border: 1.5px dashed #2a3a4c;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
}

.upload-card:hover {
  border-color: #00b8d4;
  background: rgba(0, 184, 212, 0.05);
}

.upload-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-label {
  font-size: 11px;
  font-weight: 500;
  color: #7a8a9e;
  text-align: center;
}

.upload-sublabel {
  font-size: 10px;
  color: #5a6a7e;
  margin-top: -4px;
}

.panel-footer {
  margin-top: 28px;
}

.btn-next {
  width: 100%;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: default;
  transition: all 0.3s ease;
  background: #2a3a4c;
  color: #5a6a7e;
}

.btn-next:not(:disabled) {
  background: linear-gradient(135deg, #00b8d4, #0097a7);
  color: #ffffff;
  cursor: pointer;
}

.btn-next:not(:disabled):hover {
  background: linear-gradient(135deg, #00c9e0, #00a8b5);
  box-shadow: 0 4px 16px rgba(0, 184, 212, 0.3);
}

.upload-card.uploaded {
  border-style: solid;
  position: relative;
  overflow: hidden;
}

.upload-card.uploaded:hover {
  background: transparent;
}

.upload-preview {
  width: 100%;
  height: 100%;
  position: relative;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e53935;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.delete-btn:hover {
  background: #c62828;
}

.step-content {
  display: none;
  flex-direction: column;
  flex: 1;
}

.step-content.active {
  display: flex;
}

.step-number.completed {
  background: #2ecc71;
  border-color: #2ecc71;
  color: #ffffff;
  position: relative;
  font-size: 0;
}

.step-number.completed::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  position: absolute;
  top: 8px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #7a8a9e;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.btn-back:hover {
  color: #ffffff;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.panel-header-row .step-indicator {
  margin-bottom: 0;
}

.param-section {
  margin-bottom: 24px;
}

.param-label {
  font-size: 14px;
  font-weight: 500;
  color: #c0ccd8;
}

.param-title {
  font-size: 14px;
  font-weight: 600;
  color: #c0ccd8;
  margin-bottom: 4px;
}

.param-subtitle {
  font-size: 12px;
  color: #5a6a7e;
  font-style: italic;
  margin-bottom: 14px;
}

.gender-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gender-box {
  cursor: pointer;
  user-select: none;
}

.gender-box input {
  display: none;
}

.gender-box-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  border: 1px solid #2a3a4c;
  border-radius: 8px;
  background: #131c24;
  transition: all 0.2s ease;
}

.gender-box input:checked ~ .gender-box-inner {
  border-color: rgba(0, 184, 212, 0.3);
}

.gender-text {
  font-size: 14px;
  font-weight: 500;
  color: #c0ccd8;
}

.gender-check {
  width: 20px;
  height: 20px;
  border: 1.5px solid #3a4a5c;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.gender-box input:checked ~ .gender-box-inner .gender-check {
  background: #00b8d4;
  border-color: #00b8d4;
}

.gender-box input:checked ~ .gender-box-inner .gender-check::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  position: absolute;
  top: 4px;
}

.image-select-grid {
  display: flex;
  gap: 14px;
}

.image-select-item {
  width: 120px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}

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

.image-select-item .image-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.image-select-item.selected .image-check {
  background: #00b8d4;
  border-color: #00b8d4;
}

.image-select-item.selected .image-check::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  position: absolute;
  top: 4px;
  left: 4px;
}

.dropdown-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dropdown-row .param-label {
  min-width: 80px;
}

.custom-select {
  position: relative;
  width: 160px;
}

.custom-select select {
  width: 100%;
  padding: 10px 36px 10px 16px;
  background: #131c24;
  border: 1px solid #2a3a4c;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-select select:hover,
.custom-select select:focus {
  border-color: #00b8d4;
}

.custom-select::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #7a8a9e;
  pointer-events: none;
}

.custom-select select option {
  background: #131c24;
  color: #ffffff;
}

.custom-select select option:disabled {
  color: #5a6a7e;
}

.content-box {
  background: rgba(0, 184, 212, 0.05);
  border: 1px solid rgba(0, 184, 212, 0.15);
  border-radius: 10px;
  padding: 20px 24px;
}

.content-box-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.content-box-subtitle {
  font-size: 12px;
  color: #5a6a7e;
  font-style: italic;
  margin-bottom: 16px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-item input {
  display: none;
}

.checkbox-mark {
  width: 20px;
  height: 20px;
  border: 1.5px solid #3a4a5c;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.checkbox-item input:checked ~ .checkbox-mark {
  background: #00b8d4;
  border-color: #00b8d4;
}

.checkbox-item input:checked ~ .checkbox-mark::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  position: absolute;
  top: 4px;
}

.checkbox-label {
  font-size: 13px;
  font-weight: 500;
  color: #c0ccd8;
}

.step4-state {
  display: none;
  flex-direction: column;
  flex: 1;
}

.step4-state.active {
  display: flex;
}

.step4-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 0;
}

.step4-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step4-icon-success {
  background: #00b8d4;
}

.step4-icon-processing {
  background: #f5a623;
  animation: spin 1.5s linear infinite;
}

.step4-icon-error {
  background: #e53935;
}

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

.step4-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.step4-description {
  font-size: 13px;
  color: #7a8a9e;
  line-height: 1.6;
  max-width: 360px;
}

.btn-start {
  width: 100%;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #00b8d4, #0097a7);
  color: #ffffff;
}

.btn-start:hover {
  background: linear-gradient(135deg, #00c9e0, #00a8b5);
  box-shadow: 0 4px 16px rgba(0, 184, 212, 0.3);
}

.progress-box {
  background: #131c24;
  border: 1px solid #2a3a4c;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 0 0 0;
}

.progress-box-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.progress-box-status {
  font-size: 12px;
  color: #00b8d4;
  margin-bottom: 14px;
}

.progress-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #2a3a4c;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00b8d4, #0097a7);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-percent {
  font-size: 13px;
  font-weight: 600;
  color: #7a8a9e;
  min-width: 36px;
}

.btn-stop {
  width: 100%;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #2a3a4c;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #1a2633;
  color: #00b8d4;
}

.btn-stop:hover {
  border-color: #00b8d4;
  background: rgba(0, 184, 212, 0.05);
}

.step.completed {
  background: rgba(46, 204, 113, 0.06);
  border: 1px solid rgba(46, 204, 113, 0.25);
}

.step.completed .step-label {
  color: #2ecc71;
}

.result-image-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a3a4c;
  margin-bottom: 4px;
}

.result-image-container img {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 400px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #131c24;
  border: 1px solid #1e2a36;
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.modal-icon {
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.modal-description {
  font-size: 13px;
  color: #7a8a9e;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-btn {
  background: linear-gradient(135deg, #00b8d4, #0091ea);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn:hover {
  opacity: 0.9;
}

/* Result Layout Styles */
.result-container {
  display: flex;
  gap: 24px;
  margin: 32px 0;
  min-height: 400px;
}

.result-left {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 16px;
  text-align: center;
}

.result-image-container {
  background: #0f1419;
  border: 1px solid #1e2a36;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.result-image-container img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.result-story-container {
  flex: 1;
  margin-bottom: 16px;
}

.result-story-frame {
  background: #0f1419;
  border: 1px solid #1e2a36;
  border-radius: 12px;
  padding: 20px;
  height: 100%;
  min-height: 300px;
}

.result-story-content {
  font-size: 14px;
  line-height: 1.7;
  color: #e1e8ed;
  white-space: pre-wrap;
  word-wrap: break-word;
  height: 100%;
  overflow-y: auto;
}

.result-actions {
  display: flex;
  justify-content: center;
}

.btn-download, .btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #00b8d4, #0091ea);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-download:hover, .btn-copy:hover {
  opacity: 0.9;
}

.btn-copy {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

/* Responsive Design */
@media (max-width: 768px) {
  .result-container {
    flex-direction: column;
    gap: 16px;
  }
  
  .result-left, .result-right {
    flex: none;
  }
  
  .result-story-frame {
    min-height: 200px;
  }
}
