/* 조직도 컨테이너 */
.org-chart-container {
  margin: 2rem 0;
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 0;
}

/* 최상위 조직도 레이아웃 */
.org-level-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin: 0 auto 3rem;
  padding: 0 20px;
  max-width: 1200px;
  min-width: 1000px;
  position: relative;
}

/* 조직도 아이템 공통 스타일 */
.org-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 15px;
  text-align: center;
  min-width: 180px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.org-item h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.1rem;
  font-weight: 600;
}

/* 회장 스타일 */
.org-item.president {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  transform: scale(1.05);
  z-index: 1;
  min-width: 220px;
  border: none;
  box-shadow: 0 8px 12px -2px rgba(59, 130, 246, 0.2), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.org-item.president:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 16px -3px rgba(59, 130, 246, 0.25);
}

.org-item.president h3,
.org-item.president p,
.org-item.president .org-desc {
  color: white;
}

/* 왼쪽 그룹 (대의원총회, 이사회) */
.org-left-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-right: 20px;
}

/* 대의원총회, 이사회, 감사 스타일 */
.org-item.assembly,
.org-item.council,
.org-item.auditor {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
  min-width: 180px;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

/* 감사 스타일 */
.org-item.auditor {
  margin-left: 20px;
}

/* 부회장 스타일 */
.org-item.vice-president {
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  padding: 16px 12px;
  min-width: 170px;
  margin: 0 5px 20px;
  position: relative;
  z-index: 2;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.org-item.vice-president h4,
.org-item.vice-president p,
.org-item.vice-president .org-desc {
  color: #1e3a8a;  /* 진한 파란색으로 변경하여 가독성 향상 */
}

.org-item.vice-president h4 {
  font-weight: 600;
  margin-bottom: 8px;
}

.org-item.vice-president p {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 1.05em;
}

.org-item.vice-president .org-desc {
  font-size: 0.85em;
  color: #475569;  /* 조금 더 연한 회색으로 변경 */
}

.org-item.vice-president:hover {
  background: #e0f2fe;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.org-item.vice-president:hover h4,
.org-item.vice-president:hover p {
  color: #1e40af;  /* 호버 시 조금 더 진한 색상으로 변경 */
}

/* 사무국 스타일 */
.org-item.office {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  padding: 12px 15px;
  min-width: 250px;
  margin: 5px auto 20px;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.office-staff {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-top: 10px;
}

.staff {
  text-align: center;
  padding: 8px 6px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex: 1;
  font-size: 0.9em;
}

.staff h4 {
  margin: 0 0 5px 0;
  font-size: 0.9rem;
  color: #333;
}

.staff p {
  margin: 0 0 3px 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.staff .org-desc {
  font-size: 0.8rem;
  color: #666;
  display: block;
}

/* 부서 섹션 스타일 */
.org-level-departments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin: 15px 0 35px;
  padding: 0 10px;
  position: relative;
  z-index: 2;
}

/* 소속 단체 스타일 */
.org-level-affiliates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 0 5px;
}

.org-item.affiliate {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 10px;
  transition: all 0.2s ease;
}

.org-item.affiliate h4 {
  color: #1e40af;
  margin: 0 0 5px 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.org-item.affiliate h4:not(:first-child) {
  font-size: 0.78rem;
  font-weight: 500;
  color: #4b5563;
  margin: 2px 0;
  line-height: 1.3;
}

.org-item.affiliate:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.org-item.department {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px 10px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.03);
}

.org-item.department:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.org-item.department h4 {
  color: #2c3e50;
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.org-item.department p {
  color: #7f8c8d;
  font-size: 0.85rem;
  margin: 0 0 10px 0;
  min-height: 36px;
  line-height: 1.3;
}

.sub-teams {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.sub-team {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  color: #475569;
  white-space: nowrap;
  line-height: 1.3;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.sub-team:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* 연결선 컨테이너 */
.org-connector {
  position: relative;
  height: 25px;
  width: 100%;
  margin: -5px auto 5px;
  display: flex;
  justify-content: center;
  z-index: 1;
  overflow: visible;
}

/* 경영진과 사무국 사이 연결선 */
.org-level-executive + .org-connector {
  height: 25px;
  margin: -10px auto 0;
  position: relative;
  z-index: 1;
}

.org-level-executive + .org-connector .connector-line {
  height: 100%;
  background: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
  position: relative;
  z-index: 1;
}

/* 사무국 상단 연결선 */
.org-level-management {
  position: relative;
}

.org-level-management::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: #cbd5e1;
  z-index: 0;
}

/* 세로 연결선 */
.connector-line {
  position: relative;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
  margin: 0 auto;
}

/* 가로 연결선 (상단) */
.connector-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 2px;
  background: #cbd5e1;
}

/* 부서 연결선 (하단) */
.connector-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #cbd5e1 20%, 
    #cbd5e1 80%, 
    transparent 100%
  );
}

/* 사무국과 부서 연결선 */
.org-level-management + .org-connector {
  height: 12px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.org-level-management + .org-connector .connector-line {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
  position: relative;
  z-index: 1;
  margin: 0;
  box-shadow: 0 0 4px rgba(148, 163, 184, 0.3);
}

/* 사무국 하단 연결선 */
.org-level-management::after {
  display: none; /* Hide the bottom connector line */
}

/* 부서 그리드 위 연결선 */
.org-level-departments {
  position: relative;
}

.org-level-departments::before {
  display: none; /* Hide the top connector line */
}

.org-level-departments::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  z-index: 2;
}

/* 부서 레벨 간 간격 조정 */
.org-level-management {
  margin: 0 auto 20px;
  position: relative;
  z-index: 3;
  width: fit-content;
  padding: 0;
}

/* 사무국 조정 */
.org-item.office {
  min-height: auto;
  padding: 15px 20px;
  margin: 0 auto 10px;
  position: relative;
  z-index: 2;
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 부서 아이템 조정 */
.org-item.department {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
}

/* 연결선 조정 */
.org-connector {
  height: 30px;
  margin: 0 auto 10px;
  position: relative;
  z-index: 1;
}

.connector-line {
  height: 20px;
  background: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
  width: 2px;
  margin: 0 auto;
}

/* 부서 그리드 조정 */
.org-level-departments {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  margin: 0 auto 30px;
  padding: 20px 15px 0;
  max-width: 1000px;
  gap: 15px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  position: relative;
  z-index: 2;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.org-level-departments::-webkit-scrollbar {
  display: none;
}

/* 부서 아이템 크기 조정 */
.org-item.department {
  min-width: 160px;
  max-width: 180px;
  flex: 1 0 auto;
  box-sizing: border-box;
}

/* 부서 아이템 호버 효과 */
.org-item.department:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #bfdbfe;
}

/* 조직 현황 스타일 */
.org-stats {
  margin: 40px 0;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
}

.org-stats h3 {
  color: #1e40af;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 1.3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.stat-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 18px 15px;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border-color: #bfdbfe;
}

.stat-item h4 {
  color: #4b5563;
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.stat-item p {
  color: #1e40af;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

/* 이사회 정보 스타일 */
.board-info {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0 30px;
}

.board-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 0.95rem;
  color: #4b5563;
  transition: all 0.2s ease;
}

.board-item strong {
  color: #1e40af;
  font-weight: 600;
  margin-right: 5px;
}

.board-item:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* 반응형 대응 */
@media (max-width: 1200px) {
  .org-level-departments {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .org-level-top {
    gap: 20px;
    min-width: 900px;
    padding: 20px 10px;
  }
  
  .org-item {
    padding: 15px 10px;
    min-width: 150px;
  }
  
  .org-item.department {
    min-width: auto;
  }
  
  .org-item.president {
    min-width: 200px;
  }
}
