/*
 * Onglet atm-chatbot (/atm-chatbot/) : l'iframe du chatbot occupe toute la hauteur
 * disponible à droite du rail de navigation.
 */

.atm-chatbot-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100vh;
  height: 100dvh;
  padding: 12px 12px 10px 0;
}

.atm-chatbot-frame-card {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
}

.atm-chatbot-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.has-code-dialog :is([data-page-shell], .atm-chatbot-footnote) {
  filter: blur(7px);
  pointer-events: none;
}

.atm-chatbot-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.atm-chatbot-loading-logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  background: var(--gradient-accent);
  border-radius: 20px;
  box-shadow: var(--glow-accent);
  color: var(--color-accent-text);
  animation: atm-chatbot-loading-pulse 1.4s ease-in-out infinite;
}

.atm-chatbot-loading-logo .icon {
  width: 30px;
  height: 30px;
}

@keyframes atm-chatbot-loading-pulse {
  50% {
    transform: scale(0.94);
    opacity: 0.8;
  }
}

.atm-chatbot-footnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0;
  padding: 0 6px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.atm-chatbot-footnote a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  text-decoration: none;
}

.atm-chatbot-footnote .icon {
  width: 14px;
  height: 14px;
}

/* Paysage : barre du haut et navigation horizontale autour de l'iframe. */
@media (max-height: 600px) and (orientation: landscape) {
  .atm-chatbot-layout {
    height: calc(100dvh - var(--mobile-header-height) - var(--mobile-tab-bar-height) - env(safe-area-inset-bottom));
    padding: 8px;
  }

  .atm-chatbot-frame-card {
    border-radius: var(--radius);
  }

  .atm-chatbot-footnote span:first-child {
    display: none;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .atm-chatbot-layout { height: 100dvh; padding: 6px 6px 6px 0; }
  .atm-chatbot-footnote { display: none; }
}
