/* =====================================================
   BLUUPI — FEUILLE COMMUNE (CLEAN)
   Fichier : commun.css
   Objectif :
   - Mobile : plein écran (anti flottant iPhone)
   - Tablette : format tablette
   - PC : format tablette (temporaire)
===================================================== */

/* =====================================================
   PALETTE & VARIABLES
===================================================== */
:root {
  --bluupi-navy: #0E3E61;
  --bluupi-blue: #127194;
  --bluupi-light: #3CA6D6;
  --bluupi-cyan: #5CD6F4;
  --bluupi-gray-light: #E6EEF2;
  --bluupi-gray-dark: #4B5A68;
  --bluupi-white: #FFFFFF;

  /* iOS safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* viewport height fiable */
  --app-h: 100vh;
}

@supports (height: 100dvh) {
  :root { --app-h: 100dvh; }
}

/* =====================================================
   RESET & BASE
===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;

  background: radial-gradient(
    circle at 50% 10%,
    var(--bluupi-blue) 0%,
    var(--bluupi-navy) 40%,
    #020B1F 100%
  );

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color: var(--bluupi-white);
  -webkit-text-size-adjust: 100%;
}

/* =====================================================
   CONTENEUR PRINCIPAL — .app (RÉFÉRENCE)
===================================================== */
.app {
  display: flex;
  flex-direction: column;
  height: var(--app-h);
  overflow: hidden;
}

/* =====================================================
   STRUCTURE INTERNE
===================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 110px; /* place input */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

/* =====================================================
   TYPO & UI
===================================================== */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--bluupi-white);
}

p {
  line-height: 1.4;
}

.btn-primary {
  background: var(--bluupi-cyan);
  color: var(--bluupi-navy);
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary,
.btn-ghost {
  background: transparent;
  color: var(--bluupi-white);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #c9ddff;
  text-decoration: none;
  opacity: 0.9;
}

/* =====================================================
   📱 MOBILE — PLEIN ÉCRAN
===================================================== */
@media (max-width: 767px) {

  body {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .app {
    width: 100%;
    height: var(--app-h);
    border-radius: 0;
    box-shadow: none;
  }
}

/* =====================================================
   📲 TABLETTE + 💻 PC — FORMAT TABLETTE
===================================================== */
@media (min-width: 768px) {

  body {
    padding: 18px;
    align-items: center;
    justify-content: center;
  }

  .app {
    width: min(920px, 96vw);
    height: min(1050px, 96vh);
    border-radius: 22px;
    box-shadow: 0 14px 44px rgba(0,0,0,.28);
    overflow: hidden;
  }
}

/* =====================================================
   (OPTIONNEL) .app-frame
   — uniquement si tu l’utilises ailleurs
===================================================== */
.app-frame {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* 🔒 FORCE LAYOUT POUR MANUAL VIEW */
.app.manual-view{
  width: min(920px, 96vw);
  height: min(1050px, 96vh);
  border-radius: 22px;
  box-shadow: 0 14px 44px rgba(0,0,0,.28);
}
/* =========================================================
   COMPOSER ( + / trombone DANS la barre d'écriture )
   - commun.css : composant commun (app assistant, etc.)
========================================================= */

.composer{
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.composer .text-input{
  width: 100%;
  padding-left: 52px; /* place pour le + */
}

/* bouton + (Bluupi blue) */
.attach-btn{
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(92,214,244,.40);
  background: rgba(92,214,244,.22);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.attach-btn:hover{
  background: rgba(92,214,244,.32);
}

/* Menu caché par défaut */
.attach-menu{
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);   /* juste au-dessus de la barre */
  background: rgba(8,31,51,0.96);
  border: 1px solid rgba(230,238,242,0.14);
  border-radius: 14px;
  padding: 8px;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  z-index: 9999;

  display: none;              /* ✅ caché par défaut */
}

/* ✅ visible uniquement quand on ajoute .open */
.attach-menu.open{
  display: flex;
}


