/* Organization Chart Styles */

/* Grid Layout for Departments/Branches */
.org-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  padding: 10px;
}

/* Department/Branch Card */
.org-department-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.org-department-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.org-dept-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.org-dept-header i {
  font-size: 20px;
}

.org-dept-header h6 {
  margin: 0;
  flex: 1;
  font-weight: 600;
  font-size: 16px;
}

.org-dept-header .badge {
  background: rgba(255,255,255,0.2) !important;
  color: white;
}

.org-dept-body {
  padding: 16px;
}

/* Role Sections */
.org-role-section {
  margin-bottom: 16px;
}

.org-role-section:last-child {
  margin-bottom: 0;
}

.org-role-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Employee Cards */
.org-employee-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.org-employee-card:hover {
  border-color: #4a90e2;
  background: #fff;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
  transform: translateX(4px);
}

.org-card-head {
  background: #fff9e6;
  border-color: #ffc107;
}

.org-card-head:hover {
  border-color: #ff9800;
  background: #fff;
}

.org-card-deputy {
  background: #e3f2fd;
  border-color: #2196f3;
}

.org-card-deputy:hover {
  border-color: #1976d2;
  background: #fff;
}

.org-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.org-card-info {
  flex: 1;
  min-width: 0;
}

.org-card-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-card-position {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Team Members Grid */
.org-team-grid {
  display: grid;
  gap: 8px;
}

/* Manager Hierarchy View (Tree) */
.org-node-wrapper {
  margin: 10px 0;
}

.org-node {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 350px;
}

.org-node:hover {
  border-color: #4a90e2;
  box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
  transform: translateY(-2px);
}

.org-node-focused {
  border-color: #4a90e2;
  background: #f0f7ff;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.org-node-avatar {
  flex-shrink: 0;
}

.org-node-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e0e0e0;
}

.org-node-info {
  flex: 1;
  min-width: 0;
}

.org-node-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-node-position {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-node-department {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-children {
  margin-left: 30px;
  padding-left: 20px;
  border-left: 2px solid #e0e0e0;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .org-chart-grid {
    grid-template-columns: 1fr;
  }
  
  .org-node {
    max-width: 100%;
  }
  
  .org-children {
    margin-left: 15px;
    padding-left: 10px;
  }
}
