/* ═══════════════════════════════════════════
   Panthers Flow — AI Studio
   ═══════════════════════════════════════════ */

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0b0b12;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────── */

#siteHeader {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,11,18,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#headerInner {
  max-width: 640px; margin: 0 auto;
  padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
#logoArea { display: flex; align-items: center; gap: 10px; }
#logoEmoji { font-size: 22px; }
#logoTitle {
  font-size: 17px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(135deg,#a78bfa,#818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
#logoBadge {
  font-size: 8px; font-weight: 700; letter-spacing: 0.1em;
  color: #8b5cf6; background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
  padding: 1px 6px; border-radius: 99px;
}
#statusArea { display:flex; align-items:center; gap:5px; font-size:12px; color:#777; }
#statusDot {
  width:7px; height:7px; border-radius:50%;
  background:#22c55e; box-shadow:0 0 6px rgba(34,197,94,0.5);
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ─── Main Container ─────────────────────── */

#mainContainer {
  max-width: 540px; margin: 0 auto;
  padding: 20px 14px 80px;
  display: flex; flex-direction: column; gap: 10px;
}

/* ─── Main Tabs ──────────────────────────── */

#mainTabs {
  display: flex;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 99px;
  padding: 3px;
}
.main-tab {
  flex: 1;
  padding: 11px 0;
  border: none; border-radius: 99px;
  background: none;
  color: #777;
  font: 600 14px/1 'Inter',sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.main-tab:hover { color: #ccc; }
.main-tab.active {
  background: #1e1e2e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ─── Video Mode Bar (Frames / Ingredients) ─ */

#videoModeBar {
  display: flex; gap: 4px;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 3px;
}
.mode-btn {
  flex: 1;
  padding: 8px 12px;
  border: none; border-radius: 7px;
  background: none;
  color: #777;
  font: 600 13px/1 'Inter',sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn:hover { color: #ccc; }
.mode-btn.active {
  background: #1e1e2e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

/* ─── Aspect Ratio Bar ───────────────────── */

#aspectBar {
  display: flex; gap: 6px; justify-content: center;
}
.ar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: #151520;
  color: #777;
  font: 600 11px 'Inter',sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 52px;
}
.ar-btn:hover { border-color: rgba(255,255,255,0.2); color:#ccc; }
.ar-btn.active {
  background: #1e1e2e;
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}
.ar-box { border: 1.5px solid currentColor; border-radius: 2px; }

/* ─── Model Dropdown ─────────────────────── */

#modelWrap { position: relative; }
#modelBtn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: #151520;
  color: #e0e0e0;
  font: 600 13px 'Inter',sans-serif;
  cursor: pointer;
  transition: border-color 0.15s;
}
#modelBtn:hover { border-color: rgba(255,255,255,0.2); }
#modelArrow { font-size: 11px; color: #777; transition: transform 0.15s; }
#modelWrap.open #modelArrow { transform: rotate(180deg); }

#modelList {
  display: none;
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #1a1a28;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 4px;
  z-index: 50;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
}
#modelWrap.open #modelList {
  display: block;
  animation: fadeIn 0.12s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(-3px)} to{opacity:1;transform:translateY(0)} }

.ml-opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  border: none; border-radius: 7px;
  background: none;
  color: #e0e0e0;
  font: 500 13px 'Inter',sans-serif;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
}
.ml-opt:hover { background: rgba(255,255,255,0.06); }
.ml-opt.active { background: rgba(139,92,246,0.12); color:#a78bfa; }

/* ─── Pill Bar (Duration / Count) ────────── */

.pill-bar { display: flex; gap: 5px; justify-content: center; }
.pill {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 99px;
  background: #151520;
  color: #777;
  font: 600 13px 'Inter',sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.pill:hover { border-color:rgba(255,255,255,0.2); color:#ccc; }
.pill.active {
  background: #1e1e2e;
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

/* ─── Credit Line ────────────────────────── */

#creditLine {
  text-align: center; font-size: 12px; color: #22c55e;
}
#creditLine strong { color: #4ade80; }

/* ─── Frame Upload Bar ───────────────────── */

#frameBar {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.frame-box {
  width: 76px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed rgba(255,255,255,0.2);
  border-radius: 10px;
  background: #151520;
  color: #777;
  font: 600 12px 'Inter',sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  position: relative; overflow: hidden;
}
.frame-box:hover { border-color:#aaa; color:#ccc; background:#1a1a28; }
.frame-box.filled { border-style:solid; border-color:#8b5cf6; }
.frame-box img {
  width:100%; height:100%; object-fit:cover;
  position:absolute; top:0; left:0;
}
#frameSep { color:#555; font-size:16px; }

/* ─── Prompt Area ────────────────────────── */

#promptWrap {
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px 14px 10px;
  transition: border-color 0.15s;
}
#promptWrap:focus-within { border-color:rgba(139,92,246,0.4); }
#promptInput {
  width: 100%;
  background: none; border: none; outline: none;
  color: #e0e0e0;
  font: 400 14px/1.5 'Inter',sans-serif;
  resize: none;
  min-height: 40px; max-height: 120px;
}
#promptInput::placeholder { color:#555; }
#promptFooter {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}
#promptTag {
  font-size: 11px; color: #555;
  background: rgba(255,255,255,0.04);
  padding: 3px 8px; border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.04);
}
#sendBtn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: #1e1e2e;
  color: #888;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}
#sendBtn:hover { background:#8b5cf6; color:#fff; box-shadow:0 0 14px rgba(139,92,246,0.4); }
#sendBtn:disabled { opacity:0.3; cursor:default; }
.spin-icon {
  display:inline-block; width:15px; height:15px;
  border:2px solid rgba(255,255,255,0.2);
  border-top-color:#fff;
  border-radius:50%;
  animation: spin 0.5s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ─── Progress ───────────────────────────── */

#progressWrap { margin-top: 4px; }
#progressTrack {
  height: 4px; background: rgba(255,255,255,0.05);
  border-radius: 99px; overflow: hidden;
}
#progressBar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg,#8b5cf6,#6366f1,#818cf8);
  border-radius: 99px;
  transition: width 0.4s ease;
}
#progressLabel { font-size:11px; color:#777; text-align:center; margin-top:5px; }

/* ─── Results ────────────────────────────── */

#resultsArea { margin-top: 6px; }
#resultsHead {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:10px;
}
#resultsHead h2 { font-size:15px; font-weight:700; }
#clearBtn {
  padding:4px 10px; border:1px solid rgba(239,68,68,0.25);
  border-radius:7px; background:rgba(239,68,68,0.06);
  color:#ef4444; font:600 11px 'Inter',sans-serif;
  cursor:pointer; transition:background 0.15s;
}
#clearBtn:hover { background:rgba(239,68,68,0.12); }

#resultsGrid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:10px;
}
.r-card {
  background:#151520; border:1px solid rgba(255,255,255,0.06);
  border-radius:10px; overflow:hidden;
  transition: all 0.2s;
}
.r-card:hover { border-color:rgba(255,255,255,0.15); transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,0.3); }
.r-media { width:100%; aspect-ratio:16/9; object-fit:cover; display:block; background:#111; }
.r-actions { padding:8px; }
.r-dl {
  display:block; width:100%; padding:7px;
  border:none; border-radius:7px;
  background:#8b5cf6; color:#fff;
  font:600 12px 'Inter',sans-serif;
  cursor:pointer; text-decoration:none; text-align:center;
  transition: box-shadow 0.15s;
}
.r-dl:hover { box-shadow:0 4px 12px rgba(139,92,246,0.3); }

/* ─── Footer ─────────────────────────────── */

#siteFooter {
  text-align:center; padding:20px 14px;
  color:#444; font-size:11px;
  border-top:1px solid rgba(255,255,255,0.04);
}

/* ─── Toast ──────────────────────────────── */

.toast {
  position:fixed; bottom:-60px; left:50%; transform:translateX(-50%);
  padding:9px 18px; border-radius:99px;
  background:#1a1a28; border:1px solid rgba(255,255,255,0.08);
  color:#e0e0e0; font:500 13px 'Inter',sans-serif;
  box-shadow:0 8px 24px rgba(0,0,0,0.4);
  transition:bottom 0.25s; z-index:1000; white-space:nowrap;
}
.toast.show { bottom:18px; }
.toast.error { border-color:rgba(239,68,68,0.4); color:#ef4444; }
.toast.success { border-color:rgba(34,197,94,0.4); color:#22c55e; }

/* ─── Responsive ─────────────────────────── */

@media(max-width:480px) {
  #mainContainer { padding:14px 10px 60px; }
  .ar-btn { padding:8px 10px; min-width:44px; font-size:10px; }
  .pill { padding:6px 12px; font-size:12px; }
  #resultsGrid { grid-template-columns:1fr; }
}
