/* ═══════════════════════════════════════════════════════════
   PrepBot — style.css
═══════════════════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
  --bg: #0d1117;
  --bg2: #0a0d13;
  --surface: #161b27;
  --surface2: #1e2436;
  --surface3: #252d42;
  --border: #2a3150;
  --accent: #6c63ff;
  --accent-dim: rgba(108, 99, 255, .15);
  --accent-hover: #8b85ff;
  --accent-glow: rgba(108, 99, 255, .3);
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --text: #e0e3f0;
  --text-dim: #7c82a0;
  --text-muted: #4a5068;
  --user-bubble: #6c63ff;
  --bot-bubble: #1a1f35;
  --card-bg: #161b27;
  --gradient-text: linear-gradient(135deg, #6c63ff, #a78bfa, #60a5fa);
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg2: #eceef5;
  --surface: #ffffff;
  --surface2: #f0f2fa;
  --surface3: #e8eaf5;
  --border: #dde1f0;
  --accent: #5b52e8;
  --accent-dim: rgba(91, 82, 232, .1);
  --accent-hover: #4840cc;
  --accent-glow: rgba(91, 82, 232, .2);
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --text: #1a1d2e;
  --text-dim: #5a6080;
  --text-muted: #9499b8;
  --user-bubble: #5b52e8;
  --bot-bubble: #eef0fa;
  --card-bg: #ffffff;
  --gradient-text: linear-gradient(135deg, #5b52e8, #7c3aed, #2563eb);
}

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

html {
  scroll-behavior: smooth
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  transition: background .25s ease, color .25s ease
}

a {
  text-decoration: none;
  color: inherit
}

ul {
  list-style: none
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .18s, border-color .18s, transform .15s;
  flex-shrink: 0
}

.theme-toggle:hover {
  background: var(--surface3);
  border-color: var(--accent);
  transform: rotate(20deg)
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .18s, transform .1s, box-shadow .18s;
  box-shadow: 0 4px 14px var(--accent-glow)
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px)
}

.btn-primary:active {
  transform: scale(.97)
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  transition: all .18s
}

.btn-ghost:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent-hover)
}

/* ═══ LANDING PAGE ═══════════════════════════════════════ */
.landing-body {
  min-height: 100vh;
  overflow-x: hidden
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px)
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px
}

.nav-logo {
  font-size: 22px
}

.nav-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px
}

.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .18s
}

.nav-cta:hover {
  background: var(--accent-hover)
}

/* Hero */
.hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 90px 24px 70px;
  text-align: center
}

.hero-badge {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid rgba(108, 99, 255, .3);
  color: var(--accent-hover);
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px
}

.hero-title {
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -1.5px;
  margin-bottom: 20px
}

.hero-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text
}

.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.7
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 52px
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px
}

.stat strong {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent)
}

.stat span {
  font-size: 12px;
  color: var(--text-dim)
}

.stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border)
}
/* -- Section Header -- */
.section-header{text-align:center;margin-bottom:52px}
.section-header h2{font-size:clamp(24px,4vw,36px);font-weight:700;letter-spacing:-.5px;margin-bottom:10px}
.section-header p{font-size:15px;color:var(--text-dim);max-width:520px;margin:0 auto}

/* -- Features Grid -- */
.features{max-width:1100px;margin:0 auto;padding:80px 24px;border-top:1px solid var(--border)}
.features-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:20px}
.feature-card{background:var(--card-bg);border:1px solid var(--border);border-radius:14px;padding:24px;transition:border-color .18s,box-shadow .18s,transform .18s}
.feature-card:hover{border-color:var(--accent);box-shadow:0 4px 20px var(--accent-glow);transform:translateY(-2px)}
.fc-icon{font-size:28px;margin-bottom:12px}
.feature-card h3{font-size:16px;font-weight:600;margin-bottom:8px}
.feature-card p{font-size:13.5px;color:var(--text-dim);line-height:1.6;margin-bottom:12px}
.fc-list{display:flex;flex-direction:column;gap:4px}
.fc-list li{font-size:12.5px;color:var(--text-muted);padding-left:14px;position:relative}
.fc-list li::before{content:"";position:absolute;left:4px;color:var(--accent)}
.cta-card{background:var(--accent-dim);border-color:rgba(108,99,255,.35)}
.cta-card h3{color:var(--accent-hover)}

/* -- How it works -- */
.how-it-works{max-width:900px;margin:0 auto;padding:80px 24px;border-top:1px solid var(--border)}
.steps-row{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap;justify-content:center}
.step{flex:1;min-width:200px;text-align:center;padding:24px 20px;background:var(--card-bg);border:1px solid var(--border);border-radius:14px}
.step-num{width:40px;height:40px;background:var(--accent);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;margin:0 auto 14px}
.step h4{font-size:15px;font-weight:600;margin-bottom:8px}.step p{font-size:13px;color:var(--text-dim);line-height:1.6}
.step-arrow{font-size:22px;color:var(--text-muted);padding-top:36px;flex-shrink:0}

/* -- Footer -- */
.footer{border-top:1px solid var(--border);padding:48px 24px;background:var(--surface)}
.footer-inner{max-width:600px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.footer-brand{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:700}
.footer-note{font-size:13px;color:var(--text-dim)}
/* ═══ CHAT PAGE ══════════════════════════════════════════ */
.chat-body{height:100vh;overflow:hidden}
.app-wrapper{display:flex;height:100vh;overflow:hidden}

/* Sidebar */
.side-panel {
  width: 290px; min-width: 290px;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 24px 18px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.brand{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:20px}
.brand-link{display:block;border-radius:14px;transition:opacity .18s}
.brand-link:hover{opacity:0.8}
.brand-logo{
  width:52px;height:52px;
  background:linear-gradient(135deg,var(--accent),#9b59e8);
  border-radius:14px;display:flex;align-items:center;justify-content:center;
  font-size:24px;margin-bottom:12px;box-shadow:0 4px 16px var(--accent-glow);
}
.brand-name{font-size:20px;font-weight:700;letter-spacing:-.3px}
.brand-tagline{font-size:12px;color:var(--text-dim);margin-top:4px;line-height:1.5}
.divider{height:1px;background:var(--border);margin:14px 0;flex-shrink:0}
.panel-label{
  font-size:10.5px;font-weight:600;text-transform:uppercase;
  letter-spacing:0.8px;color:var(--text-muted);margin-bottom:10px;
  display:flex;align-items:center;gap:8px;
}
.feature-list{display:flex;flex-direction:column;gap:2px}
.feature-item{display:flex;align-items:flex-start;gap:10px;padding:8px;border-radius:8px;transition:background .15s}
.feature-item:hover{background:var(--surface2)}
.fi-icon{font-size:17px;flex-shrink:0;margin-top:1px}
.feature-item strong{display:block;font-size:12.5px;font-weight:600;margin-bottom:1px}
.feature-item p{font-size:11px;color:var(--text-dim);line-height:1.4}

/* API section */
.api-section{margin-top:auto;padding-top:8px}
.api-status-badge{
  display:inline-block;padding:2px 8px;border-radius:20px;
  font-size:10px;font-weight:600;
  background:rgba(245,158,11,0.15);color:var(--amber);border:1px solid rgba(245,158,11,0.3);
  text-transform:none;letter-spacing:0;
}
.api-status-badge.saved{background:rgba(34,197,94,0.12);color:var(--green);border-color:rgba(34,197,94,0.3)}
.api-input-row{display:flex;gap:6px;margin-bottom:6px}
.api-input-row input{
  flex:1;background:var(--surface2);border:1px solid var(--border);
  border-radius:6px;padding:7px 10px;font-size:12px;color:var(--text);
  font-family:inherit;outline:none;transition:border-color .18s;
}
.api-input-row input:focus{border-color:var(--accent)}
.api-input-row input::placeholder{color:var(--text-muted)}
.api-input-row button{
  background:var(--accent);color:#fff;border:none;border-radius:6px;
  padding:7px 14px;font-size:12px;font-weight:600;
  cursor:pointer;font-family:inherit;transition:background .18s;
}
.api-input-row button:hover{background:var(--accent-hover)}
.api-hint{font-size:10.5px;color:var(--text-muted);line-height:1.4}

/* Chat panel */
.chat-panel{flex:1;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}
.chat-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 20px;border-bottom:1px solid var(--border);
  flex-shrink:0;background:var(--surface);
}
.chat-header-info{display:flex;align-items:center;gap:8px}
.ch-dot{width:8px;height:8px;background:var(--green);border-radius:50%;box-shadow:0 0 6px var(--green);animation:blink 2.2s infinite}
@keyframes blink{0%,100%{opacity:1}50%{opacity:0.3}}
.ch-title{font-size:13px;font-weight:500;color:var(--text-dim)}
.chat-header-actions{display:flex;align-items:center;gap:8px}
.clear-btn{
  background:none;border:1px solid var(--border);border-radius:6px;
  color:var(--text-dim);font-size:12px;padding:5px 12px;
  cursor:pointer;font-family:inherit;transition:all .18s;
}
.clear-btn:hover{background:rgba(239,68,68,0.1);border-color:var(--red);color:var(--red)}

/* Quick actions */
.quick-actions{
  display:flex;gap:8px;padding:10px 20px;
  overflow-x:auto;flex-shrink:0;border-bottom:1px solid var(--border);
  scrollbar-width:none;
}
.quick-actions::-webkit-scrollbar{display:none}
.qa-btn{
  display:inline-flex;align-items:center;gap:5px;
  padding:6px 14px;background:var(--surface);border:1px solid var(--border);
  border-radius:20px;color:var(--text-dim);font-size:12.5px;font-weight:500;
  cursor:pointer;white-space:nowrap;transition:all .18s;font-family:inherit;
}
.qa-btn:hover{background:var(--accent-dim);border-color:var(--accent);color:var(--accent-hover)}
.qa-btn:active{transform:scale(0.97)}

/* Chat window */
.chat-window{
  flex:1;overflow-y:auto;padding:20px;
  display:flex;flex-direction:column;gap:4px;
  scrollbar-width:thin;scrollbar-color:var(--border) transparent;
}
.chat-window::-webkit-scrollbar{width:5px}
.chat-window::-webkit-scrollbar-track{background:transparent}
.chat-window::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}

.welcome-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:14px;padding:28px 24px;text-align:center;
  max-width:460px;margin:auto;
}
.wc-emoji{font-size:38px;margin-bottom:12px}
.welcome-card h2{font-size:18px;font-weight:700;margin-bottom:8px}
.welcome-card p{font-size:13.5px;color:var(--text-dim);line-height:1.65}

/* Message rows */
.msg-row{display:flex;gap:10px;align-items:flex-end;animation:fadeSlideIn .16s ease both}
@keyframes fadeSlideIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
.msg-row.user{flex-direction:row-reverse}
.msg-avatar{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;margin-bottom:18px}
.msg-row.bot .msg-avatar{background:linear-gradient(135deg,var(--accent),#9b59e8)}
.msg-row.user .msg-avatar{background:var(--surface2);border:1px solid var(--border)}
.msg-body{display:flex;flex-direction:column;max-width:72%}
.msg-row.user .msg-body{align-items:flex-end}
.msg-row.bot .msg-body{align-items:flex-start}
.msg-bubble{padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.65;word-break:break-word}
.msg-row.bot .msg-bubble{background:var(--bot-bubble);border:1px solid var(--border);border-bottom-left-radius:4px;color:var(--text)}
.msg-row.user .msg-bubble{background:var(--user-bubble);color:#fff;border-bottom-right-radius:4px}
.msg-time{font-size:10px;color:var(--text-muted);margin-top:4px;padding:0 2px}

/* Markdown */
.msg-bubble h3{font-size:14px;font-weight:600;color:var(--accent-hover);margin:10px 0 4px}
.msg-bubble h3:first-child{margin-top:0}
.msg-bubble ul,.msg-bubble ol{padding-left:18px;margin:5px 0}
.msg-bubble li{margin-bottom:3px}
.msg-bubble strong{font-weight:600}
.msg-bubble em{font-style:italic}
.msg-bubble code{background:rgba(108,99,255,.15);padding:2px 6px;border-radius:4px;font-family:'Courier New',monospace;font-size:13px}
.msg-bubble pre{background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:10px 12px;margin:8px 0;overflow-x:auto;font-size:12.5px}
.msg-bubble pre code{background:none;padding:0}
.msg-bubble hr{border:none;border-top:1px solid var(--border);margin:8px 0}
.msg-bubble p+p{margin-top:5px}

/* Typing */
.typing-indicator{display:flex;align-items:center;gap:5px;padding:12px 14px}
.typing-dot{width:7px;height:7px;background:var(--accent);border-radius:50%;animation:bounce 1.1s infinite ease-in-out}
.typing-dot:nth-child(2){animation-delay:.18s}
.typing-dot:nth-child(3){animation-delay:.36s}
@keyframes bounce{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-7px)}}

/* Input */
.input-area{padding:12px 20px 16px;flex-shrink:0;border-top:1px solid var(--border);background:var(--surface)}
.input-row{
  display:flex;gap:10px;align-items:flex-end;
  background:var(--surface2);border:1px solid var(--border);
  border-radius:14px;padding:10px 12px;
  transition:border-color .18s,box-shadow .18s;
}
.input-row:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-dim)}
#userInput{flex:1;background:none;border:none;outline:none;color:var(--text);font-family:inherit;font-size:14px;resize:none;max-height:120px;line-height:1.5}
#userInput::placeholder{color:var(--text-muted)}
.send-btn{width:36px;height:36px;background:var(--accent);border:none;border-radius:8px;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px;transition:background .18s,transform .1s}
.send-btn:hover{background:var(--accent-hover)}
.send-btn:active{transform:scale(0.93)}
.send-btn:disabled{background:var(--border);cursor:not-allowed}
.input-hint{font-size:11px;color:var(--text-muted);margin-top:7px;text-align:center}
.input-hint kbd{background:var(--surface2);border:1px solid var(--border);border-radius:3px;padding:1px 5px;font-size:10px;font-family:inherit}

/* Responsive */
@media(max-width:768px){
  .app-wrapper{flex-direction:column}
  .side-panel{width:100%;min-width:unset;border-right:none;border-bottom:1px solid var(--border);padding:12px 16px;flex-direction:row;align-items:center;gap:14px;overflow-x:auto;overflow-y:hidden}
  .brand{flex-direction:row;text-align:left;padding-bottom:0}
  .brand-logo{width:34px;height:34px;font-size:16px;margin-bottom:0}
  .brand-tagline,.divider,.panel-label,.feature-list{display:none}
  .api-section{margin-top:0;padding-top:0;min-width:200px;flex-shrink:0}
  .msg-body{max-width:88%}
  .step-arrow{display:none}
  .steps-row{flex-direction:column}
  .step{min-width:unset}
}
@media(max-width:500px){
  .hero{padding:60px 16px 50px}
  .features,.how-it-works{padding:60px 16px}
  .features-grid{grid-template-columns:1fr}
}
