@import '../ios-theme.scss';

.team-management-header {
  background-color: $ios-background;
  padding: $ios-spacing-xl;
  border-bottom: 1px solid $ios-border;
  h1 {
    color: $ios-text-primary;
    font-size: $ios-font-size-xl;
    font-weight: 600;
    margin: 0;
  
}
}

.team-management-main {
  padding: $ios-spacing-xl;
  background-color: $ios-background-secondary;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  h2 {
    color: $ios-text-primary;
    font-size: $ios-font-size-lg;
    font-weight: 600;
    margin: 0;
  }
}

.search-filter {
  display: flex;
  gap: 10px;
  input,
  select {
    padding: 8px 12px;
    border: 1px solid $ios-border;
    border-radius: $ios-radius-lg;
    background-color: $ios-background;
    color: $ios-text-primary;
    font-size: $ios-font-size-base;
    &:focus {
      outline: none;
      border-color: $ios-primary;
      box-shadow: 0 0 0 2px rgba(0, 71, 171, 0.1);
    }
  }
  input {
    width: 200px;
  }
  select {
    width: 150px;
    cursor: pointer;
  }
}

/* 组员项目进度与排期 */
.team-schedule-section {
  background-color: $ios-background;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-lg;
  margin-bottom: 20px;
  box-shadow: $ios-shadow-card;
}

.team-schedule-tabs {
  .tab-buttons {
    display: flex;
    border-bottom: 1px solid $ios-border;
    margin-bottom: 20px;
    button {
      padding: 10px 20px;
      background-color: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: $ios-text-secondary;
      font-size: $ios-font-size-base;
      cursor: pointer;
      transition: all 0.2s ease;
      &.active {
        color: $ios-primary;
        border-bottom-color: $ios-primary;
        font-weight: 500;
      }
      &:hover {
        color: $ios-primary;
      }
    }
  }
}

.schedule-content {
  .designer-schedule {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid $ios-border;
    &:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    .designer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 15px;
      h3 {
        color: $ios-text-primary;
        font-size: $ios-font-size-base;
        font-weight: 500;
        margin: 0;
      }
      .workload {
        padding: 4px 8px;
        border-radius: $ios-radius-lg;
        font-size: $ios-font-size-sm;
        font-weight: 500;
        &.light {
          background-color: rgba(52, 199, 89, 0.1);
          color: #34c759;
        }
        &.medium {
          background-color: rgba(255, 149, 0, 0.1);
          color: #ff9500;
        }
        &.heavy {
          background-color: rgba(255, 59, 48, 0.1);
          color: #ff3b30;
        }
      }
    }
  }
}

.task-list {
  .task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: $ios-background-secondary;
    border-radius: $ios-radius-lg;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    &:hover {
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    &.overdue {
      border-left: 4px solid $ios-danger;
      background-color: rgba(255, 59, 48, 0.05);
    }
    .task-info {
      flex: 1;
      h4 {
        color: $ios-text-primary;
        font-size: $ios-font-size-base;
        font-weight: 500;
        margin: 0 0 5px 0;
      }
      .task-meta {
        display: flex;
        gap: 15px;
        .phase {
          color: $ios-primary;
          font-size: $ios-font-size-sm;
          font-weight: 500;
        }
        .deadline {
          color: $ios-text-secondary;
          font-size: $ios-font-size-sm;
        }
      }
    }
    .task-actions {
      display: flex;
      gap: 8px;
    }
  }
  .no-tasks {
    text-align: center;
    color: $ios-text-secondary;
    padding: 20px;
    font-size: $ios-font-size-base;
  }
}

.overdue-content {
  .overdue-list {
    .overdue-task {
      background-color: $ios-background-secondary;
      border-radius: $ios-radius-lg;
      padding: 15px;
      margin-bottom: 10px;
      border-left: 4px solid $ios-danger;
      .task-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        h3 {
          color: $ios-text-primary;
          font-size: $ios-font-size-base;
          font-weight: 500;
          margin: 0;
        }
        .overdue-badge {
          background-color: $ios-danger;
          color: white;
          padding: 4px 8px;
          border-radius: $ios-radius-full;
          font-size: $ios-font-size-sm;
          font-weight: 500;
        }
      }
      .task-details {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 10px;
        .detail-item {
          .label {
            color: $ios-text-secondary;
            font-size: $ios-font-size-sm;
            margin-right: 5px;
          }
          .value {
            color: $ios-text-primary;
            font-size: $ios-font-size-base;
            font-weight: 500;
          }
        }
      }
      .task-actions {
        display: flex;
        gap: 8px;
      }
    }
    .no-overdue {
      text-align: center;
      color: $ios-text-secondary;
      padding: 20px;
      font-size: $ios-font-size-base;
    }
  }
}

/* 组员能力看板 */
.capability-board-section {
  background-color: $ios-background;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-lg;
  margin-bottom: 20px;
  box-shadow: $ios-shadow-card;
}

.capability-tabs {
  .tab-buttons {
    display: flex;
    border-bottom: 1px solid $ios-border;
    margin-bottom: 20px;
    button {
      padding: 10px 20px;
      background-color: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: $ios-text-secondary;
      font-size: $ios-font-size-base;
      cursor: pointer;
      transition: all 0.2s ease;
      &.active {
        color: $ios-primary;
        border-bottom-color: $ios-primary;
        font-weight: 500;
      }
      &:hover {
        color: $ios-primary;
      }
    }
  }
}

.ranking-content {
  .ranking-section {
    margin-bottom: 30px;
    &:last-child {
      margin-bottom: 0;
    }
    h3 {
          color: $ios-text-primary;
          font-size: $ios-font-size-base;
          font-weight: 500;
          margin: 0 0 15px 0;
        }
    .ranking-list {
      .ranking-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding: 10px;
        background-color: $ios-background-secondary;
        border-radius: $ios-radius-md;
        .ranking-info {
          display: flex;
          align-items: center;
          gap: 10px;
          .rank {
            background-color: $ios-primary;
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: $ios-font-size-sm;
            font-weight: 600;
          }
          .name {
            color: $ios-text-primary;
            font-size: $ios-font-size-base;
          }
        }
        .capability-score,
        .satisfaction-score {
          display: flex;
          align-items: center;
          gap: 10px;
          .score-bar {
            width: 150px;
            height: 8px;
            background-color: $ios-border;
            border-radius: 4px;
            overflow: hidden;
            .score-fill {
              height: 100%;
              background-color: $ios-primary;
              border-radius: 4px;
            }
            .score-fill.satisfaction {
              background-color: #34c759;
            }
          }
          .score-value {
            color: $ios-text-primary;
            font-size: $ios-font-size-sm;
            font-weight: 500;
          }
        }
      }
    }
  }
}

.detail-content {
  .designer-selector {
    margin-bottom: 20px;
    select {
      width: 200px;
      padding: 8px 12px;
      border: 1px solid $ios-border;
      border-radius: $ios-radius-md;
      background-color: $ios-background;
      color: $ios-text-primary;
      font-size: $ios-font-size-base;
      cursor: pointer;
      &:focus {
        outline: none;
        border-color: $ios-primary;
        box-shadow: 0 0 0 2px rgba(0, 71, 171, 0.1);
      }
    }
  }
  .designer-detail {
    .radar-chart-section {
      margin-bottom: 30px;
      h3 {
        color: $ios-text-primary;
        font-size: $ios-font-size-base;
        font-weight: 500;
        margin: 0 0 15px 0;
      }
      .radar-chart {
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
      }
    }
    .experience-section {
      margin-bottom: 30px;
      h3 {
        color: $ios-text-primary;
        font-size: $ios-font-size-lg;
        font-weight: 500;
        margin: 0 0 15px 0;
      }
      .experience-details {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        .detail-item {
          .label {
            color: $ios-text-secondary;
            font-size: $ios-font-size-sm;
            margin-right: 5px;
          }
          .value {
            color: $ios-text-primary;
            font-size: $ios-font-size-base;
            font-weight: 500;
          }
        }
      }
    }
    .reason-analysis {
      h3 {
        color: $ios-text-primary;
        font-size: $ios-font-size-lg;
        font-weight: 500;
        margin: 0 0 15px 0;
      }
      p {
        color: $ios-text-primary;
        font-size: $ios-font-size-base;
        line-height: 1.6;
        margin: 0;
        padding: 10px;
        background-color: $ios-background-secondary;
        border-radius: $ios-radius-md;
      }
    }
  }
  .select-prompt {
    text-align: center;
    color: $ios-text-secondary;
    padding: 20px;
    font-size: $ios-font-size-base;
  }

/* 绩效管理与721考核 */
.performance-section {
  background-color: $ios-background-secondary;
  border-radius: $ios-radius-md;
  padding: $ios-spacing-lg;
  box-shadow: $ios-shadow-card;
}

.quarter-selector {
  display: flex;
  gap: 10px;
  select {
    padding: 8px 12px;
    border: 1px solid $ios-border;
    border-radius: $ios-radius-md;
    background-color: $ios-background-secondary;
    color: $ios-text-primary;
    font-size: $ios-font-size-base;
    cursor: pointer;
    &:focus {
      outline: none;
      border-color: $ios-primary;
      box-shadow: 0 0 0 2px rgba(0, 71, 171, 0.1);
    }
  }
}

.performance-content {
  .distribution-section {
    margin-bottom: 30px;
    h3 {
      color: $ios-text-primary;
      font-size: $ios-font-size-lg;
      font-weight: $ios-font-weight-medium;
      margin: 0 0 15px 0;
    }
    .distribution-chart {
      display: flex;
      gap: 20px;
      .distribution-item {
        flex: 1;
        padding: 15px;
        border-radius: $ios-radius-md;
        .distribution-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 10px;
          h4 {
            color: white;
            font-size: $ios-font-size-base;
            font-weight: $ios-font-weight-medium;
            margin: 0;
          }
          .count {
            color: white;
            font-size: $ios-font-size-xs;
            background-color: rgba(255, 255, 255, 0.2);
            padding: 2px 6px;
            border-radius: $ios-radius-full;
          }
        }
        .distribution-list {
          margin-bottom: 10px;
          .performer-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 5px;
            margin-bottom: 5px;
            border-radius: $ios-radius-md;
            .name {
              color: white;
              font-size: $ios-font-size-xs;
            }
            .score {
              color: white;
              font-size: $ios-font-size-xs;
              font-weight: $ios-font-weight-medium;
            }
          }
        }
        .distribution-actions {
          text-align: center;
        }
        &.top {
          background-color: #34c759;
          .performer-item.top {
            background-color: rgba(255, 255, 255, 0.1);
          }
        }
        &.middle {
          background-color: #ff9500;
          .performer-item.middle {
            background-color: rgba(255, 255, 255, 0.1);
          }
        }
        &.bottom {
          background-color: #ff3b30;
          .performer-item.bottom {
            background-color: rgba(255, 255, 255, 0.1);
          }
        }
      }
    }
  }
  .performance-detail-section {
    h3 {
      color: $ios-text-primary;
      font-size: $ios-font-size-lg;
      font-weight: $ios-font-weight-medium;
      margin: 0 0 15px 0;
    }
    .performance-detail-list {
      .performance-detail-item {
        background-color: $ios-background-secondary;
        border-radius: $ios-radius-md;
        padding: 15px;
        margin-bottom: 10px;
        .detail-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 10px;
          .name {
            color: $ios-text-primary;
            font-size: $ios-font-size-base;
            font-weight: $ios-font-weight-medium;
          }
          .total-score {
            color: $ios-primary;
            font-size: $ios-font-size-base;
            font-weight: $ios-font-weight-semibold;
          }
        }
        .score-breakdown {
          display: flex;
          flex-wrap: wrap;
          gap: 15px;
          margin-bottom: 10px;
          .score-item {
            .label {
              color: $ios-text-secondary;
              font-size: $ios-font-size-xs;
              margin-right: 5px;
            }
            .value {
              color: $ios-text-primary;
              font-size: $ios-font-size-base;
              font-weight: $ios-font-weight-medium;
            }
            &.deduction {
              .value {
                color: $ios-danger;
              }
            }
          }
        }
        .performance-actions {
          display: flex;
          gap: 8px;
        }
      }
    }
  }
}

/* 按钮样式 */
.btn-view,
.btn-adjust,
.btn-info,
.btn-generate,
.btn-sync {
  padding: 6px 12px;
  border: none;
  border-radius: $ios-radius-md;
  font-size: $ios-font-size-xs;
  font-weight: $ios-font-weight-medium;
  cursor: pointer;
  transition: all 0.2s ease;
  &:hover {
    opacity: 0.9;
  }
  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.btn-view {
  background-color: $ios-primary;
  color: white;
}

.btn-adjust {
  background-color: #ff9500;
  color: white;
}

.btn-info {
  background-color: white;
  color: $ios-primary;
  border: 1px solid $ios-primary;
}

.btn-generate {
  background-color: $ios-primary;
  color: white;
  padding: 8px 16px;
}

.btn-sync {
  background-color: #34c759;
  color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .team-management-main {
    padding: 10px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .search-filter {
    flex-direction: column;
    width: 100%;
    input,
    select {
      width: 100%;
    }
  }
  
  .task-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    .task-actions {
      width: 100%;
      justify-content: flex-end;
    }
  }
  
  .distribution-chart {
    flex-direction: column;
  }
  
  .score-breakdown {
    flex-direction: column;
    gap: 5px !important;
  }
  
  .quarter-selector {
    flex-direction: column;
    width: 100%;
    select {
      width: 100%;
    }
  }
  
  .radar-chart svg {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 480px) {
  .task-meta {
    flex-direction: column;
    gap: 5px !important;
  }
  
  .experience-details {
    flex-direction: column;
    gap: 5px !important;
  }
  
  .radar-chart svg {
    width: 200px;
    height: 200px;
  }
}