/* BusyApesLabs v2 — Shared Design System */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800;900&family=Barlow:wght@400;500;600&display=swap');

:root {
  --bg: #080B12;
  --bg2: #0D1120;
  --bg3: #111827;
  --blue: #1A56FF;
  --blue-dim: rgba(26,86,255,.15);
  --blue-glow: rgba(26,86,255,.35);
  --card: #0D1120;
  --border: rgba(255,255,255,.08);
  --border-hover: rgba(255,255,255,.18);
  --text: #F0F2F8;
  --muted: #8B92A8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(8,11,18,.96), rgba(8,11,18,.96)),
    url('/assets/apes-bg.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.page-wrap { max-width: 900px; margin: 0 auto; padding: 0 20px 80px; }
.tool-header { padding: 48px 0 32px; text-align: center; }
.tool-header .category {
  font-size: 11px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--blue);
  margin-bottom: 12px; display: block;
}
.tool-header h1 {
  font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900; letter-spacing: -.01em; line-height: 1.1;
  margin-bottom: 12px;
}
.tool-header p {
  font-size: 1.05rem; color: var(--muted); max-width: 560px; margin: 0 auto;
}

/* ── Cards ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border-hover); }

/* ── Inputs ── */
input[type="text"], input[type="email"], input[type="number"],
input[type="url"], textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: var(--text); font-family: var(--font-body); font-size: .95rem;
  outline: none; transition: border-color .2s;
  resize: vertical;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; }
select option { background: var(--bg2); }

label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; letter-spacing: .03em;
  text-transform: uppercase;
}

.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 28px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  cursor: pointer; border: none; transition: all .2s; text-decoration: none;
}
.btn-primary {
  background: var(--blue); color: #fff;
}
.btn-primary:hover { background: #2563ff; transform: translateY(-1px); box-shadow: 0 4px 20px var(--blue-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg3); }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 16px; font-size: .85rem; }
.btn-ghost:hover { color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; }
.btn-icon { font-size: 1.1rem; }

/* ── Progress / Loading ── */
.ai-progress-wrap {
  background: var(--bg3); border-radius: 4px; height: 4px;
  overflow: hidden; margin: 16px 0;
}
.ai-progress-bar {
  height: 100%; background: var(--blue); border-radius: 4px;
  width: 0%; transition: width .4s ease;
  animation: pulse-blue 1.5s ease-in-out infinite;
}
@keyframes pulse-blue {
  0%,100% { opacity: 1; } 50% { opacity: .6; }
}
.loading-msg {
  font-size: .85rem; color: var(--muted); text-align: center;
  margin-top: 8px; min-height: 20px;
}
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Output Area ── */
.output-area {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 24px;
  min-height: 120px; position: relative;
}
.output-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 40px 20px;
  color: var(--muted); text-align: center;
}
.output-placeholder .icon { font-size: 2.5rem; opacity: .3; }
.output-placeholder p { font-size: .9rem; }
.output-content { white-space: pre-wrap; font-size: .95rem; line-height: 1.7; }
.output-content h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin: 20px 0 8px; color: var(--blue); }
.output-content h3 { font-size: 1rem; font-weight: 600; margin: 16px 0 6px; }
.output-content ul, .output-content ol { padding-left: 20px; margin: 8px 0; }
.output-content li { margin-bottom: 4px; }
.output-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Action bar ── */
.action-bar {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}

/* ── File upload ── */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--bg);
}
.file-drop:hover, .file-drop.drag-over {
  border-color: var(--blue); background: var(--blue-dim);
}
.file-drop input[type="file"] { display: none; }
.file-drop .drop-icon { font-size: 2rem; margin-bottom: 10px; opacity: .5; }
.file-drop p { color: var(--muted); font-size: .9rem; }
.file-drop strong { color: var(--text); }

/* ── Tags / Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
}
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-green { background: rgba(34,197,94,.15); color: var(--success); }
.badge-free { background: rgba(26,86,255,.2); color: #60a5fa; border: 1px solid rgba(26,86,255,.3); }

/* ── Privacy notice ── */
.privacy-note {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--muted); margin-top: 12px;
}
.privacy-note::before { content: '🔒'; font-size: .9rem; }

/* ── Disclaimer ── */
.disclaimer {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: .82rem; color: var(--warning); margin-top: 12px;
}

/* ── Navigation ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg); position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.nav-logo {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 900;
  color: var(--text); text-decoration: none; letter-spacing: -.01em;
}
.nav-logo span { color: var(--blue); }
.nav-back {
  font-size: .85rem; color: var(--muted); text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: color .2s;
}
.nav-back:hover { color: var(--text); }

/* ── Error state ── */
.error-state {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius-sm); padding: 16px; color: var(--danger);
  font-size: .9rem; display: none;
}
.error-state.visible { display: block; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--bg3); border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: .9rem; color: var(--text); opacity: 0;
  transform: translateY(10px); transition: all .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Utility ── */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.visible { display: block !important; }

/* ── Ad placeholders ── */
.ad-ph {
  background: var(--bg3); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .75rem; margin: 24px 0;
}
