/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0b0b12;
  --bg-panel:   #12121d;
  --bg-input:   #1a1a2a;
  --border:     rgba(255,255,255,0.07);
  --border-h:   rgba(255,255,255,0.14);
  --text:       #eeeef8;
  --muted:      #7777aa;
  --dim:        #44445a;
  --purple:     #a855f7;
  --pink:       #ec4899;
  --orange:     #f97316;
  --grad:       linear-gradient(135deg, #a855f7, #ec4899, #f97316);
  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 4px 32px rgba(0,0,0,0.45);
}

html { font-family: 'Inter', -apple-system, sans-serif; font-size: 15px; }
body { background: var(--bg); color: var(--text); min-height: 100vh; }

/* ─── Header ─── */
.header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,11,18,0.85);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 34px; height: 34px;
  background: var(--grad);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #fff; letter-spacing: 0.3px;
  flex-shrink: 0;
}
.logo-text { font-size: 19px; font-weight: 700; }
.tagline { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ─── Main layout ─── */
.main {
  flex: 1;
  max-width: 1200px; width: 100%;
  margin: 0 auto;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

/* ─── Panel ─── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.panel-header { margin-bottom: 22px; }
.panel-header h2 { font-size: 16px; font-weight: 600; }

/* ─── Fields ─── */
.field { margin-bottom: 18px; }
.label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.badge {
  font-size: 10px; font-weight: 500;
  background: rgba(255,255,255,0.06);
  padding: 2px 7px; border-radius: 20px;
  color: var(--dim); letter-spacing: 0.4px;
}

/* ─── Format Tabs ─── */
.format-tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 10px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.tab:hover { border-color: var(--border-h); color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.12));
  border-color: rgba(168,85,247,0.38);
  color: var(--text);
}
.tab-icon { font-size: 14px; }

/* ─── Textarea ─── */
.textarea {
  width: 100%; padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit; font-size: 14px; line-height: 1.65;
  resize: vertical; outline: none; transition: border-color 0.18s;
}
.textarea::placeholder { color: var(--dim); }
.textarea:focus { border-color: rgba(168,85,247,0.45); }
.textarea.error { border-color: rgba(239,68,68,0.5) !important; }

/* ─── Upload Zone ─── */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 108px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s; overflow: hidden;
}
.upload-zone:hover { border-color: var(--border-h); background: rgba(255,255,255,0.015); }
.upload-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 22px; color: var(--muted); text-align: center;
}
.upload-icon { color: rgba(168,85,247,0.55); margin-bottom: 3px; }
.upload-label { font-size: 13px; font-weight: 500; color: var(--text); }
.upload-hint { font-size: 12px; color: var(--muted); }

.upload-preview { position: relative; width: 100%; }
.upload-preview img { width: 100%; height: 140px; object-fit: cover; display: block; }
.remove-img {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.65); border: none;
  color: #fff; width: 27px; height: 27px;
  border-radius: 50%; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.remove-img:hover { background: rgba(0,0,0,0.88); }

/* ─── Generate Button ─── */
.generate-btn {
  width: 100%; padding: 13px 22px; margin-top: 4px;
  background: var(--grad);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(168,85,247,0.3);
}
.generate-btn:active:not(:disabled) { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ─── Empty State ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 11px;
  min-height: 420px; text-align: center; color: var(--muted);
}
.empty-icon { opacity: 0.25; margin-bottom: 6px; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--text); }
.empty-state p { font-size: 14px; line-height: 1.65; max-width: 240px; }
.empty-state strong { color: var(--text); }

/* ─── Loading ─── */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 15px; min-height: 420px;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(168,85,247,0.18);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { color: var(--muted); font-size: 14px; }

/* ─── Result Container ─── */
#result-container { display: flex; flex-direction: column; gap: 14px; }

/* Generated image */
.result-image {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-input);
}
.result-image img { width: 100%; display: block; }
.result-image-placeholder {
  height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}

/* Cards */
.result-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.result-card-header {
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted);
}
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-family: inherit;
  padding: 3px 10px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-h); }
.copy-btn.copied { color: var(--purple); border-color: rgba(168,85,247,0.35); }
.card-body { padding: 14px 15px; font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }

/* Hashtags */
.hashtags-wrap { padding: 13px 15px; display: flex; flex-wrap: wrap; gap: 7px; }
.hashtag {
  font-size: 13px; color: var(--purple);
  background: rgba(168,85,247,0.1);
  padding: 4px 10px; border-radius: 20px;
  cursor: pointer; transition: background 0.15s;
}
.hashtag:hover { background: rgba(168,85,247,0.18); }

/* Slides (Carrossel) */
.slides-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.slide-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 9px; padding: 14px;
}
.slide-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); font-size: 10px; font-weight: 700; color: #fff;
  margin-bottom: 8px;
}
.slide-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.slide-text { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Reels Script */
.reels-body { padding: 16px 15px; display: flex; flex-direction: column; gap: 18px; }
.reels-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--muted); margin-bottom: 8px;
}
.reels-gancho {
  font-size: 17px; font-weight: 700; line-height: 1.4;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.reels-point {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; line-height: 1.65; margin-bottom: 8px;
}
.reels-point:last-child { margin-bottom: 0; }
.point-num {
  flex-shrink: 0; width: 21px; height: 21px;
  background: rgba(168,85,247,0.13);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--purple);
}
.reels-cta {
  font-size: 14px; font-weight: 600;
  padding: 10px 14px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(236,72,153,0.1));
  border: 1px solid rgba(168,85,247,0.2);
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 13px 18px; border-radius: 12px;
  font-size: 13px; max-width: 360px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: fadeUp 0.25s ease;
}
.toast.error {
  background: #1e0a0c;
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */
@media (max-width: 780px) {
  .main { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .tagline { display: none; }
  .header { padding: 16px; }
}
