/* =========================================================
   POPUPS / SELECTION WINDOWS (feed / nutrient / time / bio / tech)
   ========================================================= */

/* Base popup container (absolutePanel) */
#feed_card_container,
#nutrient_card_container,
#time_selection_panel,
#bio_card_container,
#te_card_container{
  display:flex;
  flex-direction:column;
  height:88vh;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999 !important;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 0 !important;
  max-height: 88vh;
  min-height: 0;
  overflow: hidden; /* important : scroll interne, pas externe */
}


/* Tailles par popup */
#feed_card_container{ width: min(70vw, 900px); }
#nutrient_card_container{ width: min(70vw, 900px); }
#bio_card_container{ width: min(70vw, 900px); }
#te_card_container{ width: min(70vw, 900px); }
#time_selection_panel{ width: min(90vw, 420px); }

/* Structure interne : card en flex colonne */
#feed_card_container .card,
#nutrient_card_container .card,
#time_selection_panel .card,
#bio_card_container .card,
#te_card_container .card{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 !important;
  border: none !important;
  border-radius: 10px;
}

/* popup-body = zone centrale scrollable */
#feed_card_container .popup-body,
#nutrient_card_container .popup-body,
#time_selection_panel .popup-body,
#bio_card_container .popup-body,
#te_card_container .popup-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 15px;
}


#feed_card_container .popup-body .tab-content{
  min-height: 0;
  height: 100%;
  overflow-y: auto;
}
#feed_card_container .popup-body .tab-pane{
  min-height: 0;
}

/* Title bar */
.title-bar{
  background: #f5f5f5;
  padding: 10px 15px;
  border-bottom: 1px solid #ccc;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font-weight: 600;
}

/* Footer */
.popup-footer,
.popup-footer-nutri{
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-top: 1px solid #ccc;
  background: #fafafa;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.popup-footer{ justify-content: flex-end; }
.popup-footer-nutri{ justify-content: space-between; }

/* Bouton Terminer */
.apply-btn{
  background-color: #4CAF50 !important;
  color: white !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 8px 18px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease-in-out !important;
}

.apply-btn:hover{
  background-color: #43A047 !important;
  transform: translateY(-1px);
}


/* =========================================================
   ShinyTree : rendu un peu plus clean
   ========================================================= */
.jstree-default .jstree-anchor{
  font-size: 14px;
}

.selection-tree-hint{
  margin: 0 0 8px;
  text-align: right;
  font-size: 12px;
  line-height: 1.4;
  color: #555;
}

/* Make expanding a selection group distinct from checking its checkbox. */
.jstree-default .jstree-closed > .jstree-ocl,
.jstree-default .jstree-open > .jstree-ocl{
  position: relative;
  background-image: none;
  cursor: pointer;
}

.jstree-default .jstree-closed > .jstree-ocl::before,
.jstree-default .jstree-open > .jstree-ocl::before{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #000;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.jstree-default .jstree-closed > .jstree-ocl::before{
  transform: translate(0, -50%);
}

.jstree-default .jstree-open > .jstree-ocl::before{
  transform: translate(-50%, -50%) rotate(90deg);
}


