/* ============================================================
   Cooper — BLUErabbit Support Bot
   style.css  (compiled from style.scss)
   To recompile: sass assets/css/style.scss assets/css/style.css
   ============================================================ */

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background:  #0d1117;
  color:       #e6edf3;
  display:     flex;
  flex-direction: column;
  align-items: center;
  min-height:  100vh;
}

/* ===== Layout ===== */
.container {
  width: 100%; max-width: 720px; height: 100vh;
  display: flex; flex-direction: column;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 2rem 1rem; }

/* ===== Header ===== */
.site-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid #21262d;
  background: #161b22;
  flex-shrink: 0;
}
.site-header .logo { height: 26px; width: auto; object-fit: contain; }
.site-header .header-sep { width: 1px; height: 20px; background: #21262d; margin: 0 .25rem; }
.site-header .cooper-name { font-size: .95rem; font-weight: 600; color: #e6edf3; }
.site-header .cooper-sub  { font-size: .75rem; color: #8b949e; }

/* ===== Tier badge ===== */
.tier-badge {
  margin-left: auto; font-size: .75rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 99px; display: none;
}
.tier-badge.premium { background: #7c2d12; color: #f0883e; display: inline-block; }
.tier-badge.general { background: #1c2333; color: #8b949e; display: inline-block; }

/* ===== Gate ===== */
#gate {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1.5rem; gap: 1.25rem;
}
#gate .cooper-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  overflow: hidden; box-shadow: 0 0 0 4px #1a2a4a;
}
#gate .cooper-avatar img { width: 100%; height: 100%; object-fit: cover; }
#gate h2 { font-size: 1.35rem; text-align: center; }
#gate p  { color: #8b949e; text-align: center; font-size: .95rem; line-height: 1.6; max-width: 340px; }
#gate form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: .75rem; }
#gate label { font-size: .85rem; color: #8b949e; }
#gate input[type="text"] {
  width: 100%; padding: .7rem 1rem; border-radius: 12px;
  border: 1px solid #21262d; background: #161b22; color: #e6edf3;
  font-size: 1.1rem; font-family: ui-monospace, monospace;
  letter-spacing: .15em; text-transform: lowercase; text-align: center;
  outline: none; transition: border-color .2s;
}
#gate input[type="text"]:focus { border-color: #1f6feb; }
#gate .hint { font-size: .8rem; color: #8b949e; text-align: center; }

.gate-msg { font-size: .85rem; text-align: center; padding: .5rem 1rem; border-radius: 8px; }
.gate-msg.ok  { background: #0d2818; color: #4ade80; }
.gate-msg.err { background: #2d1515; color: #f87171; }

/* ===== Buttons ===== */
.btn-primary {
  padding: .75rem 1.5rem; background: #1f6feb; color: #fff;
  border: none; border-radius: 12px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background .2s; width: 100%;
}
.btn-primary:hover    { background: #388bfd; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn { display: inline-block; padding: .5rem 1.2rem; border-radius: 6px; border: none; cursor: pointer; font-size: .9rem; font-weight: 600; }
.btn-blue   { background: #1f6feb; color: #fff; }
.btn-blue:hover { background: #388bfd; }
.btn-danger { background: #ef4444; color: #fff; font-size: .8rem; padding: .3rem .8rem; }
.btn-muted  { background: #374151; color: #d1d5db; font-size: .8rem; padding: .3rem .8rem; }

/* ===== Chat ===== */
#chat { flex: 1; display: none; flex-direction: column; overflow: hidden; }

.messages {
  flex: 1; overflow-y: auto; padding: 1.25rem;
  display: flex; flex-direction: column; gap: .75rem; scroll-behavior: smooth;
}

/* ===== Avatars ===== */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Message bubbles ===== */
.msg { display: flex; gap: .6rem; max-width: 86%; }
.msg.user      { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }

.msg.user .avatar      { background: #1f6feb; color: #fff; font-size: .7rem; font-weight: 800; }
.msg.assistant .avatar { background: linear-gradient(135deg, #1f6feb, #0d4a9e); }

.bubble { padding: .7rem 1rem; font-size: .95rem; line-height: 1.65; word-break: break-word; }
.msg.user      .bubble { background: #1f6feb; color: #fff; border-radius: 12px 12px 4px 12px; }
.msg.assistant .bubble { background: #21262d; color: #e6edf3; border-radius: 12px 12px 12px 4px; }

.bubble strong { font-weight: 700; }
.bubble em     { font-style: italic; }
.bubble code   { font-family: ui-monospace, monospace; background: rgba(255,255,255,.08); padding: .1em .4em; border-radius: 4px; font-size: .88em; }
.bubble a      { color: #388bfd; }

/* ===== Typing indicator ===== */
.typing .bubble { padding: .9rem 1rem; }
.dots { display: flex; gap: 4px; }
.dots span { width: 7px; height: 7px; background: #8b949e; border-radius: 50%; animation: bounce 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ===== Input bar ===== */
.input-bar {
  padding: .75rem 1rem; border-top: 1px solid #21262d;
  display: flex; gap: .5rem; background: #161b22; flex-shrink: 0;
}
.input-bar textarea {
  flex: 1; resize: none; padding: .6rem .9rem; border-radius: 12px;
  border: 1px solid #21262d; background: #0d1117; color: #e6edf3;
  font-size: .95rem; font-family: inherit; line-height: 1.5; max-height: 140px;
  outline: none; transition: border-color .2s; overflow-y: auto;
}
.input-bar textarea:focus { border-color: #1f6feb; }
.input-bar button {
  background: #1f6feb; border: none; border-radius: 12px; color: #fff;
  width: 42px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.input-bar button:hover    { background: #388bfd; }
.input-bar button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== Chat footer ===== */
.chat-footer {
  padding: .4rem; text-align: center; font-size: .75rem;
  color: #3d444d; border-top: 1px solid #21262d; flex-shrink: 0;
}
.chat-footer a      { color: #3d444d; text-decoration: none; }
.chat-footer a:hover { color: #8b949e; }
.chat-footer button { background: none; border: none; color: #3d444d; cursor: pointer; font-size: .75rem; }
.chat-footer button:hover { color: #8b949e; text-decoration: underline; }

/* ===== Admin — Header ===== */
.admin-header {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.4rem; margin-bottom: 1.5rem; color: #388bfd;
}
.admin-header img { height: 28px; }
.admin-header a.logout {
  margin-left: auto; font-size: .85rem; color: #8b949e; text-decoration: none; font-weight: 400;
}
.admin-header a.logout:hover { color: #ef4444; }

/* ===== Admin — Cards ===== */
.card { background: #1e2330; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; }
.card h2 { font-size: 1.05rem; margin-bottom: 1rem; color: #8b949e; }
.card p.empty { color: #64748b; }
.card-login { max-width: 360px; margin: 4rem auto; }

/* ===== Admin — Forms ===== */
label { display: block; font-size: .85rem; color: #8b949e; margin-bottom: .3rem; margin-top: .8rem; }

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%; padding: .6rem .8rem; border-radius: 6px;
  border: 1px solid #2d3748; background: #0d1117; color: #e6edf3;
  font-size: .95rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
textarea { resize: vertical; min-height: 60px; }

/* ===== Admin — Alerts ===== */
.msg-ok  { background: #064e3b; color: #6ee7b7; padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.msg-err { background: #7f1d1d; color: #fca5a5; padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }

/* ===== Admin — Table ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid #2d3748; font-size: .88rem; }
th { color: #64748b; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.actions { display: flex; gap: .4rem; }
.actions form { display: inline; }

/* ===== Admin — Badges ===== */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.badge-premium  { background: #1e40af; color: #bfdbfe; }
.badge-general  { background: #374151; color: #9ca3af; }
.badge-active   { background: #064e3b; color: #6ee7b7; }
.badge-inactive { background: #7f1d1d; color: #fca5a5; }

/* ===== Admin — Client ID chip ===== */
.client-id {
  font-family: ui-monospace, monospace; font-size: .95rem; font-weight: 700;
  color: #fbbf24; background: #1c1a0e; padding: .15rem .5rem;
  border-radius: 4px; letter-spacing: .08em; cursor: pointer;
}
.client-id:hover { background: #2d2a12; }

.url-link { font-size: .8rem; color: #64748b; }
.url-link a { color: #1f6feb; text-decoration: none; }
.url-link a:hover { text-decoration: underline; }

/* ===== Utilities ===== */
code { font-family: ui-monospace, monospace; }
