/* ===========================
   Fondamental-App - global.css
   Styles globaux réutilisables
   =========================== */

/* ----- Reset léger ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
    sans-serif;
  background: #050814;
  color: #e5f0ff;
  line-height: 1.5;
}

/* ----- Variables ----- */
:root {
  --color-bg: #050814;
  --color-bg-elevated: #0b1020;
  --color-surface: #10172a;
  --color-surface-soft: #101827;
  --color-border-subtle: rgba(148, 163, 184, 0.2);

  --color-primary: #3ba9ff;
  --color-primary-soft: rgba(59, 169, 255, 0.15);
  --color-primary-strong: #1c8de0;

  --color-accent: #4df4ff;
  --color-accent-soft: rgba(77, 244, 255, 0.18);

  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-danger: #f97373;

  --color-text-main: #e5f0ff;
  --color-text-muted: #94a3b8;
  --color-text-soft: #64748b;

  --radius-lg: 1.25rem;
  --radius-md: 0.9rem;
  --radius-pill: 999px;

  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
  --shadow-glow-primary: 0 0 25px rgba(59, 169, 255, 0.6);
  --shadow-glow-accent: 0 0 25px rgba(77, 244, 255, 0.5);

  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;

  --max-width: 1200px;
}

/* ----- Liens, textes ----- */
a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  color: var(--color-text-muted);
}

/* ----- Layouts généraux ----- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
}

/* ----- Header global ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: radial-gradient(circle at top left, #172554 0, #020617 55%);
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.85);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.logo span {
  color: var(--color-accent);
}

.logo-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-soft);
}

/* ----- Navigation ----- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  transition: background-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-text-main);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.nav-link--cta {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #020617;
  font-weight: 600;
  box-shadow: var(--shadow-glow-primary);
}

.nav-link--cta:hover {
  box-shadow: 0 0 30px rgba(59, 169, 255, 0.8);
  transform: translateY(-1px) scale(1.01);
}

/* Icône gestion */
.nav-link--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-link--icon span.icon {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* ----- Sections globales ----- */
.section {
  padding: 3.5rem 0;
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* ---- Cartes génériques ---- */
.card {
  background: radial-gradient(circle at top left, #1e293b 0, #020617 70%);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top, rgba(59, 169, 255, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: rgba(148, 163, 184, 0.45);
}

/* ---- Grilles réutilisables ---- */
.grid {
  display: grid;
  gap: 1.2rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ---- Boutons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast),
    box-shadow var(--transition-fast), transform var(--transition-fast),
    color var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #020617;
  font-weight: 600;
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 28px rgba(59, 169, 255, 0.8);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.75);
  color: var(--color-text-main);
}

/* ---- Badges / tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-soft);
}

/* ---- Mascotte robot globale ---- */

.assistant-robot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.assistant-robot-avatar {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #1e40af, #020617);
  box-shadow: 0 0 40px rgba(59, 169, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.assistant-robot-avatar img {
  max-width: 80%;
  height: auto;
  display: block;
}

/* cercle de glow */
.assistant-robot-avatar::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: inherit;
  border: 1px solid rgba(148, 163, 184, 0.3);
  pointer-events: none;
}

/* Bulle de texte générique */
.assistant-bubble {
  max-width: 260px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), #020617);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.9);
  font-size: 0.9rem;
}

.assistant-bubble strong {
  color: var(--color-accent);
}

/* petite pointe de bulle */
.assistant-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 40px;
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

/* Wrapper position relative pour la pointe */
.assistant-robot-bubble-wrapper {
  position: relative;
}

/* ---- Footer ---- */

.site-footer {
  padding: 1.6rem 0 2rem;
  border-top: 1px solid var(--color-border-subtle);
  background: radial-gradient(circle at bottom, #020617 0, #020617 55%);
  color: var(--color-text-soft);
  font-size: 0.85rem;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.footer-links a {
  color: var(--color-text-soft);
}

.footer-links a:hover {
  color: var(--color-text-main);
}

/* ---- Helpers / utilitaires ---- */

.text-muted {
  color: var(--color-text-soft);
}

.mt-sm {
  margin-top: 0.75rem;
}

.mt-md {
  margin-top: 1.3rem;
}

.mt-lg {
  margin-top: 2rem;
}

/* Responsive */

@media (max-width: 900px) {
  .site-header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ---------------------------------------------------------
   HEADER V2 — Fondamental-App (compact + mobile-first)
---------------------------------------------------------- */

.app-header {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(90deg, #0a0c21, #0d102d);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

/* --- Bloc gauche (logo + titre) --- */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Icône IA (logo) */
.logo-ia {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-block;
    background: radial-gradient(circle at 50% 45%, #3cf2ff, #007bff);
    box-shadow: 0 0 12px rgba(0, 191, 255, 0.7);
}

/* Titre */
.site-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #dff7ff;
}

/* --- Bloc droit (hamburger + roue) --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger */
.hamburger-btn {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #c7f3ff;
    cursor: pointer;
    padding: 5px;
}

.hamburger-btn:hover {
    color: #74e2ff;
}

/* Roue crantée */
.settings-btn {
    font-size: 1.5rem;
    color: #c7f3ff;
    text-decoration: none;
}

/* --- Menu mobile latéral --- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -260px;
    width: 260px;
    height: 100vh;
    background: #0d1028;
    box-shadow: -5px 0 10px rgba(0,0,0,0.4);
    padding: 30px 20px;
    transition: right .3s ease;
    z-index: 1000;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu li {
    margin-bottom: 20px;
}

.mobile-menu a {
    color: #bdefff;
    font-size: 1.1rem;
    text-decoration: none;
}

.mobile-menu a:hover {
    color: #66d9ff;
}

/* --- Version mobile : réduire la hauteur du header --- */
@media(max-width: 600px) {
    .site-title {
        font-size: 1rem;
    }
    .app-header {
        padding: 8px 12px;
    }
    .logo-ia {
        width: 32px;
        height: 32px;
    }
}
/* test ajout ifram table */
.module-tester {
    padding: 20px;
    max-width: 1000px;
    margin: auto;
}
