:root {
    
--panel-width-desktop: 300px;
  --panel-width-mobile: 85vw;
  --panel-gap: 1.5rem; /* espace vertical entre les deux panels */

            /* Light theme variables */
            --primary-light: #667eea;
            --secondary-light: #764ba2;
            --accent-light: #4facfe;
            --background-light: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            --card-bg-light: rgba(255, 255, 255, 0.95);
            --text-primary-light: #2d3748;
            --text-secondary-light: #4a5568;
            --border-light: rgba(255, 255, 255, 0.2);
            --shadow-light: 0 20px 40px rgba(0, 0, 0, 0.1);
            --hover-shadow-light: 0 30px 60px rgba(0, 0, 0, 0.15);

            /* Dark theme variables */
            --primary-dark: #4e54c8;
            --secondary-dark: #8f94fb;
            --accent-dark: #00d4ff;
            --background-dark: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
            --card-bg-dark: rgba(30, 30, 30, 0.95);
            --text-primary-dark: #e2e8f0;
            --text-secondary-dark: #a0aec0;
            --border-dark: rgba(255, 255, 255, 0.1);
            --shadow-dark: 0 20px 40px rgba(0, 0, 0, 0.5);
            --hover-shadow-dark: 0 30px 60px rgba(0, 0, 0, 0.7);

            /* Active theme (default light) */
            --primary: var(--primary-light);
            --secondary: var(--secondary-light);
            --accent: var(--accent-light);
            --background: var(--background-light);
            --card-bg: var(--card-bg-light);
            --text-primary: var(--text-primary-light);
            --text-secondary: var(--text-secondary-light);
            --border: var(--border-light);
            --shadow: var(--shadow-light);
            --hover-shadow: var(--hover-shadow-light);

            /* Animation variables */
            --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        [data-theme="dark"] {
            --primary: var(--primary-dark);
            --secondary: var(--secondary-dark);
            --accent: var(--accent-dark);
            --background: var(--background-dark);
            --card-bg: var(--card-bg-dark);
            --text-primary: var(--text-primary-dark);
            --text-secondary: var(--text-secondary-dark);
            --border: var(--border-dark);
            --shadow: var(--shadow-dark);
            --hover-shadow: var(--hover-shadow-dark);
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .employee-card {
            animation: fadeInUp 0.8s ease-out;
        }

        .sidebar {
            animation: fadeInUp 0.8s ease-out 0.2s both;
        }

        .containerMenu{
            position: absolute;
            width: 60px;
            height: 60px;
            left: 47%;
            bottom: 0;
            z-index: 5;
        }
        .wrapper{
            display: flex;
            list-style: none;
        }
        .wrapper .icon{
            position: relative;
            background: #ffffff;
            border-radius: 50%;
            padding: 15px;
            width: 60px;
            height: 60px;
            font-size: 18px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: all 0.2a cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        .wrapper .tooltip {
            position: absolute;
            top: 0;
            font-size: 18px;
            width: 210px;
            background: #ffffff;
            color: #ffffff;
            padding: 5px 8px;
            border-radius: 5px;
            box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .wrapper .tooltip::before {
            position: absolute;
            content: "";
            height: 8px;
            width: 8px;
            background: #ffffff;
            bottom: -3px;
            left: 50%;
            transform: translate(-50%) rotate(45deg);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .wrapper .icon:hover .tooltip {
            top: -45px;
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        
        .wrapper .icon:hover span,
        .wrapper .icon:hover .tooltip {
            text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.1);
        }
        
        .wrapper .telegram:hover,
        .wrapper .telegram:hover .tooltip,
        .wrapper .telegram:hover .tooltip::before {
            background: #1DA1F2;
            color: #ffffff;
        }

        .glow {
        border-radius: 50%;
        box-shadow: 0 0 10px #00f;
        animation: pulseGlow 2s infinite;
        }

        @keyframes pulseGlow {
        0% {
            box-shadow: 0 0 10px #00f;
        }
        25% {
            box-shadow: 0 0 20px #0ff, 0 0 30px #0ff;
        }
        50% {
            box-shadow: 0 0 20px #0f0, 0 0 30px #0f0;
        }
        75% {
            box-shadow: 0 0 20px #f0f, 0 0 30px #f0f;
        }
        100% {
            box-shadow: 0 0 10px #00f;
        }

        }

        .nicebox {
        position: relative;
        text-align: center;
        font-family: "Roboto", "Arial", sans-serif;
        font-size: 13px;
        z-index: 5;
        padding: 5px 10px;
        }

        #data-box {
        top: 10px;
        left: 500px;
        height: 45px;
        line-height: 45px;
        display: none;
        }

        #census-variable {
        width: 360px;
        height: 20px;
        }

        .legend {
            font-family: 'AlternateGothic', sans-serif; /* ou ta police préférée */
            color: #5d2a2c;    /* couleur personnalisée */
            display: -webkit-box;
            padding-top: 7px;
            padding-bottom: 7px;
            display: flex;
            align-items: center;         /* aligne verticalement les éléments */
            justify-content: space-between; /* espace entre les éléments */
            gap: 1rem;  
        }

        .color-key {
        background: linear-gradient(
                    to right,
                    rgba(255, 255, 255, 1) 0%,
                    rgba(180, 255, 180, 1) 25%,
                    rgba(60, 200, 60, 1) 50%,
                    rgba(30, 120, 30, 1) 75%,
                    rgba(0, 60, 0, 1) 100%
                    );
        flex: 1;
        -webkit-box-flex: 1;
        margin: 0 5px;
        text-align: left;
        font-size: 1em;
        line-height: 1em;
        }

        #data-value {
        font-size: 2em;
        font-weight: bold;
        }

        #data-label {
        font-size: 2em;
        font-weight: normal;
        padding-right: 10px;
        }

        #data-label:after {
        content: ":";
        }

        #data-caret {
        margin-left: -5px;
        display: inline-block;
        font-size: 14px;
        width: 14px;
        }

/* ================================
   DOWN-BOX — Position fixe à droite, centré verticalement
=================================== */

.down-box {
  position: fixed;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  transform-origin: right center;

  /* largeur synchronisée */
  width: var(--panel-width-desktop);
  max-width: var(--panel-width-desktop);

  background: #fff;
  border: 2px solid #5d2a2c;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
}

/* ================================
   EMPLOYEE CARD
=================================== */

.employee-card {
  display: flex;
  flex-direction: column;
}

/* ================================
   HEADER
=================================== */

.card-header {
  background-color: #fff0ab;
  padding: 0.8rem;
  width: 100%;
  display: flex;
  align-items: center;
}

.card-header h2 {
  font-family: 'Roboto';
  font-weight: bold;
  font-size: 0.8rem;
  color: #5d2a2c;
  margin: 0;
}

/* ================================
   PROFILE SECTION
=================================== */

.profile-section h2 {
  font-family: 'Roboto';
  font-size: 1rem;
  color: #5d2a2c;
  margin: 0;
}

.employee-info {
  position: relative;
  display: inline-block;
}

.farmer-label {
  font-size: 12px;
  font-family: 'Roboto';
  font-weight: bold;
  color: #5d2a2c;

  position: absolute;
  top: -15px;
  left: 0;
  min-width: 80px;
}

/* ================================
   BODY
=================================== */

.card-body {
  display: flex;
  flex-direction: column;
  padding: 0.7rem;

  background-image: url("./images/bgbox.png");
  background-size: 125px 125px;
  background-repeat: no-repeat;
  background-position: top right;
}

/* ================================
   DETAILS GRID
=================================== */

.details-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding-top: 0.7rem;
}

.detail-icon {
  font-size: 1rem;
  color: #5d2a2c;
  flex-shrink: 0;
}

.detail-content {
  display: flex;
  flex-direction: row;        /* reste horizontal */
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;               /* pour permettre l'ellipsis si besoin */
}

.detail-label {
  font-family: 'Roboto';
  font-weight: bold;
  font-size: 0.75rem;
  color: #5d2a2c;
  flex: 0 1 auto;
  min-width: 0;
}

.detail-value {
  font-family: 'Roboto';
  font-weight: bold;
  font-size: 0.75rem;
  color: #333;
  margin-left: 0.2rem;

  /* 🔒 Ne pas passer à la ligne */
  white-space: nowrap;

  /* Si ça dépasse vraiment, on tronque proprement (optionnel) */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;             /* ajuste selon la longueur des labels/valeurs */
}

/* ================================
   MOBILE — même carte mais plus petite (proportionnelle)
   On applique un scale, sans changer la disposition, 
   et on garde l’ancrage à droite / milieu.
=================================== */

@media (max-width: 480px) {

  .down-box {
    width: var(--panel-width-mobile);
    max-width: var(--panel-width-mobile);
    transform-origin: right center;
  }

  .down-box {
    transform: translateY(-50%) scale(0.85);
  }
  /* Si tu veux que la valeur prenne un peu plus de place sur mobile */
  .detail-value {
    max-width: 70%;
  }

}

@media (max-width: 360px) {

  .down-box {
    transform-origin: right center;
  }

  .down-box {
    transform: translateY(-50%) scale(0.78);
  }
}
        .hideItem {
            display:none;
        }