
/**
 * beryllium-layout.css - WebView safe 
 * Template CSS principale de l'UI Beryllium 
 * Version: 0.2.3
 */

/* Important: html/body doivent pouvoir porter une app en fixed */
html, body {
  height: 100%;
}

/* Contexte general: l'app recouvre la fenetre (fiable en WebView) */
.oranea-beryllium-app,
#oranea-beryllium-app {
  box-sizing: border-box;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;

  background-color: var(--bery-bg);
  color: var(--bery-text-main);

  /* Evite que le theme interfere par des marges/overflow */
  margin: 0;
  padding: 0;

  z-index: 999999;
}

/* Tous les elements internes utilisent border-box */
#oranea-beryllium-app *,
#oranea-beryllium-app *::before,
#oranea-beryllium-app *::after {
  box-sizing: border-box;
}

/* Header */
.beryllium-header {
  flex: 0 0 var(--bery-header-height);
  height: var(--bery-header-height);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 8px;
  background-color: var(--bery-bg-header);
  box-shadow: var(--bery-shadow-soft);

  z-index: 10;
}

/* Header - gauche */
.beryllium-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beryllium-avatar {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background-color: #000000;
  flex: 0 0 auto;
  border: none;
  padding: 0;
  cursor: pointer;
}

.beryllium-avatar-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.beryllium-title {
  font-size: 14px;
  font-weight: 600;
}

/* Header - droite */
.beryllium-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.beryllium-header-button {
  border: none;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  border-radius: 999px;
}

.beryllium-header-button:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

#oranea-beryllium-app[data-theme="dark"] .beryllium-header-button:hover {
  background-color: rgba(255, 255, 255, 0.07);
}

/* Icones de header plus visibles */
.beryllium-icon-theme,
.beryllium-icon-speed {
  font-size: 18px;
}

/* Zone centrale: thread doit prendre toute la place restante */
.beryllium-thread {
  flex: 1 1 auto;

  /* CRUCIAL: sinon en WebView, le flex enfant peut s'effondrer */
  min-height: 0;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding: var(--bery-thread-padding-y) var(--bery-thread-padding-x);
  scroll-behavior: smooth;

  background-color: var(--bery-bg);
}

/* Message d'ouverture */
.beryllium-opening-message {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--bery-text-muted);
}

/* Composer */
.beryllium-composer {
  flex: 0 0 auto;

  padding: 8px;
  background-color: var(--bery-bg-composer);
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.08);

  z-index: 10;
}

.beryllium-composer-inner {
  display: flex;
  align-items: stretch;
  gap: 8px;

  background-color: var(--bery-bg-elevated);
  border-radius: var(--bery-radius-pill);
  padding: 4px 8px;

  --bery-composer-control-size: 40px;
}


.beryllium-input {
  flex: 1 1 auto;
  align-self: stretch;

  min-height: var(--bery-composer-height-min);
  max-height: var(--bery-composer-height-max);

  resize: none;
  border-radius: 14px; /* au lieu de var(--bery-radius-pill); */
  padding: 6px 14px;
  border: none;
  font-size: 14px;
  line-height: 1.4;

  background-color: transparent;
  color: var(--bery-text-main);

  display: block;
}


.beryllium-input::placeholder {
  color: var(--bery-text-muted);
}

.beryllium-composer-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  align-self: stretch;
  padding-bottom: 30px;
}

.beryllium-composer-button {
  width: var(--bery-composer-height-min);
  height: var(--bery-composer-height-min);

  border-radius: 999px;
  border: none;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: var(--bery-user-bubble-bg);
  color: var(--bery-user-bubble-text);

  cursor: pointer;

  flex-shrink: 0;       /* TRÈS IMPORTANT : empêche tout écrasement */
}

.beryllium-mic {
  background-image: url("/wp-content/mu-plugins/oranea-chatbot/beryllium/public/assets/media/beryllium-micro.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 55%;   /* ajuste si besoin : 50–65% */
}

/* État initial : micro visible, envoyer caché (JS bascule ensuite) */
.beryllium-mic {
  display: flex;
}

.beryllium-send {
  display: none;
}


.beryllium-composer-button:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

#oranea-beryllium-app[data-theme="dark"] .beryllium-composer-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

#oranea-beryllium-app[data-theme="light"] .beryllium-send:hover {
  color: #004d40;  /* flèche plus sombre sur fond clair */
}


/* Couleurs pour micro / envoyer */
.beryllium-mic,
.beryllium-send {
  background-color: var(--bery-user-bubble-bg);
  color: var(--bery-user-bubble-text);
}

/* Indicateur "Oranea réfléchit" intégré au fil */
.beryllium-thinking-row {
  display: flex;
  justify-content: center;   /* centré dans la zone de lecture */
  padding: 8px 0 4px;
}

.beryllium-thinking-row .beryllium-thinking {
  display: flex;
  align-items: center;
  gap: 4px;
}


/* Menu contextuel */
.beryllium-menu {
  position: absolute;
  right: 8px;
  top: calc(var(--bery-header-height) + 4px);

  background-color: var(--bery-bg-elevated);
  box-shadow: var(--bery-shadow-soft);
  border-radius: 8px;

  padding: 4px 0;
  min-width: 200px;
  z-index: 20;
}

.beryllium-menu button {
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.beryllium-menu button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#oranea-beryllium-app[data-theme="dark"] .beryllium-menu button:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
