/* sidebar_custom.css */

/* Main sidebar container */
.custom-sidebar {
  position: fixed;
  left: 0;
  top: 15%;
  bottom: 15%;
  /*height: 100vh;*/
  display: flex;
  z-index: 1000;
  background: transparent;
  /*box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);*/
}

/* Icons container */
.sidebar-icons {
  width: 60px;
  background: linear-gradient(135deg, #4D9E87 0%, #047857 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  /*padding-top: 20px;*/
  gap: 6px;
}

/* Individual icon styling */
.sidebar-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  /*border-radius: 12px;*/
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(3px);
  z-index: 10;
}

.sidebar-icon.active {
  /*background: rgba(255, 255, 255, 0.5);*/
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: black;
}


/* Visual bridge connecting active icon to panel */
.sidebar-icon.active::after {
  content: "";
  position: absolute;
  /*left: -10px;*/
  right: -60px; /* Adjust based on your margin-left value */
  top: 50%;
  transform: translateY(-50%);
  width: 120px; /* Match your margin-left */
  height: 45px;
  /*background: linear-gradient(135deg, #4D9E87 0%, #047857 100%);*/
  background: rgba(255, 255, 255, 0.5);
}


/* Icon tooltips */
.icon-tooltip {
  position: absolute;
  left: 65px;
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1001 !important;
}

.sidebar-icon:hover .icon-tooltip {
  opacity: 1;
}

.icon-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #333;
}

.sidebar-divider {
  width: 80%;
  margin: 0 0;
  border: none;
  height: 1px;
  background-color: white;
  opacity: 1;
  flex-shrink: 0;
  align-self: center;
  z-index: 1005;
}


/* Map layout icon - base styling (same as sidebar-icon) */
.map-layout-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Map layout icon - active state styling */
.map-layout-icon.active-layout {
  /*background: rgba(255, 255, 255, 0.3);*/
  color: green;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}


.map-layout-icon:hover .icon-tooltip {
  opacity: 1;
}
.icon-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #333;
}

/* Panels container */
.sidebar-panels {
  width: 0;
  min-width: 0;
  overflow: hidden;
  transition: width 0.03s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 60px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
}

.sidebar-panels.expanded {
  width: 310px !important;
}

/* Individual panel styling */
.sidebar-panel {
  display: none;
  flex-direction: column !important;
  gap: 5px !important;
  padding: 15px;
  height: 100vh;
  overflow-y: auto;
  /*animation: fadeIn 0.3s ease-in;*/
}

.sidebar-panel.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Panel content styling */
.sidebar-panel h4 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.sidebar-panel .form-group {
  margin-bottom: 15px;
}

.sidebar-panel label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
  margin-bottom: 5px;
}

.sidebar-panel .btn {
  width: 100%;
  margin-top: 0;
  transition: all 0.3s;
}

.sidebar-panel .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Main content area adjustment */
/*.main-content-area {
  margin-left: 60px;
  padding: 20px;
  transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content-area.sidebar-expanded {
  margin-left: 340px;
}*/

/* Custom scrollbar for panels */
.sidebar-panel::-webkit-scrollbar {
  width: 6px;
}

.sidebar-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-panel::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.sidebar-panel::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar-panels.expanded {
    width: 240px;
  }
  
  .main-content-area.sidebar-expanded {
    margin-left: 300px;
  }
}




/* the control panel css */
/* Map selector container - matches other sections */
.map-selector-container {
  width: 99.9%;
  background: #d4d4d4;
  box-shadow: rgba(0, 0, 0, 0.15);
  margin: 0px auto;
  display: flex;
  flex-direction: column;
}

#geo-sidebar1-map_selector_ui_climate {
  height: 23px !important;
}

#geo-sidebar1-map_selector_ui_vegetation {
  height: 23px !important;
} 

#geo-sidebar1-map_selector_ui_water {
  height: 23px !important;
}

#geo-sidebar1-map_selector_ui_soil {
  height: 23px !important;
}

#geo-sidebar1-map_selector_ui_combined {
  height: 23px !important;
}

.map-selector-header {
  display: flex;
  align-items: center;
  margin-left: 5px;
  font-weight: 400;
  font-weight: bold; 
  background: #e9e9e9;
  color: black;
}

.map-selector-header i {
  margin-right: 8px;
  color: black;
}

/* Style the selectize input inside map selector */
.map-selector-container .selectize-control {
  padding: 0; 
  margin: 0;
}

.map-selector-container .selectize-input {
  margin: 0;
  padding: 0;
  height: 22px !important;
  min-height: 22px !important;
  line-height: 22px !important; 
}

.selectize-input.focus {
  border-color: #4CAF50 !important;
  box-shadow: 0 0 5px rgba(4, 120, 87, 0.5) !important;
}

.selectize-input.full {
  background-color: #eee !important;
}

.selectize-dropdown .selected {
  background-color: #4CAF50 !important;
  color:white !important;
}

/* css pour la partie temporalité*/
.temporalite-section {
  width: 99.9%;
  background: #d4d4d4;
  box-shadow: rgba(0, 0, 0, 0.15);
  margin: 0px auto;
  display: flex;
  flex-direction: column;
}

.temporalite-container {
  flex: 1;
}

.date-input {
  margin-top: auto;
  height: 22px;
}

/* Header styling */
.header {
  display: flex;
  align-items: center;
  margin-left: 5px;
  font-weight: 400;
  font-weight: bold; 
  background: #e9e9e9;
  color: black;
}

.header i {
  margin-right: 8px;
  color: black;
}


/* css pour la partie indices*/
.indice-section {
  width: 99.9%;
  background: #d4d4d4;
  box-shadow: rgba(0, 0, 0, 0.15);
  margin: 0px auto;
  height: auto;
}

/* Header styling */
.indice-header {
  display: flex;
  align-items: center;
  margin-left: 5px;
  font-weight: 400;
  font-weight: bold; 
  background: #e9e9e9;
  color: black;
}

.indice-header i {
  margin-right: 8px;
  color: black;
}

/* css pour la partie légende*/
.legend-section {
  width: 99.9%;
  background: #d4d4d4;
  box-shadow: rgba(0, 0, 0, 0.15);
  margin: 0px auto;
  height: auto;
}

/* Header styling */
.legend-header {
  display: flex;
  align-items: center;
  margin-left: 5px;
  font-weight: 400;
  font-weight: bold; 
  background: #e9e9e9;
  color: black;
}

.legend-header i {
  margin-right: 8px;
  color: black;
}

/* Update button container */
.update-button-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Update button styling */
.btn-update-map {
  width: 100%;
  background: linear-gradient(135deg, #4D9E87 0%, #047857 100%);
  color: white;
  border: none;
  padding: 5px;
  margin-top: 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(4, 120, 87, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


/* ==================== LARGE SCREEN OPTIMIZATIONS ==================== */

/* Large Desktop (1440px - 1920px) */
@media (min-width: 1920px) {
  /* Sidebar positioning - more vertical space */
  .custom-sidebar {
    top: 15%;
    bottom: 15%;
  }
  
  /* Icons container - scaled up */
  .sidebar-icons {
    width: 150px;
    min-width: 150px; /* Prevent collapse */
    gap: 35px;
    padding: 25px 0;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
  }
  
   /* Scale up all icons in sidebar */
  .sidebar-icons .fa-solid,
  .sidebar-icons .fa-lg {
    font-size: 3.5rem !important;  /* 32px base */
  }
  
  /* Individual icons - larger touch targets */
  .sidebar-icon {
    width: 100px;
    height: 100px;
    border-radius: 12px;
  }
  
  .sidebar-icon:hover {
    transform: translateX(5px); /* More pronounced hover */
  }
  
  /* Active state bridge - synchronized with new icon size */
  .sidebar-icon.active::after {
    right: -100px; /* Match margin-left */
    width: 200px; /* Double the icon width for proper bridge */
    height: 80px;
  }
  
  /* Tooltips - repositioned for wider sidebar */
  .icon-tooltip {
    left: 110px; /* 100px sidebar + 10px offset */
    font-size: 14px; /* Larger text */
    padding: 8px 14px;
  }
  
  /* Map layout icons - match new size */
  .map-layout-icon {
    width: 80px;
    height: 80px;
  }
  
  /* Panels - wider and synchronized */
  .sidebar-panels {
    margin-left: 100px; /* Match sidebar-icons width */
  }
  
  .sidebar-panels.expanded {
    width: 420px !important; /* Wider panels for large screens */
  }
  
  /* Panel content - larger typography */
  .sidebar-panel {
    padding: 25px;
    gap: 12px !important;
  }
  
  .sidebar-panel h4 {
    font-size: 22px;
    margin-bottom: 25px;
    padding-bottom: 15px;
  }
  
  .sidebar-panel label {
    font-size: 15px;
  }
  
  .sidebar-panel .btn {
    padding: 12px;
    font-size: 16px;
  }
  
  /* Form elements - larger touch targets */
  .sidebar-panel .form-group {
    margin-bottom: 20px;
  }
  
  /* Scrollbar - slightly wider for large screens */
  .sidebar-panel::-webkit-scrollbar {
    width: 8px;
  }
  
  /* Control panel sections - scaled */
  .map-selector-container,
  .temporalite-section,
  .indice-section,
  .legend-section {
    margin: 8px auto;
  }
  
  .map-selector-header,
  .header,
  .indice-header,
  .legend-header {
    font-size: 16px;
    padding: 8px 5px;
  }
  
  /* Update button - larger */
  .btn-update-map {
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
  }
  
  /* Selectize inputs - taller for large screens */
  .map-selector-container .selectize-input {
    height: 32px !important;
    min-height: 32px !important;
    line-height: 32px !important;
    font-size: 14px;
  }
  
  /* Dividers - thicker */
  .sidebar-divider {
    height: 2px;
  }
  
  /* Icon tooltips */
.icon-tooltip {
  left: 85px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 25px;
}


}
