@use '../ios-theme.scss' as *;

:host {
  display: block;
  background-color: $ios-background-secondary;
  min-height: 100vh;
  padding: $ios-spacing-lg;
}

.dashboard-header {
  margin-bottom: $ios-spacing-xxl;
  h1 {
    font-size: $ios-font-size-xl;
    font-weight: $ios-font-weight-bold;
    color: $ios-text-primary;
    margin: 0 0 $ios-spacing-lg 0;
  }
  
  // 核心数据指标卡片样式
  .dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: $ios-spacing-lg;
    margin-top: $ios-spacing-lg;
    
    .metric-card {
      display: flex;
      align-items: center;
      gap: $ios-spacing-md;
      background: linear-gradient(135deg, $ios-card-background, #f8f9fa);
      border-radius: $ios-radius-lg;
      padding: $ios-spacing-lg;
      border: 1px solid $ios-border;
      box-shadow: $ios-shadow-sm;
      cursor: pointer;
      transition: all 0.3s ease;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: $ios-shadow-card;
      }
      
      .metric-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: $ios-radius-full;
        background-color: $ios-background;
      }
      
      .metric-icon.warning {
        background-color: rgba(255, 149, 0, 0.1);
      }
      
      .metric-icon.info {
        background-color: rgba(59, 130, 246, 0.1);
      }
      
      .metric-icon.primary {
        background-color: rgba(124, 58, 237, 0.1);
      }
      
      .metric-content {
        flex: 1;
      }
      
      .metric-count {
        font-size: 2rem;
        font-weight: $ios-font-weight-bold;
        color: $ios-text-primary;
        line-height: 1.2;
      }
      
      .metric-label {
        font-size: $ios-font-size-sm;
        color: $ios-text-secondary;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
    }
  }
}

.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
}

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

.section-filters {
  display: flex;
  gap: $ios-spacing-md;
  
  // 自定义选择框样式
  .custom-select {
    padding: $ios-spacing-sm $ios-spacing-md;
    border: 1px solid $ios-border;
    border-radius: $ios-radius-md;
    background-color: $ios-background;
    font-size: $ios-font-size-sm;
    color: $ios-text-primary;
    cursor: pointer;
    transition: all 0.2s ease;
    
    &:focus {
      outline: none;
      border-color: $ios-primary;
      box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
    }
    
    // 支持数百项目的下拉筛选器
    &.project-selector {
      min-width: 200px;
      max-height: 40px;
    }
  }
}

/* 项目监控大盘样式 */
.monitoring-section {
  background-color: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-xl;
  margin-bottom: $ios-spacing-xl;
  box-shadow: $ios-shadow-card;
  position: relative;
  overflow: hidden;
  
  // 科技感背景元素
  &::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), transparent);
    border-radius: 50%;
    transform: translate(50%, -50%);
    z-index: 0;
  }
}

/* 项目看板样式 - 横向展开10个项目阶段 */
.project-kanban {
  position: relative;
  z-index: 1;
  
  // 看板标题行
  .kanban-header {
    display: flex;
    gap: $ios-spacing-md;
    margin-bottom: $ios-spacing-md;
    
    .kanban-column-header {
      flex: 1;
      min-width: 180px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: $ios-spacing-sm $ios-spacing-md;
      background-color: $ios-background;
      border-radius: $ios-radius-md;
      border: 1px solid $ios-border;
      
      h3 {
        font-size: $ios-font-size-sm;
        font-weight: $ios-font-weight-medium;
        color: $ios-text-primary;
        margin: 0;
      }
      
      .stage-count {
        font-size: $ios-font-size-xs;
        background-color: $ios-primary;
        color: $ios-background;
        padding: 2px 8px;
        border-radius: $ios-radius-full;
        font-weight: $ios-font-weight-medium;
      }
    }
  }
  
  // 看板主体内容
  .kanban-body {
    display: flex;
    gap: $ios-spacing-md;
    overflow-x: auto;
    padding-bottom: $ios-spacing-md;
    
    // 滚动条样式
    &::-webkit-scrollbar {
      height: 6px;
    }
    
    &::-webkit-scrollbar-track {
      background: $ios-background;
      border-radius: $ios-radius-full;
    }
    
    &::-webkit-scrollbar-thumb {
      background: $ios-border;
      border-radius: $ios-radius-full;
    }
    
    &::-webkit-scrollbar-thumb:hover {
      background: $ios-text-tertiary;
    }
    
    // 看板列
    .kanban-column {
      flex: 1;
      min-width: 180px;
      max-width: 180px;
      height: 400px;
      background-color: $ios-background;
      border-radius: $ios-radius-md;
      border: 1px solid $ios-border;
      padding: $ios-spacing-sm;
      overflow-y: auto;
      
      // 滚动条样式
      &::-webkit-scrollbar {
        width: 4px;
      }
      
      &::-webkit-scrollbar-track {
        background: transparent;
      }
      
      &::-webkit-scrollbar-thumb {
        background: $ios-border;
        border-radius: $ios-radius-full;
      }
      
      // 项目卡片
      .project-card {
        background-color: $ios-card-background;
        border-radius: $ios-radius-md;
        padding: $ios-spacing-md;
        margin-bottom: $ios-spacing-sm;
        border: 1px solid $ios-border;
        box-shadow: $ios-shadow-sm;
        transition: all 0.2s ease;
        
        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        }
        
        &.overdue {
          border-left: 4px solid $ios-danger;
        }
        
        &.high-urgency {
          border-left: 4px solid $ios-warning;
        }
        
        .project-card-header {
          display: flex;
          justify-content: space-between;
          align-items: flex-start;
          margin-bottom: $ios-spacing-sm;
          
          h4 {
            font-size: $ios-font-size-sm;
            font-weight: $ios-font-weight-medium;
            color: $ios-primary;
            margin: 0;
            cursor: pointer;
            &:hover {
              text-decoration: underline;
            }
          }
          
          .project-urgency {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: $ios-radius-full;
            font-weight: $ios-font-weight-medium;
          }
          
          .urgency-high {
            background-color: rgba(239, 68, 68, 0.1);
            color: $ios-danger;
          }
          
          .urgency-medium {
            background-color: rgba(255, 149, 0, 0.1);
            color: $ios-warning;
          }
          
          .urgency-low {
            background-color: rgba(59, 130, 246, 0.1);
            color: $ios-info;
          }
        }
        
        .project-card-content {
          margin-bottom: $ios-spacing-sm;
          
          p {
            font-size: 11px;
            color: $ios-text-secondary;
            margin: 0 0 4px 0;
          }
          
          .deadline {
            font-size: 10px;
            color: $ios-text-tertiary;
          }
        }
        
        .project-card-footer {
          display: flex;
          gap: 4px;
          
          button {
            flex: 1;
            font-size: 10px;
            padding: 4px 6px;
            border: none;
            border-radius: $ios-radius-sm;
            cursor: pointer;
            transition: all 0.2s ease;
          }
          
          .btn-view {
            background-color: $ios-primary;
            color: $ios-background;
          }
          
          .btn-assign {
            background-color: $ios-success;
            color: $ios-background;
          }
          
          button:hover {
            opacity: 0.9;
          }
        }
      }
      
      // 空状态
      .empty-column {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        
        .empty-icon {
          font-size: 2rem;
          margin-bottom: $ios-spacing-sm;
          opacity: 0.3;
        }
        
        p {
          font-size: $ios-font-size-sm;
          color: $ios-text-tertiary;
          margin: 0;
        }
      }
    }
  }
}

/* 快速操作面板样式 */
.quick-actions-section {
  background-color: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-xl;
  margin-bottom: $ios-spacing-xl;
  box-shadow: $ios-shadow-card;
  
  .quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: $ios-spacing-lg;
    
    .action-card {
      background: linear-gradient(135deg, $ios-background, #f8f9fa);
      border-radius: $ios-radius-lg;
      padding: $ios-spacing-xl;
      border: 1px solid $ios-border;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s ease;
      
      &:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        border-color: $ios-primary-light;
      }
      
      .action-icon {
        font-size: 2.5rem;
        margin-bottom: $ios-spacing-md;
        opacity: 0.8;
      }
      
      h3 {
        font-size: $ios-font-size-base;
        font-weight: $ios-font-weight-medium;
        color: $ios-text-primary;
        margin: 0 0 $ios-spacing-xs 0;
      }
      
      p {
        font-size: $ios-font-size-sm;
        color: $ios-text-secondary;
        margin: 0;
      }
    }
  }
}

/* 待办任务样式 */
.todo-section {
  background-color: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-xl;
  margin-bottom: $ios-spacing-xl;
  box-shadow: $ios-shadow-card;
}

.todo-list {
  .todo-item {
    padding: $ios-spacing-lg;
    border-radius: $ios-radius-md;
    margin-bottom: $ios-spacing-md;
    background-color: $ios-background;
    border: 1px solid $ios-border;
    transition: $ios-feedback-hover;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    &.priority-high {
      border-left: 4px solid $ios-danger;
    }
    
    &.priority-medium {
      border-left: 4px solid $ios-warning;
    }
    
    &.priority-low {
      border-left: 4px solid $ios-info;
    }
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: $ios-shadow-sm;
    }
    
    .todo-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: $ios-spacing-md;
      
      h3 {
        font-size: $ios-font-size-base;
        font-weight: $ios-font-weight-medium;
        color: $ios-text-primary;
        margin: 0;
      }
      
      .task-priority {
        font-size: $ios-font-size-xs;
        padding: $ios-spacing-xs $ios-spacing-sm;
        border-radius: $ios-radius-full;
        font-weight: $ios-font-weight-medium;
      }
    }
    
    .todo-info {
      margin-bottom: $ios-spacing-md;
      
      p {
        margin: 0 0 $ios-spacing-xs 0;
        font-size: $ios-font-size-sm;
        color: $ios-text-secondary;
      }
      
      .task-deadline {
        font-size: $ios-font-size-xs;
        color: $ios-text-tertiary;
      }
    }
    
    .todo-actions {
      .btn-handle {
        background-color: $ios-primary;
        color: $ios-background;
        border: none;
        border-radius: $ios-radius-md;
        padding: $ios-spacing-sm $ios-spacing-lg;
        font-size: $ios-font-size-sm;
        font-weight: $ios-font-weight-medium;
        cursor: pointer;
        transition: $ios-feedback-tap;
        
        &:hover {
          background-color: $ios-primary-light;
        }
      }
    }
  }
}

/* 超期提醒样式 */
.overdue-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: $ios-card-background;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-xl;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 400px;
  animation: slideIn 0.3s ease-out;
  
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translate(-50%, -60%);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }
  
  .alert-content {
    h3 {
      font-size: $ios-font-size-lg;
      font-weight: $ios-font-weight-semibold;
      color: $ios-danger;
      margin: 0 0 $ios-spacing-lg 0;
      display: flex;
      align-items: center;
      gap: $ios-spacing-sm;
    }
    
    ul {
      margin: 0 0 $ios-spacing-lg 0;
      padding-left: $ios-spacing-xl;
      
      li {
        font-size: $ios-font-size-base;
        color: $ios-text-primary;
        margin-bottom: $ios-spacing-sm;
        
        &:last-child {
          margin-bottom: 0;
        }
      }
    }
    
    .alert-actions {
      display: flex;
      gap: $ios-spacing-md;
      justify-content: flex-end;
      
      .btn-view-all {
        background-color: $ios-primary;
        color: $ios-background;
        border: none;
        border-radius: $ios-radius-md;
        padding: $ios-spacing-sm $ios-spacing-lg;
        font-size: $ios-font-size-sm;
        font-weight: $ios-font-weight-medium;
        cursor: pointer;
        transition: $ios-feedback-tap;
        
        &:hover {
          background-color: $ios-primary-light;
        }
      }
      
      .btn-close {
        background-color: $ios-text-tertiary;
        color: $ios-text-primary;
        border: none;
        border-radius: $ios-radius-md;
        padding: $ios-spacing-sm $ios-spacing-lg;
        font-size: $ios-font-size-sm;
        font-weight: $ios-font-weight-medium;
        cursor: pointer;
        transition: $ios-feedback-tap;
        
        &:hover {
          background-color: $ios-text-secondary;
          color: $ios-background;
        }
      }
    }
  }
}