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

/* 考勤详情页面样式 */
.attendance-details-page {
  padding: 24px;
  background-color: #f5f5f5;
  min-height: 90vh;
  max-height: 90vh; /* 限制最大高度 */
  overflow-y: auto; /* 添加垂直滚动条 */
  overflow-x: hidden; /* 隐藏水平滚动条 */

  /* 自定义滚动条样式 */
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    
    &:hover {
      background: #a8a8a8;
    }
  }

  .ant-card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      transform: translateY(-2px);
    }
  }
}

/* 查询条件样式 */
.search-section {
  margin-bottom: 16px;
  flex-shrink: 0; /* 防止被压缩 */

  .form-item {
    margin-bottom: 16px;

    .form-label {
      display: block;
      font-size: 14px;
      font-weight: 500;
      color: #262626;
      margin-bottom: 8px;
    }
  }
}

/* 卡片行样式 */
.cards-row {
  margin-bottom: 16px;
  flex-shrink: 0; /* 防止被压缩 */
}

/* 员工信息卡片 */
.info-card {
  height: 255px; /* 设置固定高度 */

  .ant-card-body {
    height: calc(100% - 57px);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容溢出 */
  }

  .employee-info {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;

    .employee-details {
      margin-left: 16px;

      h3 {
        font-size: 18px;
        font-weight: 600;
        color: #262626;
        margin: 0 0 4px 0;
      }

      p {
        font-size: 14px;
        color: #8c8c8c;
        margin: 0;
      }
    }
  }

  .employee-meta {
    flex: 1;
    overflow-y: auto; /* 如果内容过多，添加滚动 */

    .meta-item {
      display: flex;
      margin-bottom: 12px;

      .meta-label {
        font-size: 14px;
        color: #8c8c8c;
        width: 80px;
        flex-shrink: 0;
      }

      span:last-child {
        font-size: 14px;
        color: #262626;
      }
    }
  }
}

/* 考勤状态卡片 */
.status-card {
  height: 255px; /* 设置固定高度 */

  .ant-card-body {
    height: calc(100% - 57px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .status-info {
    flex: 1;
    display: flex;
    flex-direction: column;

    .status-badge {
      display: flex;
      align-items: center;
      margin-bottom: 16px;
      flex-shrink: 0;

      .status-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: #52c41a;
        margin-right: 8px;
      }

      span {
        font-size: 14px;
        font-weight: 500;
        color: #262626;
      }
    }

    .status-details {
      flex: 1;
      overflow-y: auto;

      p {
        font-size: 14px;
        color: #595959;
        margin: 0 0 12px 0;
        line-height: 1.4;
      }
    }
  }
}

/* 操作按钮卡片 */
.action-card {
  height: 255px; /* 设置固定高度 */

  .ant-card-body {
    height: calc(100% - 57px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .action-buttons {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .ant-row {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .ant-col:last-child {
      margin-top: auto;
    }

    .ant-btn {
      font-size: 12px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}

/* 表格样式 */
.table-section {
  margin-bottom: 16px;
  flex-shrink: 0;

  .ant-table-thead > tr > th {
    background-color: #fafafa;
    font-weight: 500;
  }

  .ant-table-tbody > tr:hover > td {
    background-color: #f5f5f5;
  }

  /* 表格内部滚动 */
  .ant-table-body {
    max-height: 400px;
    overflow-y: auto;
  }
}

/* 排班数据卡片 */
.schedule-card {
  height: 280px; /* 设置固定高度 */

  .ant-card-body {
    height: calc(100% - 57px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .schedule-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    
    .schedule-item {
      display: flex;
      justify-content: space-between;
      margin-bottom: 9px;
      font-size: 14px;

      span:first-child {
        color: #8c8c8c;
      }

      span:last-child {
        font-weight: 500;
        color: #262626;
      }
    }

    .schedule-button {
      margin-top: auto;
      // padding-top: 16px;
      // border-top: 1px solid #f0f0f0;
      flex-shrink: 0;
    }
  }
}

/* 考勤统计卡片 */
.statistics-card {
  height: 280px; /* 设置固定高度 */

  .ant-card-body {
    height: calc(100% - 57px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .statistics-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    
    .stat-item {
      display: flex;
      justify-content: space-between;
      margin-bottom: 9px;
      font-size: 14px;

      span:first-child {
        color: #8c8c8c;
      }

      span:last-child {
        font-weight: 500;
        color: #262626;
      }
    }

    .stat-button {
      margin-top: auto;
      // padding-top: 16px;
      // border-top: 1px solid #f0f0f0;
      flex-shrink: 0;
    }
  }
}

/* 同步信息卡片 */
.sync-card {
  height: 280px; /* 设置固定高度 */

  .ant-card-body {
    height: calc(100% - 57px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .sync-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    
    .sync-item {
      display: flex;
      justify-content: space-between;
      margin-bottom: 12px;
      font-size: 14px;

      span:first-child {
        color: #8c8c8c;
      }

      span:last-child {
        font-weight: 500;
        color: #262626;
      }
    }

    .success-text {
      color: #52c41a !important;
    }

    .sync-buttons {
      margin-top: auto;
      padding-top: 16px;
      border-top: 1px solid #f0f0f0;
      flex-shrink: 0;
    }
  }
}

/* 图表区域样式 */
.chart-section {
  flex-shrink: 0;

  .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;

    h3 {
      font-size: 18px;
      font-weight: 600;
      color: #262626;
      margin: 0;
    }

    .chart-actions {
      display: flex;
      gap: 8px;
    }
  }

  .chart-container {
    height: 320px;
    width: 100%;
  }
}

/* 响应式样式 */
@media (max-width: 768px) {
  .attendance-details-page {
    padding: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .info-card,
  .status-card,
  .action-card,
  .schedule-card,
  .statistics-card,
  .sync-card {
    height: auto; /* 移动端自适应高度 */
    min-height: 200px;
  }

  .chart-header {
    flex-direction: column;
    align-items: stretch !important;

    .chart-actions {
      margin-top: 12px;
      justify-content: center;
    }
  }

  .employee-info {
    flex-direction: column;
    text-align: center;

    .employee-details {
      margin-left: 0 !important;
      margin-top: 12px;
    }
  }

  .chart-container {
    height: 250px; /* 移动端降低图表高度 */
  }
}

/* Firefox 滚动条样式 */
.attendance-details-page {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}