/* =========================================
   LIFT ASSISTANT - MOBILE (≤ 768px)
   Objectif : comportement type ChatGPT
   ========================================= */
@media (max-width: 768px) {
  /* On garde le comportement desktop :
     page fixe, seul le chat scrolle */
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  /* Conteneur global plein écran */
  .app-container {
    padding: 0.75rem 0.75rem 1rem;
    height: 100vh;
    max-width: 100%;
  }

  /* =========================
     HEADER
     ========================= */
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .logo-container h1 {
    font-size: 1.3rem;
    margin-bottom: 0.1rem;
  }

  .logo-container .subtitle {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
  }

  .tagline {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .language-switcher {
    align-self: stretch;
    justify-content: space-between;
  }

  .lang-btn {
    flex: 1;
    padding: 0.3rem 0;
    font-size: 0.8rem;
  }

  /* =========================
     LAYOUT PRINCIPAL
     ========================= */
  .main-content {
    grid-template-columns: 1fr; /* une seule colonne */
    gap: 0.75rem;
    flex: 1;
    min-height: 0; /* IMPORTANT : pour le scroll interne */
    overflow: hidden; /* rien ne dépasse */
  }

  /* On masque la sidebar sur mobile pour gagner de la place */
  .sidebar {
    display: none;
  }

  /* =========================
     CHAT
     ========================= */
  .chat-container {
    padding: 0.9rem;
    border-radius: 12px;
    height: 100%;
    min-height: 0; /* permet à .chat-messages de scroller */
  }

  .chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.25rem 0.25rem 0.75rem 0;
    gap: 0.75rem;
  }

  .message {
    max-width: 100%;
    font-size: 0.9rem;
    padding: 0.7rem 0.9rem;
  }

  .message-sender {
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
  }

  /* =========================
     BARRE DE SAISIE
     ========================= */
  .message-input-container {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
  }

  .input-group {
    gap: 0.5rem;
  }

  #user-input {
    font-size: 0.9rem;
    min-height: 2.7rem;
    max-height: 6.5rem;
  }

  .button-group {
    gap: 0.4rem;
  }

  .btn {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
  }
}
