:root {
  --bg-color: #0b0f19;
  --surface-color: #121826;
  --surface-border: #1e293b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #ec4899;
  --radius: 14px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  line-height: 1.5;
}

.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.header {
  text-align: center;
  padding: 12px 0;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.title-row h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Grid layout */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 860px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.control-panel {
  gap: 18px;
}

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

.flex-1 {
  flex: 1;
}

.form-row {
  display: flex;
  gap: 16px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

textarea, select, input[type="number"] {
  background: #0f1523;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}

textarea:focus, select:focus, input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

/* Examples Row */
.examples-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.examples-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.chip {
  background: #1e293b;
  color: #cbd5e1;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: #334155;
  color: #fff;
  transform: translateY(-1px);
}

/* Slider */
input[type="range"] {
  accent-color: var(--primary);
  width: 100%;
  margin-top: 4px;
  cursor: pointer;
}

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  text-transform: none;
}

.custom-checkbox input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Generate Button */
.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px var(--primary-glow);
  margin-top: 6px;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

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

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* Status Box */
.status-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Output Panel */
.output-panel {
  justify-content: center;
  align-items: center;
  min-height: 480px;
}

.preview-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.placeholder-state {
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px;
}

.icon-circle {
  font-size: 2.5rem;
  background: #1e293b;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.placeholder-state h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
}

.placeholder-state p {
  font-size: 0.85rem;
  max-width: 320px;
}

#resultWrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#resultImage {
  max-width: 100%;
  max-height: 520px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.download-btn {
  background: #1e293b;
  color: #f1f5f9;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.download-btn:hover {
  background: #334155;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  padding: 16px 0;
}

.footer a {
  color: #818cf8;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}
