:root {
  --bg: #0c0c0c;
  --panel: #141414;
  --border: #2a2a2a;
  --text: #f5f5f5;
  --muted: #888;
  --accent: #c8f542;
  --accent-hover: #d4ff4a;
  --accent-text: #0a0a0a;
  --radius: 12px;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 100vh;
}

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

/* Left panel */
.panel-left {
  padding: 2rem 1.75rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.badge {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--panel);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: #1a1a1a;
}

.upload-zone input {
  display: none;
}

.upload-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.upload-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
}

.gen-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle button.active {
  background: #fff;
  color: var(--accent-text);
  font-weight: 600;
}

.image-only-field {
  display: none;
}

.image-only-field.visible {
  display: block;
}

.video-options {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.video-options.visible {
  display: flex;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkbox-row input {
  accent-color: var(--accent);
}

.btn-generate {
  margin-top: auto;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-generate:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-bar {
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1.2em;
}

.status-bar.error {
  color: #ff6b6b;
}

.status-bar.success {
  color: var(--accent);
}

/* Right panel */
.panel-right {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  background: #080808;
}

.preview-wrap {
  flex: 1;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-placeholder {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.preview-placeholder p {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.preview-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: calc(100vh - 120px);
}

.preview-thumb {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 2px solid #fff;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: none;
}

.preview-thumb.visible {
  display: block;
}

.health-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
}

.health-pill.ok {
  color: var(--accent);
}

.health-pill.bad {
  color: #ff6b6b;
}

.credits-pill {
  position: absolute;
  top: 12px;
  right: 120px;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  color: #9ad0ff;
}

.links-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.links-row a {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.links-row a:hover {
  background: var(--panel);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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