/* ============================================
   QuesCreate GO — red & orange creator studio
   ============================================ */

:root {
  --red: #e62117;
  --red-dark: #b51308;
  --orange: #ff8c1a;
  --orange-dark: #e06900;
  --gradient: linear-gradient(135deg, var(--red) 0%, var(--orange) 100%);
  --bg: #fff7f2;
  --surface: #ffffff;
  --ink: #2b1a14;
  --ink-soft: #7a5c50;
  --border: #ffe0cc;
  --shadow: 0 6px 24px rgba(230, 33, 23, 0.10);
  --shadow-hover: 0 10px 32px rgba(230, 33, 23, 0.18);
  --radius: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ============ HEADER ============ */

.app-header {
  text-align: center;
  padding: 32px 16px 24px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* YouTube-style play icon */
.logo-yt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 40px;
  background: var(--red);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.logo-yt-play {
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 3px;
}

/* Orange Q badge */
.logo-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 30%, #ffb066, var(--orange) 60%, var(--orange-dark));
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.brand-text { text-align: left; }

.brand-text h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-go { letter-spacing: 2px; }

.tagline {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.header-desc {
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

/* ============ TABS ============ */

.tab-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 28px;
  position: sticky;
  top: 8px;
  z-index: 10;
}

.tab-btn {
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(230, 33, 23, 0.06);
}

.tab-btn:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.count-badge {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--red);
  border-radius: 999px;
  font-size: 0.78rem;
  text-align: center;
  margin-left: 4px;
}

.tab-btn:not(.active) .count-badge {
  background: var(--bg);
  color: var(--orange-dark);
}

/* ============ PANELS ============ */

.tab-panel { display: none; animation: fadeUp 0.35s ease; }
.tab-panel.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ INPUT CARD ============ */

.input-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--orange);
  margin-bottom: 28px;
}

.input-card h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-field { margin-bottom: 16px; }
.form-grid .form-field { margin-bottom: 0; }

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-field input[type="text"],
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 140, 26, 0.15);
}

/* ============ BUTTONS ============ */

.btn-primary {
  display: block;
  width: 100%;
  background: var(--gradient);
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary,
.btn-ghost {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: var(--surface);
  color: var(--red);
  border: 2px solid var(--red);
}

.btn-secondary:hover { background: var(--red); color: #fff; transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 2px solid var(--border);
}

.btn-ghost:hover { border-color: var(--orange); color: var(--orange-dark); }

/* ============ RESULTS ============ */

.results-section { margin-bottom: 28px; }

.results-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-left: 4px;
  border-left: 5px solid var(--orange);
  padding-left: 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.result-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-top: 4px solid var(--red);
}

.result-card:nth-child(even) { border-top-color: var(--orange); }

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.result-card.full-width { grid-column: 1 / -1; }

.result-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-card pre {
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
  max-height: 420px;
  overflow-y: auto;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

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

/* ============ LIBRARY CARDS ============ */

.lib-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lib-card-actions button {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lib-card-actions button:hover { border-color: var(--orange); color: var(--orange-dark); }
.lib-card-actions button.danger:hover { border-color: var(--red); color: var(--red); }

.type-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  margin-bottom: 8px;
}

.type-chip.yt { background: var(--red); }
.type-chip.suno { background: var(--orange); }

/* ============ IMAGE VAULT ============ */

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px dashed var(--orange);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 32px 16px;
  cursor: pointer;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  transition: all 0.25s ease;
}

.file-drop:hover { background: #fff0e3; border-color: var(--red); }

.file-drop-icon { font-size: 2rem; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.image-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.image-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.image-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.image-card-body { padding: 12px 14px 14px; }

.image-card-body p {
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 8px;
  word-wrap: break-word;
}

.image-card-body .card-meta { margin-top: 0; margin-bottom: 8px; }

/* ============ MISC ============ */

.empty-msg {
  text-align: center;
  color: var(--ink-soft);
  padding: 32px 16px;
  font-size: 0.98rem;
}

.empty-msg.hidden { display: none; }

.app-footer {
  text-align: center;
  margin-top: 48px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* Toast notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ MOBILE ============ */

@media (max-width: 600px) {
  .app-header { padding-top: 16px; }
  .brand-text h1 { font-size: 1.5rem; }
  .header-desc { font-size: 0.95rem; }
  .tab-btn { font-size: 0.85rem; padding: 9px 13px; }
  .input-card { padding: 22px 18px; }
  .results-actions .btn-secondary,
  .results-actions .btn-ghost { flex: 1 1 45%; }
}
