/***************************************************************
 * General Styles
 ***************************************************************/
html, body {
  background-color: #2B2A33;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

.deal { background-color: #00ffdd; }

:root {
  --sidebar-width: 320px;     /* 240–320px selon préférence */
  --navbar-height: 56px;      /* hauteur navbar (md+) */
}

/* Layout wrapper sous la navbar sticky */
.app-layout > .d-flex {
  min-height: calc(100vh - var(--navbar-height));
  align-items: flex-start;  /* nécessaire pour sticky dans un flex */
}

/***************************************************************
 * Modern Navbar (verre, shrink, animations douces)
 ***************************************************************/
.modern-nav {
  background: rgba(10, 10, 10, 0.78) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: padding .25s ease, background-color .25s ease, box-shadow .25s ease;
  padding-top: .55rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Shrink auto (class ajoutée par JS) */
.js-shrink-nav.is-shrunk {
  padding-top: .2rem;
  padding-bottom: .2rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* Logo */
.navbar .nav-logo {
  height: 40px;
  transition: height .22s ease, transform .22s ease;
  box-shadow: 0 8px 25px rgba(0, 180, 255, 0.35);
  border-radius: 50%;
}
.js-shrink-nav.is-shrunk .nav-logo { height: 28px; }

/* Brand */
.brand-link .brand-text {
  font-weight: 600;
  letter-spacing: .2px;
  transition: opacity .22s ease, transform .22s ease;
}
.js-shrink-nav.is-shrunk .brand-link .brand-text {
  opacity: .95;
  transform: translateY(-1px);
}

/* Titre d’essai */
.trial-pill {
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  color: #222;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  white-space: nowrap;
}

/* Horloge */
.nav-clock-modern { opacity: .85; }
.nav-clock-modern:hover { opacity: 1; }

/* Avatar initial */
.avatar-pill {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f6feb, #3fb950);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  user-select: none;
}

/* Animations de collapse propres (mobile) */
@media (max-width: 767.98px) {
  .modern-nav .dual-collapse.collapse {
    transition: transform .22s ease, opacity .22s ease;
    transform-origin: top;
  }
  .modern-nav .dual-collapse.collapsing {
    height: auto !important;
    overflow: hidden;
    transform: scaleY(.98);
    opacity: 0;
  }
  .modern-nav .dual-collapse.collapse.show {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Accessibilité mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .modern-nav,
  .navbar .nav-logo,
  .brand-link .brand-text,
  .modern-nav .dual-collapse.collapse {
    transition: none !important;
  }
}

/***************************************************************
 * Navbar (héritage : couleurs & hover)
 ***************************************************************/
.navbar.sticky-top { z-index: 1050; } /* toujours au-dessus de la sidebar */

.navbar-brand {
  padding-top: .75rem;
  padding-bottom: .75rem;
  font-size: .75rem;
  background-color: #2B2A33;
  box-shadow: 0 4px 6px rgba(0,0,0,.1);
  margin: .5rem;
}

.brand-link { font-size: 1.25rem; font-weight: 600; }

.navbar {
  background-color: #2B2A33 !important;
  box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

/* Hovers */
.nav-link:hover { background-color: #525252 !important; }
.nav-link .fa { transition: transform 1s; }
.nav-link:hover .fa { transform: rotate(360deg); }

/* Variante “trial-pill” héritée (garde si utilisée ailleurs) */
.trial-pill {
  background: linear-gradient(135deg, #ffc107, #ffca2c);
  color: #212529;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 500;
  display: flex; align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/***************************************************************
 * Login / Form
 ***************************************************************/
.form-signin {
  width: 100%;
  max-width: 480px;
  padding: 15px;
  margin: auto;
}
.form-floating { margin: auto; color:#2B2A33; }
.form-signin .checkbox { font-weight: 400; }
.form-signin .form-floating:focus-within { z-index: 2; }

/***************************************************************
 * Labels / Couleurs / Boutons ifm
 ***************************************************************/
label.form-label.labelsetting,
label.form-label.labelsetting.required { color: #00ffdd; }

.spinner-border.text-warning { color: #00ffdd; }

.color_ifm { color: #0037ff; }
.border_ifm { border-bottom: 1px solid #0037ff; border-top: 1px solid #0037ff; }

.btn_ifm {
  margin-top: 20px;
  color: #fff;
  background-color: #1720d4;
  font-size: 32px;
}
.btn_ifm:hover {
  background-color: #5eaef0;
}

/***************************************************************
 * Inputs - supprime les spinners numériques
 ***************************************************************/
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input::-o-inner-spin-button,
input::-o-outer-spin-button { -o-appearance: none; margin: 0; }

/***************************************************************
 * Boîtes / Modals / Spinners
 ***************************************************************/
.boxmetadata{
  opacity: .5;
  font-size: 16px;
  margin-top: 5px;
  margin-left: 100px;
  background-color:#0f172a;
  color: #00ffdd;
}

.modal-content { background-color: #212121; }

.rawdata-spinner-text,
.page-spinner-text { color: #00ffdd; font-size: large; }

.rawdata-spinner,
.page-spinner { width: 5rem; height: 5rem; color: #00ffdd; }

/***************************************************************
 * Page Title
 ***************************************************************/
.page-title {
  font-weight: 600;
  margin: 10px 0;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: .5px;
}

/***************************************************************
 * Sidebar (Desktop) — sticky + collapsed
 ***************************************************************/
.sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  position: sticky;
  top: var(--navbar-height);
  align-self: flex-start;
  height: calc(100vh - var(--navbar-height));
  overflow: auto;
  background-color: #0b1220;
  border-right: 1px solid rgba(147,197,253,0.15);
  padding: .75rem;
  z-index: 1020;
  transition: width .25s ease;   /* desktop uniquement */
  overflow-x: hidden;
  white-space: nowrap;
}

/* État collapsed (desktop) */
.sidebar.collapsed {
  width: 90px;
  flex: 0 0 90px;
}
.sidebar.collapsed #sidebarToggle { align-self: center; }
.sidebar.collapsed ul.nav { padding: 0; margin: 0; }

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed span.ms-2,
.sidebar.collapsed hr,
.sidebar.collapsed .dropdown,
.sidebar.collapsed .btn.dropdown-toggle { display: none !important; }

.sidebar.collapsed > .sidebar-section {
  background: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Esthétique liens */
.sidebar-title {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #93c5fd;
  margin: .5rem .25rem .25rem;
}
.sidebar .nav-link {
  color: #cbd5e1;
  border-radius: 8px;
  padding: .5rem .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar .nav-link:hover { background: rgba(147,197,253,0.08); color: #fff; }
.sidebar .nav-link i { font-size: 1.1rem; }
.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(147,197,253,.15), rgba(59,130,246,.10));
  color: #93c5fd;
}

/* Sections */
.sidebar > .sidebar-section {
  flex-shrink: 0;
  margin: 1rem;
  padding: .75rem .5rem;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Header */
.sidebar-header {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: .5rem;
}

/* User pill */
.user-pill {
  background: rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  color: #fff;
  cursor: default;
  transition: background .2s ease;
}
.user-pill:hover { background: rgba(255,255,255,0.15); }

/* Avatar */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6f42c1, #0dcaf0);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .9rem; color: #fff;
}

/* Username */
.user-name { white-space: nowrap; }
.sidebar.collapsed .user-name { display: none; }

/* Scrollbars (WebKit) */
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(147,197,253,0.35); border-radius: 8px; }

/* Tooltips */
.tooltip-inner {
  background-color: #0b1220;
  color: #93c5fd;
  font-size: .85rem;
  font-weight: 500;
  padding: .35rem .6rem;
  border-radius: 8px;
}
.tooltip.bs-tooltip-end .tooltip-arrow::before { border-right-color: #0b1220; }

/***************************************************************
 * Content Area
 ***************************************************************/
.content-area {
  background: #020617;
  flex: 1 1 auto;
  padding: 1rem;
  overflow-x: auto;
  overflow-y: auto;
  min-width: 0;
  min-height: calc(100vh - 56px);
  transition: margin-left .25s ease;
}

/***************************************************************
 * Cookies (bouton flottant + modal)
 ***************************************************************/
.cookie-floating-btn {
  position: fixed;
  bottom: 1rem; right: 1rem;
  width: min(56px, 3.8vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: min(22px, 1.6vw);
  line-height: 1;
  background: #0037ff;
  color: #4e342e;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  z-index: 2000;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.cookie-floating-btn:hover { transform: scale(1.1); box-shadow: 0 16px 32px rgba(0,0,0,.4); }
@media (max-width: 576px) {
  .cookie-floating-btn { right: .75rem; bottom: .75rem; }
}

.cookie-modal {
  border-radius: 22px !important;
  background: #1e1e1e;
  color: #fff;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  padding: 10px 6px;
}
.cookie-text { font-size: 1.05rem; line-height: 1.5; color: #ddd; }
.cookie-divider { border-color: rgba(255,255,255,0.2); width: 80%; margin: 15px auto; }
.cookie-purpose {
  background: rgba(255,255,255,0.05);
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
}
#btn-cookie-accept:hover { background: #28c76f; transform: scale(1.03); transition: .15s; }
#btn-cookie-decline:hover { transform: scale(1.03); transition: .15s; }

/***************************************************************
 * Footer
 ***************************************************************/
.footer-ifm { font-size: .9rem; }
.footer-col { margin-bottom: .25rem; text-align: start; }
.footer-title {
  min-height: 1rem; display: flex; align-items: center;
  font-size: .75rem; letter-spacing: .08em; color: #9ca3af;
  margin-bottom: .6rem; text-transform: uppercase;
}
.border_avicenne { border-bottom: 1px solid #0037ff; border-top: 1px solid #0037ff; }
.certification-title { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.cert-icon { width: 12px; height: 12px; flex-shrink: 0; }
.badge-img {
  max-width: 50px; width:50%; height: auto; object-fit: contain; margin-top: .25rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.badge-img:hover { transform: scale(1.05); }
.footer-link { color: #e5e7eb; text-decoration: none; font-size: .85rem; }
.footer-link:hover { text-decoration: underline; }

/***************************************************************
 * Off-canvas Sidebar (Mobile)
 ***************************************************************/
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;                       /* au-dessus du contenu */
    top: var(--navbar-height);             /* sous la navbar sticky */
    left: 0;
    height: calc(100vh - var(--navbar-height));
    width: min(84vw, var(--sidebar-width));/* responsive, jusqu’à 320px max */
    max-width: 320px;
    background-color: #0b1220;
    border-right: 1px solid rgba(147, 197, 253, 0.15);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);          /* cachée par défaut */
    transition: transform .25s ease;       /* on anime seulement transform */
    z-index: 1040;                         /* sous la navbar (1050) */
  }

  .sidebar.open { transform: translateX(0); }

  /* On ignore collapsed en mobile */
  .sidebar.collapsed { width: auto; flex: none; }

  /* Backdrop */
  .app-backdrop {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: var(--navbar-height);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1035;
    display: none;
  }
  .app-backdrop.show { display: block; }

  /* Optimisation perf */
  .sidebar { will-change: transform; }

  /* Le contenu reste en place */
  .content-area { padding-top: .25rem; }
}

/* iOS safe areas */
@supports (padding: env(safe-area-inset-top)) {
  .navbar.sticky-top { padding-top: env(safe-area-inset-top); }
  @media (max-width: 991.98px) {
    .sidebar { top: calc(var(--navbar-height) + env(safe-area-inset-top)); }
    .app-backdrop { top: calc(var(--navbar-height) + env(safe-area-inset-top)); }
  }
}
/* Mobile off-canvas */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    width: min(84vw, var(--sidebar-width));
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    background: #0b1220;
    z-index: 1040;
  }
  .sidebar.open { transform: translateX(0); }

  .app-backdrop {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: var(--navbar-height);
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    z-index: 1035;
    display: none;
  }
  .app-backdrop.show { display: block; }

  .sidebar { will-change: transform; transition-property: transform; }

  /* ignore collapsed visual mode in mobile */
  .sidebar.collapsed { width: auto; flex: none; }
}
/* Desktop: ignore .open & hide backdrop */
@media (min-width: 992px) {
  .sidebar.open { transform: none !important; }
  #app-backdrop { display: none !important; }
}