.org-chart {

  align-items: center;
  width: 100%;
  max-width: 1200px;

}
.bg-chart{background: url(/ar/Deans/E-Learning/Documents/e-learning-pages/assets/images/chart-background.png) center no-repeat;}

.manager {
  padding: 10px 20px;
  border-radius: 20px;
  background: #0b6f77;
  text-align: center;
  font-weight: bold;
  margin: 20px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  color: white;
}

/* Add connecting line and arrow */
.manager::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 30px;
  background: #0b6f77;
  border: dashed #fff 1px;
}

/* Arrowhead */
.manager::before {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #8db6ba;
}

/* Remove the arrow for the last manager */
.manager:last-of-type::before,
.manager:last-of-type::after {
  display: none;
}

/* Departments container and the horizontal line */
.departments {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
  width: 100%;
  position: relative;
}

/* Container for lines */
.lines-container {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 80px;  /* Default position for small screens */
  width: 100%;
}

/* Vertical line styles */
.line {
  position: absolute;
  width: 2px;
  height: 40px;
  background-color: #0b6f77;
  border: dashed #fff 1px;
}

.line::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #8db6ba;
}

/* Horizontal line that connects to all vertical lines */
.lines-container::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 94px;
  right: 91px;
  height: 2px;
  background-color: #0b6f77;
  border: dashed #fff 1px;
}

/* Department styling */
.department {
  flex: 1;
 
  max-width: 210px;
  text-align: center;
  position: relative;
}

.units {
  list-style: none;
  padding: 0;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.units li {
  background: #fff;
  padding: 5px;
  border: 1px solid #bad6d8;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  margin-top: 5px;
  width: 165px;
  margin-left: auto; margin-right: auto;
}
.unit-list{list-style: none;}
/*----------------------*/
.structure {
  margin: 20px auto;
  max-width: 800px; /* Allow flexibility for responsiveness */
  position: relative;
}

/* Main Title */
.main-title {
  color: #fff;
  padding: 10px 30px;
  border-radius: 20px;
  display: inline-block;
}

/* Vertical Line */
.vertical-line {
  width: 2px;
  height: 508px;
  background-color: #237f8a;
  margin: 0 auto;
  border: dashed #fff 1px;
}

/* Subtitle Section */
.subtitles {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-top: -488px;
}

.subtitle {
  width: 280px;
  font-size: 14px;
  font-weight: 600;
  background-color:#0b6f77;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  border-radius: 15px;
  color: white;
}

/* Horizontal Line */
.horizontal-line {
  position: absolute;
  top: 50%; /* Align with the middle of subtitles */
  left: 10%;
  right: 10%;
  height: 2px;
  background-color: #237f8a;
  z-index: -1;
  border: dashed #fff 1px;
}
.more-width{max-width: 400px !important;}
.height80{height: 105px;
  align-items: center;
  display: grid;}
/* Make layout responsive */
@media (max-width: 767px) {
  .structure {
      max-width: 90%; /* Increase width on smaller screens */
  }

  .main-title {
      font-size: 16px; /* Smaller font size for mobile */
  }

  .vertical-line {
      height: 300px; /* Shorter vertical line on smaller screens */
  }

  .subtitles {
      flex-direction: column; /* Stack subtitles vertically on small screens */
      align-items: stretch; /* Allow subtitles to stretch across the container */
      margin-top: 0;
  }

  .subtitle {
      width: 100%; /* Full width for subtitles on small screens */
      margin-bottom: 10px;
  }

  .horizontal-line {
      left: 5%;
      right: 5%;
  }
  .more-width{max-width: 100% !important;}
  .height80{height: 60;}
  .units{margin-top: 10px;}
}

@media (max-width: 576px) {
  .main-title {
      font-size: 14px; /* Even smaller font size on extra small screens */
  }

  .vertical-line {
      height: 50px; /* Further reduce the vertical line on extra small screens */
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .departments {
    flex-direction: column;
    gap: 10px;
  }
  .department{max-width: 100%;}
  .lines-container {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .lines-container::after {
    display: none;
  }
}

/* For large screens */
@media (min-width: 1024px) {
  .lines-container {
    top: 580px;  /* Adjust the position for large screens */
  }

  .departments {
    margin-top: 85px;  /* Adjust the margin-top for departments on large screens */
  }

  /* Center the lines under the departments */
  .line {
    top: -6px;  /* Adjust the vertical position */
  }
  
  .line:nth-child(1) {
    left: 7%;
  }
  .line:nth-child(2) {
    left: 28%;
  }
  .line:nth-child(3) {
    left: 56%;
  }
  .line:nth-child(4) {
    left: 76%;
  }
  .line:nth-child(5) {
    left: 93%;
  }
  .line:nth-child(6) {
    left: 93%;top:132px;
  }
  .line:nth-child(7) {
    left: 76%;top:132px;
  }
  .line:nth-child(8) {
    left: 62%;top:132px;
  }
  .line:nth-child(9) {
    left: 49%;top:132px;
  }
  .line:nth-child(10) {
    left: 36%;top:132px;
  }
  .line:nth-child(11) {
    left: 23%;top:132px;
  }
  .line:nth-child(12) {
    left: 8%;top:132px;
  }
}