/* HR板块统一样式文件 */

/* 字体大小调整 - 适用于整个HR板块 */
.hr-page {
  /* 基础字体大小调整 */
  font-size: 16px;
  line-height: 1.6;
  
  /* 标题字体大小 */
  h1 { font-size: 32px !important; font-weight: 700; }
  h2 { font-size: 28px !important; font-weight: 600; }
  h3 { font-size: 24px !important; font-weight: 600; }
  h4 { font-size: 20px !important; font-weight: 500; }
  h5 { font-size: 18px !important; font-weight: 500; }
  h6 { font-size: 16px !important; font-weight: 500; }
  
  /* 段落和文本 */
  p, span, div { font-size: 16px !important; }
  
  /* 小文本 */
  .small-text, small { font-size: 14px !important; }
  
  /* 表格字体 */
  .mat-table {
    font-size: 16px !important;
    
    .mat-header-cell {
      font-size: 16px !important;
      font-weight: 600 !important;
    }
    
    .mat-cell {
      font-size: 16px !important;
    }
  }
  
  /* 按钮字体 */
  .mat-button, .mat-raised-button, .mat-flat-button, .mat-stroked-button {
    font-size: 16px !important;
    font-weight: 500 !important;
  }
  
  /* 表单字体 */
  .mat-form-field {
    font-size: 16px !important;
    
    .mat-form-field-label {
      font-size: 16px !important;
    }
    
    .mat-input-element {
      font-size: 16px !important;
    }
    
    .mat-select-value {
      font-size: 16px !important;
    }
  }
  
  /* 选项卡字体 */
  .mat-tab-label {
    font-size: 16px !important;
    font-weight: 500 !important;
  }
  
  /* 卡片标题字体 */
  .mat-card-title {
    font-size: 20px !important;
    font-weight: 600 !important;
  }
  
  .mat-card-subtitle {
    font-size: 16px !important;
  }
  
  .mat-card-content {
    font-size: 16px !important;
  }
  
  /* 图标大小调整 */
  mat-icon {
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
    
    &.large-icon {
      font-size: 32px !important;
      width: 32px !important;
      height: 32px !important;
      line-height: 32px !important;
    }
    
    &.small-icon {
      font-size: 20px !important;
      width: 20px !important;
      height: 20px !important;
      line-height: 20px !important;
    }
  }
  
  /* 按钮中的图标 */
  .mat-button mat-icon,
  .mat-raised-button mat-icon,
  .mat-flat-button mat-icon,
  .mat-stroked-button mat-icon {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
  }
  
  /* 工具栏图标 */
  .mat-toolbar mat-icon {
    font-size: 28px !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
  }
  
  /* 列表项图标 */
  .mat-list-item mat-icon {
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
  }
  
  /* 芯片字体 */
  .mat-chip {
    font-size: 14px !important;
    
    mat-icon {
      font-size: 18px !important;
      width: 18px !important;
      height: 18px !important;
      line-height: 18px !important;
    }
  }
  
  /* 对话框字体 */
  .mat-dialog-title {
    font-size: 24px !important;
    font-weight: 600 !important;
  }
  
  .mat-dialog-content {
    font-size: 16px !important;
  }
  
  /* 菜单字体 */
  .mat-menu-item {
    font-size: 16px !important;
    
    mat-icon {
      font-size: 22px !important;
      width: 22px !important;
      height: 22px !important;
      line-height: 22px !important;
    }
  }
  
  /* 工具提示字体 */
  .mat-tooltip {
    font-size: 14px !important;
  }
  
  /* 分页器字体 */
  .mat-paginator {
    font-size: 14px !important;
  }
  
  /* 进度条标签 */
  .mat-progress-bar {
    height: 6px !important;
  }
  
  /* 滑块 */
  .mat-slider {
    font-size: 16px !important;
  }
}

/* 全局下拉面板样式修复 - 适用于整个HR板块 */
::ng-deep .mat-mdc-select-panel {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  max-height: 300px !important;
  
  .mat-mdc-option {
    background: transparent !important;
    color: #333 !important;
    font-size: 16px !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
    
    &:hover {
      background: rgba(30, 64, 175, 0.1) !important;
      color: #1e40af !important;
    }
    
    &.mdc-list-item--selected {
      background: rgba(30, 64, 175, 0.15) !important;
      color: #1e40af !important;
      font-weight: 600 !important;
    }
    
    &:last-child {
      border-bottom: none !important;
    }
  }
}

/* 主题色彩变量 */
$hr-primary: #1e40af;
$hr-primary-light: #3b82f6;
$hr-secondary: #0d9488;
$hr-success: #10b981;
$hr-warning: #f59e0b;
$hr-error: #ef4444;
$hr-info: #3b82f6;
$hr-text-primary: #1f2937;
$hr-text-secondary: #4b5563;
$hr-text-tertiary: #9ca3af;
$hr-bg-primary: #ffffff;
$hr-bg-secondary: #f9fafb;
$hr-bg-tertiary: #f3f4f6;
$hr-border: #e5e7eb;

/* 统一卡片样式 */
.hr-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  overflow: hidden;
  
  &:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
  }
  
  .hr-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 16px 20px;
    border-bottom: 1px solid $hr-border;
    
    .hr-card-title {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 0;
      font-size: 18px;
      font-weight: 600;
      color: $hr-text-primary;
      
      mat-icon {
        background: linear-gradient(135deg, #e6f7ff 0%, #f3e8ff 100%);
        color: $hr-primary;
        padding: 8px;
        border-radius: 50%;
        font-size: 20px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
  }
  
  .hr-card-content {
    padding: 20px;
  }
}

/* 统一表格样式 */
.hr-table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  
  .mat-header-cell {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: $hr-text-primary;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid $hr-border;
    padding: 16px 12px;
  }
  
  .mat-cell {
    padding: 16px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    
    &:last-child {
      text-align: center;
    }
  }
  
  .mat-row {
    transition: all 0.2s ease;
    
    &:hover {
      background-color: rgba(59, 130, 246, 0.05);
    }
    
    &:last-child .mat-cell {
      border-bottom: none;
    }
  }
  
  .no-data {
    text-align: center;
    color: $hr-text-tertiary;
    font-style: italic;
    padding: 40px 20px;
  }
}

/* 统一按钮样式 */
.hr-btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  
  &.hr-btn-primary {
    background: linear-gradient(135deg, $hr-primary 0%, $hr-primary-light 100%);
    color: white;
    border: none;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    }
  }
  
  &.hr-btn-secondary {
    background: linear-gradient(135deg, $hr-secondary 0%, #14b8a6 100%);
    color: white;
    border: none;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
    }
  }
  
  &.hr-btn-outline {
    background: transparent;
    border: 2px solid $hr-primary;
    color: $hr-primary;
    
    &:hover {
      background: $hr-primary;
      color: white;
      transform: translateY(-1px);
    }
  }
  
  &.hr-btn-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    
    mat-icon {
      font-size: 18px !important;
      width: 18px !important;
      height: 18px !important;
      line-height: 18px !important;
    }
  }
}

/* 统一状态徽章样式 */
.hr-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  display: inline-block;
  
  &.hr-badge-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
    color: $hr-success;
    border: 1px solid rgba(16, 185, 129, 0.3);
  }
  
  &.hr-badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.2));
    color: $hr-warning;
    border: 1px solid rgba(245, 158, 11, 0.3);
  }
  
  &.hr-badge-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.2));
    color: $hr-error;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }
  
  &.hr-badge-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
    color: $hr-info;
    border: 1px solid rgba(59, 130, 246, 0.3);
  }
}

/* 统一表单样式 */
.hr-form {
  .mat-form-field {
    width: 100%;
    margin-bottom: 16px;
    
    .mat-form-field-outline {
      border-radius: 8px;
    }
    
    &.mat-focused .mat-form-field-outline-thick {
      border-color: $hr-primary;
    }
  }
  
  .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
  }
  
  .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid $hr-border;
  }
}

/* 统一进度条样式 */
.hr-progress {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background-color: rgba(226, 232, 240, 0.5);
  
  .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    
    &.hr-progress-primary {
      background: linear-gradient(90deg, $hr-primary, $hr-primary-light);
    }
    
    &.hr-progress-success {
      background: linear-gradient(90deg, $hr-success, #34d399);
    }
    
    &.hr-progress-warning {
      background: linear-gradient(90deg, $hr-warning, #fbbf24);
    }
    
    &.hr-progress-error {
      background: linear-gradient(90deg, $hr-error, #f87171);
    }
  }
}

/* 统一统计卡片样式 */
.hr-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, $hr-primary, $hr-secondary);
  }
  
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15);
  }
  
  &.hr-stat-warning::before {
    background: linear-gradient(90deg, $hr-warning, #fbbf24);
  }
  
  &.hr-stat-error::before {
    background: linear-gradient(90deg, $hr-error, #f87171);
  }
  
  &.hr-stat-info::before {
    background: linear-gradient(90deg, $hr-info, #60a5fa);
  }
  
  &.hr-stat-success::before {
    background: linear-gradient(90deg, $hr-success, #34d399);
  }
  
  .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, $hr-text-primary, $hr-text-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .stat-label {
    font-size: 14px;
    color: $hr-text-secondary;
    font-weight: 500;
    margin-bottom: 4px;
  }
  
  .stat-sub {
    font-size: 12px;
    color: $hr-text-tertiary;
    font-weight: 400;
  }
}

/* 统一Material图标修复 */
mat-icon {
  font-family: 'Material Icons' !important;
  font-feature-settings: 'liga' 1;
  -webkit-font-feature-settings: 'liga';
  -moz-font-feature-settings: 'liga';
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: inherit;
  line-height: inherit;
  vertical-align: middle;
  
  &::before {
    content: none !important;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hr-card {
    margin: 0 8px;
    border-radius: 8px;
  }
  
  .hr-table {
    font-size: 12px;
    
    .mat-header-cell,
    .mat-cell {
      padding: 8px 6px;
    }
  }
  
  .hr-form .form-row {
    grid-template-columns: 1fr;
  }
  
  .hr-stat-card {
    .stat-value {
      font-size: 24px;
    }
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hr-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.hr-slide-in-up {
  animation: slideInUp 0.3s ease-out;
}