/* ══════════════════════════════════════════════════════════════
   apibot.css — APIbot ChoKInfO
   ══════════════════════════════════════════════════════════════ */

/* ══ TOKENS ══════════════════════════════════════════════════ */
:root {
  --p-base:    #2e22ee;
  --p-dark:    #1e11e3;
  --p-light:   #e9e8fd;
  --p-hover:   #bebbf9;
  --bg-body:   #ffffff;
  --bg-dark:   #333333;
  --bg-grey80: #4d4d4d;
  --text-body: #333333;
  --text-muted:#666666;
  --font-head: 'Oswald', sans-serif;
  --font-body: 'Roboto', 'Open Sans', sans-serif;
  --radius:    8px;
  --trans:     0.28s cubic-bezier(.4,0,.2,1);
  --cyan:      #00bcd4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--p-base); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ══ NAVBAR ══════════════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2.5px solid var(--p-base);
  transition: box-shadow var(--trans);
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(46,34,238,0.13); }

.navbar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.navbar-logo img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--p-base); }
.navbar-logo span {
  font-family: var(--font-head); font-weight: 600; font-size: 1.1rem;
  color: var(--p-base); letter-spacing: .06em;
}

.navbar-title {
  font-family: var(--font-head); font-size: .8rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: .2em; text-transform: uppercase;
  flex: 1; text-align: center;
}

.hamburger {
  background: var(--p-base); border: none; border-radius: 7px;
  padding: 9px 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px;
  transition: background var(--trans); flex-shrink: 0;
  position: relative; z-index: 201;
}
.hamburger:hover { background: var(--p-dark); }
.hamburger .bar { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform var(--trans), opacity var(--trans); }
.hamburger.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .bar:nth-child(2) { opacity: 0; }
.hamburger.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══ SIDEBAR ═════════════════════════════════════════════════ */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 198; opacity: 0; pointer-events: none; transition: opacity var(--trans);
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100%;
  background: var(--bg-dark); z-index: 199;
  display: flex; flex-direction: column;
  padding: 76px 0 32px;
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: 2px 0 18px rgba(0,0,0,0.3);
}
.sidebar.active { transform: translateX(0); }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  display: block; padding: 14px 24px;
  color: #fff; font-size: 1.05rem; font-weight: 400;
  transition: background var(--trans), padding-left var(--trans);
}
.sidebar nav a:hover { background: var(--cyan); border-radius: 0 8px 8px 0; padding-left: 32px; }
.sidebar-footer {
  margin-top: auto; padding: 18px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: .78rem; color: rgba(255,255,255,.45);
}
.sidebar-notez {
  display: block; margin: 0 0 6px;
  padding: 14px 24px;
  background: var(--p-base); color: #fff;
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
  border: none; cursor: pointer; text-align: left;
  transition: background var(--trans), padding-left var(--trans);
  border-radius: 0 8px 8px 0;
}
.sidebar-notez:hover { background: var(--p-dark); padding-left: 32px; color: #fff; }

/* ══ HERO ════════════════════════════════════════════════════ */
.apibot-hero {
  position: relative;
  padding: 110px 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.52), rgba(0,0,0,0.52)),
    url('images/Fond ChoKInfO-3-ecrans-002.jpg') center/cover no-repeat;
}
.apibot-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(46,34,238,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.apibot-hero-inner {
  position: relative; z-index: 2;
  max-width: 560px; width: 100%;
}
.apibot-logo {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: contain;
  border: 3px solid rgba(0,188,212,0.55);
  background: rgba(46,34,238,0.18);
  margin: 0 auto 22px;
  animation: apibotPop .7s .1s both;
  box-shadow: 0 0 32px rgba(0,188,212,0.25);
}
.apibot-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  line-height: 1.1;
  animation: apibotFadeUp .75s .2s both;
}
.apibot-hero h1 span { color: var(--cyan); }
.apibot-hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.78);
  line-height: 1.7;
  margin: 14px auto 28px;
  animation: apibotFadeUp .75s .35s both;
}
.apibot-disclaimer {
  display: inline-block;
  font-size: .78rem;
  color: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 5px 14px;
  animation: apibotFadeUp .75s .5s both;
}

@keyframes apibotFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes apibotPop {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ══ CHAT ════════════════════════════════════════════════════ */
.apibot-chat-section {
  flex: 1;
  background: #f7f7fd;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.apibot-chat-wrapper {
  width: 100%;
  max-width: 680px;
  background: #1a1a2e;
  border-radius: 20px;
  box-shadow: 0 12px 50px rgba(46,34,238,0.22), 0 0 0 1px rgba(0,188,212,0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  border: 1px solid rgba(0,188,212,0.18);
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
  border-bottom: 1px solid rgba(0,188,212,0.18);
  flex-shrink: 0;
}
.chat-header img {
  width: 40px; height: 40px;
  border-radius: 50%; object-fit: contain;
  border: 2px solid rgba(0,188,212,0.4);
  background: rgba(46,34,238,0.15);
}
.chat-header-info { flex: 1; }
.chat-header-name {
  font-family: var(--font-head);
  font-size: 1rem; font-weight: 700;
  color: var(--cyan); letter-spacing: .08em; text-transform: uppercase;
}
.chat-header-sub { font-size: .75rem; color: rgba(255,255,255,.4); margin-top: 1px; }
.chat-header-status {
  font-size: .75rem; color: #7fff9a;
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
.chat-header-status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #7fff9a; box-shadow: 0 0 6px #7fff9a;
  display: inline-block; flex-shrink: 0;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
  min-height: 320px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,188,212,0.2); border-radius: 2px; }

.chat-msg { display: flex; gap: 10px; align-items: flex-end; animation: chatFadeIn .2s ease; }
@keyframes chatFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.chat-msg.user { flex-direction: row-reverse; }

.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: contain;
  flex-shrink: 0; border: 1.5px solid rgba(0,188,212,0.3);
  background: rgba(46,34,238,0.12);
}
.chat-msg.user .chat-msg-avatar { display: none; }

.chat-msg-bubble {
  max-width: 76%;
  padding: 11px 16px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.6;
  color: #e8e8f0; word-break: break-word;
}
.chat-msg.bot .chat-msg-bubble {
  background: rgba(46,34,238,0.18);
  border: 1px solid rgba(0,188,212,0.15);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, #2e22ee, #1e11e3);
  color: #fff; font-weight: 500;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 14px rgba(46,34,238,0.4);
}
.chat-msg-bubble a { color: var(--cyan); text-decoration: underline; }
.chat-msg.user .chat-msg-bubble a { color: #a8d8ff; }
.chat-msg-bubble strong { font-weight: 700; color: var(--cyan); }
.chat-msg.user .chat-msg-bubble strong { color: #fff; }
.chat-msg-bubble em { font-style: italic; opacity: .85; }

.chat-typing { display: flex; align-items: center; gap: 5px; padding: 11px 16px; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(0,188,212,0.65);
  animation: chatBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatBounce {
  0%,80%,100% { transform: translateY(0); opacity:.45; }
  40%          { transform: translateY(-6px); opacity:1; }
}

.chat-suggestions {
  padding: 0 18px 12px;
  display: flex; flex-wrap: wrap; gap: 7px;
}
.chat-suggest {
  background: rgba(0,188,212,0.08);
  border: 1px solid rgba(0,188,212,0.28);
  color: var(--cyan); border-radius: 20px;
  padding: 6px 14px; font-size: .8rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.chat-suggest:hover { background: rgba(0,188,212,0.2); border-color: rgba(0,188,212,.55); color: #fff; }

.chat-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(0,188,212,0.12);
  display: flex; gap: 10px; align-items: flex-end;
  background: #0f0f1e; flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: rgba(46,34,238,0.12);
  border: 1px solid rgba(0,188,212,0.22);
  border-radius: 12px;
  color: #e8e8f0; font-size: 14px; font-family: var(--font-body);
  padding: 11px 16px;
  resize: none; max-height: 110px; min-height: 44px; line-height: 1.45;
  transition: border-color .15s; outline: none;
}
.chat-input:focus { border-color: rgba(0,188,212,.55); }
.chat-input::placeholder { color: rgba(255,255,255,.22); }

.chat-send {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #2e22ee, #00bcd4);
  border: none; color: #fff; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 2px 14px rgba(46,34,238,0.4);
}
.chat-send:hover { opacity: .88; }
.chat-send:active { transform: scale(.93); }
.chat-send:disabled { opacity: .3; cursor: not-allowed; }

.chat-powered {
  text-align: center; font-size: .72rem;
  color: rgba(255,255,255,.15); padding: 0 0 10px;
  letter-spacing: .04em;
}

/* ══ FOOTER ══════════════════════════════════════════════════ */
footer { background: var(--bg-grey80); padding: 32px 20px 20px; }
.footer-inner { max-width: 1140px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 2px 0; justify-content: center; margin-bottom: 18px; }
.footer-links a { color: #fff; font-size: .82rem; padding: 4px 9px; transition: color var(--trans); white-space: nowrap; }
.footer-links a:hover { color: var(--p-hover); }
.footer-links span { color: rgba(255,255,255,.3); line-height: 1.8; font-size: .8rem; padding: 0 2px; }
.footer-up {
  display: inline-block; margin: 8px auto 0;
  padding: 8px 32px; background: var(--p-base); color: #fff;
  border-radius: 4px; font-family: var(--font-head);
  font-size: .85rem; font-weight: 600; letter-spacing: .1em;
  transition: background var(--trans), transform var(--trans);
}
.footer-up:hover { background: var(--p-dark); transform: translateY(-2px); }
.footer-credit { margin-top: 14px; font-size: .78rem; color: rgba(255,255,255,.45); }
.footer-credit a { color: rgba(255,255,255,.65); transition: color var(--trans); }
.footer-credit a:hover { color: #fff; }

/* ══ REVEAL ══════════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ══ RESPONSIVE ══════════════════════════════════════════════ */
@media (max-width: 767px) {
  .navbar { height: 56px; padding: 0 14px; }
  .navbar-logo img { width: 32px; height: 32px; }
  .navbar-logo span { font-size: 1rem; }
  .apibot-hero { padding: 86px 16px 44px; }
  .apibot-logo { width: 76px; height: 76px; }
  .apibot-chat-section { padding: 24px 12px 48px; }
  .apibot-chat-wrapper { min-height: 460px; }
  .chat-messages { min-height: 260px; }
}

/* ══ DARK MODE ═══════════════════════════════════════════════ */
html.dark {
  --bg-body:   #121222;
  --bg-grey80: #0a0a18;
  --text-body: #ddddf5;
  --text-muted:#9898c0;
  --p-light:   rgba(46,34,238,0.18);
  --p-hover:   #9b96f7;
}
html.dark .navbar {
  background: rgba(18,18,34,0.96);
  border-bottom-color: rgba(46,34,238,0.5);
}
html.dark .navbar-logo span { color: #c5c0ff; }
html.dark .navbar-title { color: #9898c0; }
html.dark .apibot-chat-section { background: #0e0e22; }
html, body, .navbar, .apibot-chat-section, footer {
  transition: background-color .35s ease, color .25s ease, border-color .35s ease;
}

/* ══ Styles extraits des attributs inline ══ */
.hero-brand { color: #fff; }
