@import '~@/utils/utils.less';

// 使用与OnBoarding相同的基础样式
.container {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background-color: #f5f6fa;
}

.mainContent {
  height: 100vh;
  overflow: hidden;
  
  .contentCard {
    height: 100%;
    border: none !important;
    
    :global(.ant-card-body) {
      padding: 12px 24px;
      // height: calc(100vh - 24px);
      // overflow: hidden;
    }
  }
}

// 组织架构树样式 - 与OnBoarding保持一致
.treeCard {
  height: 600px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;

  .treeContainer {
    height: 520px;
    overflow-y: auto;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.02);
    }

    &::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 3px;
      
      &:hover {
        background: rgba(0, 0, 0, 0.25);
      }
    }
  }

  .orgTree {
    .ant-tree-node-content-wrapper {
      border-radius: 4px;
      transition: all 0.3s ease;
      padding: 4px 8px;

      &:hover {
        background-color: #f0f9ff;
        transform: translateX(2px);
      }

      &.ant-tree-node-selected {
        background-color: #e6f7ff !important;
        box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
      }
    }
  }
}

.tree-node-title {
  display: flex;
  align-items: center;
  width: 100%;

  .node-title {
    flex: 1;
    font-size: 14px;
    margin-left: 8px;
    color: #333;
  }

  .node-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
  }
}

// 主卡片样式
.mainCard {
  height: calc(100vh - 60px);
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  
  .ant-card-body {
    padding: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
}

// 内容区域
.content {
  flex: 1;
  padding: 20px 24px 28px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; // 关键：允许flex子元素收缩
  height: calc(100vh - 110px); // 减去头部高度和其他空间，强制设置高度
  max-height: calc(100vh - 110px); // 明确最大高度，确保滚动条出现
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;

    &:hover {
      background: rgba(0, 0, 0, 0.28);
    }
  }
  
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) rgba(0, 0, 0, 0.02);
}

// 信息卡片
.infoCard {
  margin-bottom: 24px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  .ant-card-body {
    padding: 24px;
  }
}

.courseCard {
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  .ant-card-body {
    padding: 24px;
  }
}

// 培训计划头部
.planHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  
  .planInfo {
    flex: 1;
    
    .planTitle {
      margin: 0 0 8px 0 !important;
      font-size: 24px !important;
      font-weight: 700 !important;
      color: #333 !important;
    }
    
    .planMeta {
      .metaItem {
        color: #666;
        font-size: 14px;
        
        .metaIcon {
          margin-right: 4px;
          color: #999;
        }
      }
    }
  }
  
  .planActions {
    display: flex;
    gap: 12px;
  }
}

// 按钮样式
.editBtn {
  background: linear-gradient(135deg, #2d5cf6 0%, #4c7bff 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(45, 92, 246, 0.3);
  
  &:hover {
    background: linear-gradient(135deg, #4c7bff 0%, #6b8fff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 92, 246, 0.4);
  }
}

.shareBtn,
.filterBtn,
.exportBtn {
  border-color: #d9d9d9;
  transition: all 0.3s ease;
  
  &:hover {
    border-color: #2d5cf6;
    color: #2d5cf6;
    transform: translateY(-1px);
  }
}

.addBtn {
  background: linear-gradient(135deg, #2d5cf6 0%, #4c7bff 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(45, 92, 246, 0.3);
  
  &:hover {
    background: linear-gradient(135deg, #4c7bff 0%, #6b8fff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 92, 246, 0.4);
  }
}

// 统计卡片
.statsRow {
  margin-bottom: 24px;
  
  .statCard {
    padding: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    
    .statLabel {
      color: #666;
      font-size: 12px;
      margin-bottom: 4px;
    }
    
    .statValue {
      font-weight: 600;
      font-size: 16px;
      color: #333;
    }
  }
}

// 描述区域
.description {
  .descTitle {
    margin: 0 0 8px 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
  }
  
  .descContent {
    margin: 0 !important;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
  }
}

// 课程区域
.courseHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  
  .courseTitle {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #333 !important;
  }
}

// 表格样式
.courseTable {
  .table {
    .ant-table-thead > tr > th {
      background-color: #fafafa;
      border-bottom: 1px solid #e8e8e8;
      font-weight: 600;
      color: #333;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    
    .ant-table-tbody > tr {
      transition: all 0.3s ease;
      
      &:hover {
        background-color: #f8f9fa !important;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      }
      
      > td {
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
        color: #333;
        padding: 12px 24px;
      }
    }
  }
}

// 类型标签
.typeTag {
  border-radius: 12px;
  font-size: 12px;
  padding: 2px 8px;
  border: none;
}

// 操作按钮
.actionBtn {
  color: #2d5cf6;
  
  &:hover {
    background: rgba(45, 92, 246, 0.1);
    color: #2d5cf6;
  }
}

.deleteBtn {
  color: #ff4d4f;
  
  &:hover {
    background: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
  }
}

.enterBtn {
  color: #2d5cf6;
  padding: 0;
  font-size: 14px;
  
  &:hover {
    text-decoration: underline;
  }
}

// 分页容器
.paginationContainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  
  .paginationInfo {
    color: #666;
    font-size: 14px;
  }
  
  .pagination {
    .ant-pagination-item {
      border-radius: 4px;
      
      &.ant-pagination-item-active {
        background: #2d5cf6;
        border-color: #2d5cf6;
      }
    }
    
    .ant-pagination-prev,
    .ant-pagination-next {
      border-radius: 4px;
    }
  }
}

// 响应式设计
@media (max-width: 1200px) {
  .treeCard {
    height: 300px;
  }
  
  .mainCard {
    height: auto;
    max-height: 80vh;
    min-height: 500px;
    
    .content {
      max-height: 65vh;
      
      &::-webkit-scrollbar {
        width: 4px;
      }
    }
  }
  
  .planHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .statsRow {
    .statCard {
      margin-bottom: 12px;
    }
  }
  
  .courseHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

// 页面特定样式
.container {
  .ant-btn-primary {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
  }
  
  .ant-btn:not(.ant-btn-primary) {
    border-radius: 6px;
    transition: all 0.3s ease;
    
    &:hover,
    &:focus {
      border-color: #4c7bff;
      color: #2d5cf6;
    }
  }
}