.org-chart {
 display: flex;
 flex-direction: column;
 align-items: center;
 width: 100%;
 max-width: 1200px;
 position: relative;
}

.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;
}

.custom-manager::before,
.custom-manager::after {
 display: none;
}

/* 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: 20px;
 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%;
}

@media screen and (max-width: 761px) {
 .lines-container {
  top: 85px !important;
 }

}

/* 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: -12px;
 left: 120px;
 right: 118px;
 height: 2px;
 background-color: #0b6f77;
 border: dashed #fff 1px;
}

/* Department styling */
.department {
 flex: 1;
 min-width: 200px;
 max-width: 300px;
 text-align: center;
 position: relative;
}

.units {
 list-style: none;
 padding: 0;
 margin-top: 10px;
 display: flex;
 flex-direction: column;
 gap: 5px;
 position: relative;
}

.units-has-up-line {
 margin-top: 35px !important;

 padding-top: 20px !important;
}
.units-has-up-line::before {
 content: '';
 display: block;
 width: 84.5%;
 height: 1px;
 background-color: #ccc;
 position: absolute;
 top: -5px;
 right: 0;
 left: 0;
 margin: 0 auto;
 border: 1px dotted #fff;
}

.units-has-up-line-full::before {
 width: 91.5%;
}

.units li {
 background: #fff;
 padding: 5px 10px;
 border: 1px solid #bad6d8;
 border-radius: 8px;
 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 font-size: 0.9rem;
 margin-top: 5px;
}

.has-line-down {
 position: relative;
}
.has-line-down::before {
 content: '';
 display: block;
 width: 1px;
 height: 11px;
 background-color: #0b6f77;
 position: absolute;
 bottom: -11px;
 right: 0;
 left: 0;
 margin: 0 auto;
}

.has-line-down-long::before {
 border: 1px dashed #fff;
 height: 41px;

 bottom: -41px;
 right: 0;
 left: 0;
}

.li-has-arrow-up {
 position: relative;
}
.li-has-arrow-up::before {
 content: '';
 display: block;
 width: 1px;
 height: 20px;
 background-color: #ccc;
 position: absolute;
 top: -30px;
 right: 0;
 left: 0;
 margin: 0 auto;
}
.li-has-arrow-up::after {
 content: '';
 width: 0;
 height: 0;
 border-top: 8px solid #8db6ba;
 border-right: 8px solid transparent;
 border-left: 8px solid transparent;
 position: absolute;
 top: -15px;
 right: 0;
 left: 0;
 margin: 0 auto;
}

.unit-list {
 list-style: none;
}

/* Responsive Design */
@media (max-width: 768px) {
 .departments {
  flex-direction: column;
  gap: 10px;
 }
 .department {
  max-width: 100% !important;
 }
 .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: 300px;
 }

 .departments {
  margin-top: 95px; /* Adjust the margin-top for departments on large screens */
 }

 /* Center the lines under the departments */
 .line {
  top: -10px; /* Adjust the vertical position */
 }

 .line:nth-child(1) {
  left: 10%;
 }
 .line:nth-child(2) {
  left: 30%;
 }
 .line:nth-child(3) {
  left: 50%;
 }
 .line:nth-child(4) {
  left: 70%;
 }
 .line:nth-child(5) {
  left: 90%;
 }
}

.bg-chart {
 width: 100vw;
 height: 100%;
 background: url(https://www.kfu.edu.sa/ar/Deans/E-Learning/Documents/e-learning-pages/assets/images/chart-background.png)
  center no-repeat;
 background-size: contain !important;
}

/* new modified */
.org-chart {
 align-items: center;
 width: 100%;
 max-width: 1200px;
}

.lines-container {
 display: flex;
 justify-content: space-between;
 position: absolute;
 top: 80px;
 width: 100%;
}

.lines-container::after {
 content: '';
 position: absolute;
 top: -12px;
 left: 94px;
 right: 91px;
 height: 2px;
 background-color: #0b6f77;
 border: dashed #fff 1px;
}

.department {
 flex: 1;
 max-width: 200px;
 text-align: center;
 position: relative;
}
.has-arrow {
 position: relative;
}
.has-arrow::before {
 content: '';
 display: block;
 width: 1px;
 height: 30px;
 border: 1px dashed #fff;
 background-color: #0b6f77;

 position: absolute;
 bottom: -30px;
 right: 0;
 left: 0;
 margin: 0 auto;
}

.has-arrow::after {
 content: '';
 width: 0;
 height: 0;
 border-top: 8px solid #8db6ba;
 border-right: 8px solid transparent;
 border-left: 8px solid transparent;
 position: absolute;
 bottom: -30px;
 right: 0;
 left: 0;
 margin: 0 auto;
}

.units {
 list-style: none;
 padding: 0;
 margin-top: 30px;
 display: flex;
 flex-direction: column;
 gap: 5px;
}

.structure {
 margin: 50px auto;
 max-width: 800px;
 position: relative;
}

.main-title {
 color: #fff;
 padding: 10px 30px;
 border-radius: 20px;
 display: inline-block;
}

.vertical-line {
 width: 2px;
 height: 470px;
 background-color: #237f8a;
 margin: 0 auto;
 border: dashed #fff 1px;
}

.subtitles {
 display: flex;
 justify-content: space-between;
 align-items: center;
 position: relative;
 margin-top: -430px;
}

.subtitle {
 width: 280px;
 font-size: 14px;
 font-weight: 500;
 background-color: #0b6f77;
 padding: 10px;
 border-radius: 5px;
 text-align: center;
 border-radius: 15px;
 color: white;
}

.horizontal-line {
 position: absolute;
 top: 50%;
 left: 10%;
 right: 10%;
 height: 2px;
 background-color: #237f8a;
 z-index: -1;
 border: dashed #fff 1px;
}

.more-width {
 max-width: 400px !important;
}

.height80 {
 height: 80px;
 align-items: center;
 display: grid;
}

/* Make layout responsive */
@media (max-width: 767px) {
 .structure {
  max-width: 90%;
 }

 .main-title {
  font-size: 16px;
 }

 .vertical-line {
  height: 300px;
 }

 .subtitles {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
 }

 .subtitle {
  width: 100%;
  margin-bottom: 10px;
 }

 .horizontal-line {
  left: 5%;
  right: 5%;
 }
 .more-width {
  max-width: 100% !important;
 }
 .height80 {
  height: 60;
 }
 .units {
  margin-top: 10px !important;
 }
 .has-arrow + .units {
  margin-top: 25px !important;
 }
}

@media (max-width: 576px) {
 .main-title {
  font-size: 14px;
 }

 .vertical-line {
  height: 50px;
 }

 .units {
  width: 100% !important;
  flex-direction: column !important;
 }

 .li-has-arrow-up::before,
 .li-has-arrow-up::after,
 .units-has-up-line::before {
  display: none;
 }
}
@media (min-width: 1024px) {
 .lines-container {
  top: 580px;
 }

 .line:nth-child(1) {
  left: 7%;
 }
 .line:nth-child(2) {
  left: 23%;
 }
 .line:nth-child(3) {
  left: 45%;
 }
 .line:nth-child(4) {
  left: 71%;
 }
 .line:nth-child(5) {
  left: 93%;
 }
 .line:nth-child(6) {
  left: 93%;
  top: 107px;
 }
 .line:nth-child(7) {
  left: 77%;
  top: 107px;
 }
 .line:nth-child(8) {
  left: 64%;
  top: 107px;
 }
 .line:nth-child(9) {
  left: 52%;
  top: 107px;
 }
 .line:nth-child(10) {
  left: 38%;
  top: 107px;
 }
 .line:nth-child(11) {
  left: 25%;
  top: 107px;
 }
 .line:nth-child(12) {
  left: 8%;
  top: 107px;
 }
}

/* */

/* Arrow styling for items */
.have-arrow {
 position: relative;
 margin-top: 25px; /* Space for arrow */
}

.have-arrow::before {
 content: '';
 position: absolute;
 top: -25px;
 left: 50%;
 width: 2px;
 height: 15px;
 background-color: #0b6f77;
 transform: translateX(-50%);
}

.have-arrow::after {
 content: '';
 position: absolute;
 top: -10px;
 left: 50%;
 transform: translateX(-50%);
 width: 0;
 height: 0;
 border-left: 6px solid transparent;
 border-right: 6px solid transparent;
 border-top: 6px solid #0b6f77;
}

/* Responsive adjustments */
@media (max-width: 768px) {
 .have-arrow {
  margin-top: 25px;
  padding-top: 0;
 }

 .have-arrow::before {
  top: -25px;
  height: 15px;
 }

 .have-arrow::after {
  top: -10px;
  border-left-width: 6px;
  border-right-width: 6px;
  border-top-width: 6px;
 }
}

/* added by husien */

.horz-line {
 width: inherit;
 height: 1px;
 display: grid;
 grid-template-columns: 5 1fr;
 grid-auto-flow: column;
 flex-direction: row;
 background-color: #0b6f77;
 padding: 0;
 margin: 20px auto 0;
  border: 1px dashed #fff;
}
.horz-line li {
 list-style: none;

 position: relative;
}
.horz-line li::before {
 content: '';
 display: block;
 position: absolute;
 top: 0;
 width: 1px;
 height: 25px;
 background-color: #0b6f77;
 border: 1px dashed #fff;
}

.horz-line li::after {
 content: '';
 position: absolute;
 bottom: -25px;
 right: -18px;
 transform: translateX(-50%);
 width: 0;
 height: 0;
 border-left: 10px solid transparent;
 border-right: 10px solid transparent;
 border-top: 10px solid #8db6ba;
}
