@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ================== Base ================== */

* {
  font-family: 'Inter', sans-serif;
}

/* Largeur de la sidebar (toutes tailles) */
#sidebar.sidebar-collapsed {
  width: 4rem;
}

#sidebar.sidebar-expanded {
  width: 16rem;
}

/* Légère marge des sous-menus */
.submenu-item {
  margin-left: 0.75rem;
}

/* ================== Carrousel ================== */

.carousel-container {
  scroll-behavior: smooth;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ================== Scrollbar sidebar ================== */

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}

.dark .sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.4);
}

.dark .sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.6);
}

/* Firefox scrollbar */
.sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

.dark .sidebar-scroll {
  scrollbar-color: rgba(75, 85, 99, 0.4) transparent;
}

/* Scrollbar visible uniquement au survol */
.sidebar-scroll::-webkit-scrollbar-thumb {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  opacity: 1;
}

/* ================== Badge notification ================== */

.notification-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ================== États de menu ================== */

.menu-item-active {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  color: white;
  border-left: 4px solid #2dd4bf;
  border-radius: 0 0.5rem 0.5rem 0;
}

.menu-item-active .menu-icon {
  color: white;
}

.submenu-active {
  background-color: rgba(45, 212, 191, 0.1);
  border-left: 4px solid #2dd4bf;
  border-radius: 0 0.5rem 0.5rem 0;
}

.dark .submenu-active {
  background-color: rgba(45, 212, 191, 0.2);
}

/* ================== Divers ================== */

.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-overlay {
  backdrop-filter: blur(4px);
}

/* En mode réduit, on cache le texte du menu */
.sidebar-collapsed .menu-text {
  display: none;
}

/* Tooltip en mode réduit */
.sidebar-collapsed .tooltip .tooltip-text {
  bottom: 50%;
  left: 100%;
  transform: translateY(50%);
  margin-left: 10px;
}

/* ================== Tooltip menu ================== */

.menu-tooltip {
  position: fixed;
  background-color: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s ease-in-out;
  white-space: nowrap;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.menu-tooltip.show {
  opacity: 1;
}

.menu-tooltip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1f2937;
}

.dark .menu-tooltip {
  background-color: #374151;
}

.dark .menu-tooltip::before {
  border-right-color: #374151;
}

/* ================== Layout RTL ================== */

/* Sidebar à droite en RTL */
html[dir="rtl"] #sidebar {
  left: auto;
  right: 0;
  border-right-width: 0;
  border-left-width: 1px;
}

/* Sous-menus : inversion du décalage */
html[dir="rtl"] .submenu-item {
  padding-left: 0 !important;
  margin-left: 0 !important;
  margin-right: 0.75rem !important;
}

/* États actifs : bordure à droite en RTL */
html[dir="rtl"] .menu-item-active {
  border-left: 0 !important;
  border-right: 4px solid #2dd4bf !important;
  border-radius: 0.5rem 0 0 0.5rem !important;
}

html[dir="rtl"] .submenu-active {
  border-left: 0 !important;
  border-right: 4px solid #2dd4bf !important;
  border-radius: 0.5rem 0 0 0.5rem !important;
}

/* Tooltip : flèche inversée en RTL */
html[dir="rtl"] .menu-tooltip::before {
  left: auto !important;
  right: -5px !important;
  border-right-color: transparent !important;
  border-left-color: #1f2937 !important;
}

html.dark[dir="rtl"] .menu-tooltip::before {
  border-left-color: #374151 !important;
}

/* ================== Positionnement du contenu (desktop / tablette) ================== */
/* Piloté par la classe .is-collapsed ajoutée par main-shell.js                         */

/* Valeurs par défaut : pas de marge (utile pour mobile aussi) */
#main-content {
  margin-left: 0;
  margin-right: 0;
}

/* Écrasé uniquement à partir du breakpoint desktop */
@media (min-width: 1025px) {

  /* LTR : sidebar à gauche */
  html[dir="ltr"] #main-content {
    margin-left: 16rem;
    /* sidebar ouverte */
    margin-right: 0;
  }

  html[dir="ltr"] #main-content.is-collapsed {
    margin-left: 4rem;
    /* sidebar réduite */
    margin-right: 0;
  }

  /* RTL : sidebar à droite */
  html[dir="rtl"] #main-content {
    margin-right: 16rem;
    margin-left: 0;
  }

  html[dir="rtl"] #main-content.is-collapsed {
    margin-right: 4rem;
    margin-left: 0;
  }

  /* En desktop, aucune translation : la sidebar est fixe */
  #sidebar {
    transform: none;
  }
}

/* ================== Mobile / petite tablette (≤ 1024px) ================== */
/*  - La sidebar se comporte comme un drawer qui glisse au-dessus du contenu
    - Le contenu n’a plus jamais de marge gauche/droite liée à la sidebar    */

@media (max-width: 1024px) {

  /* On force une largeur confortable pour le drawer */
  #sidebar {
    width: 16rem;
  }

  /* LTR : drawer qui vient de la gauche */
  html[dir="ltr"] #sidebar.sidebar-collapsed {
    transform: translateX(-100%);
  }

  html[dir="ltr"] #sidebar.sidebar-expanded {
    transform: translateX(0);
  }

  /* RTL : drawer qui vient de la droite */
  html[dir="rtl"] #sidebar.sidebar-collapsed {
    transform: translateX(100%);
  }

  html[dir="rtl"] #sidebar.sidebar-expanded {
    transform: translateX(0);
  }

  /* Le contenu occupe toute la largeur, sans réserver de place */
  #main-content,
  #main-content.is-collapsed {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Le bouton de menu reste cliquable au-dessus de la sidebar */
#sidebar-toggle {
  position: relative;
  z-index: 50;
}
 

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.regime-content {
  display: none;
}

.regime-content.active {
  display: block;
}

.dark {
  color-scheme: dark;
}

.modal {
  display: none;
}

.modal.active {
  display: flex;
}

.required-field::after {
  content: " *";
  color: #ef4444;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}


@view-transition {
  navigation: auto;
}


        #tooth-info {
            margin: 20px auto;
            padding: 15px;
            background: #e6f7ff;
            border-radius: 8px;
            border-left: 4px solid #4682b4;
            max-width: 600px;
        }

        .tooth-section {
            opacity: 0.9;
            transition: opacity 0.3s;
        }

        .tooth-section:hover {
            opacity: 1;
        }

        .tooth-palette {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
            padding: 15px;
            background: #ecf0f1;
            border-radius: 10px;
        }

        .palette-tooth {
            width: 40px;
            height: 60px;
            background-color: #fff8f0;
            border: 2px solid #95a5a6;
            border-radius: 5px 5px 15px 15px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-weight: bold;
            cursor: grab;
            user-select: none;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        }

        .palette-tooth .tooth-number {
            font-size: 12px;
        }

        .palette-tooth .tooth-type {
            font-size: 10px;
            color: #7f8c8d;
        }

        .bouche {
            fill: #09c;
        }


        .gencive {
            fill: #fd8484;
        }

        .cls-3 {
            letter-spacing: -0.06em;
        }

        .numSerie {
            font-size: 72px;
        }

        .numSerie,
        .numDent {
            fill: #fcee21;
            font-family: Arial-BoldMT, Arial;
            font-weight: 700;
        }

        .numSerie,
        .numDent,
        .lignSeparateur,
        .emailDent {
            stroke-miterlimit: 10;
        }

        .numSerie,
        .numDent,
        .emailDent {
            stroke: #000;
        }

        .numDent {
            font-size: 48px;
        }

        .lignSeparateur {
            fill: none;
            stroke: #fcee21;
            stroke-width: 12px;
        }

        .racineDent {
            fill: #eaeaea;
        }

        .emailDent {
            fill: #ffffff;
            stroke-width: 0.25px;
        }

        .cacher {
            fill: #fbfbfb00;
        }

        .pocheDent {
            fill: #fc2424;
        }

        .canalRacine {
            fill: #fda1a1;
        }

        .carie {
            fill: #666;
        }

        .nerve {
            fill: #ff5559;
        }
 

        .contactPocheDent {
            fill: #232422;
        }

        .zoneDent {
            opacity: .48;
            stroke-width: 1px;
            stroke: #000;
        }

        .zoneDent {
            stroke-miterlimit: 10;
        }

        .faux-moignon {
            fill: #7a7a7a;
        }

        .active-zone {
            background-color: #007bff !important;
            color: white !important;
            border: 2px solid #0056b3 !important;
        }
        .dentAbsente{
            fill: #6495ed00;
            stroke: none;
        }

        .tooth-hover path,
        .tooth-hover rect { 
            stroke: #00f !important;
            stroke-width: 4px !important;
        }

          .color-legend {
        display: inline-block;
        width: 16px;
        height: 16px;
        border: 2px solid black;
        margin-right: 5px;
    }
      .tooth-label {
            font-size: 11px;
            text-anchor: middle;
            pointer-events: none;
            font-weight: 600;
            fill: #333;
        }

        .tooth-type {
            font-size: 13px;
            text-anchor: middle;
            font-weight: 600;
            fill: #2f4f4f;
        }
                #teeth-svg {
            display: block; 
            background: #fff;
            border-radius: 10px; 
        }
        .tooth {
            stroke: #555;
            stroke-width: 1.2;
            fill: #fffaf0;
            cursor: move;

            filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
        }

        .tooth:hover,
        .tooth:hover * {
          stroke: darkblue;
          stroke-width: 4;
        }

        .tooth.selected,
        .tooth.selected * { 
            stroke: darkblue;
            stroke-width: 4;
            filter: drop-shadow(2px 2px 3px rgba(30, 144, 255, 0.3));
        }