@use 'variables';
@use 'ios-theme' as ios;
// HR模块通用对话框样式
// 基于新增员工面板的设计，提供统一的对话框外观

// 对话框容器样式
.hr-dialog {
  .mat-mdc-dialog-container .mdc-dialog__surface {
    border-radius: ios.$ios-radius-lg;
    background: ios.$ios-card-background;
    box-shadow: ios.$ios-shadow-lg;
    border: 1px solid ios.$ios-border;
    min-width: 500px;
    max-width: 700px;
  }

  .mat-mdc-dialog-title {
    color: ios.$ios-text-primary;
    font-weight: ios.$ios-font-weight-semibold;
    font-family: ios.$ios-font-family;
    display: flex;
    align-items: center;
    gap: ios.$ios-spacing-sm;
    padding: ios.$ios-spacing-lg ios.$ios-spacing-lg ios.$ios-spacing-md;
    margin: 0;
    border-bottom: 1px solid ios.$ios-border;

    mat-icon {
      color: ios.$ios-primary;
      font-size: 24px;
      width: 24px;
      height: 24px;
    }
  }

  .mat-mdc-dialog-content {
    padding: ios.$ios-spacing-lg;
    font-family: ios.$ios-font-family;
    max-height: 70vh;
    overflow-y: auto;

    // 表单样式
    .employee-form,
    .dialog-content {
      display: flex;
      flex-direction: column;
      gap: ios.$ios-spacing-md;
    }

    .form-row {
      display: flex;
      gap: ios.$ios-spacing-md;
      margin-bottom: ios.$ios-spacing-sm;

      .form-group {
        flex: 1;
      }
    }

    .form-group {
      display: flex;
      flex-direction: column;
      margin-bottom: ios.$ios-spacing-xs;

      label {
        font-weight: 500;
        margin-bottom: 6px;
        color: #333;
        font-size: 14px;
        margin-bottom: ios.$ios-spacing-xs;
      }

      .mat-mdc-form-field {
        border-radius: ios.$ios-radius-md;
        
        .mat-mdc-text-field-wrapper {
          background: white;
          border: 1px solid #e0e0e0;
          border-radius: 8px;
          transition: all 0.3s ease;

          &:hover {
            border-color: ios.$ios-primary;
          }
        }

        .mat-mdc-form-field-subscript-wrapper {
          color: ios.$ios-text-secondary;
          font-family: ios.$ios-font-family;
          font-weight: ios.$ios-font-weight-medium;
        }

        .mat-mdc-form-field-infix {
          color: ios.$ios-text-primary;
          font-family: ios.$ios-font-family;
          padding: ios.$ios-spacing-sm;
        }

        .mat-mdc-form-field-error {
          color: ios.$ios-error;
          font-family: ios.$ios-font-family;
          font-size: ios.$ios-font-size-caption-1;
          margin-top: ios.$ios-spacing-xs;
        }

        // 选择框样式
        .mat-mdc-select-value {
          color: ios.$ios-text-primary;
          font-family: ios.$ios-font-family;
          padding: ios.$ios-spacing-sm 0;
        }

        .mat-mdc-select-arrow {
          color: ios.$ios-text-secondary;
          transition: transform 0.3s ease;
        }

        &.mat-focused .mat-mdc-select-arrow {
          color: ios.$ios-primary;
        }

        // 输入框样式
        .mat-mdc-input-element {
          color: ios.$ios-text-secondary;
        }

        &.mat-focused .mat-mdc-input-element {
          color: ios.$ios-primary;
        }
      }
    }

    // 表单字段样式
    mat-form-field {
      margin-bottom: ios.$ios-spacing-xs;
      
      .mat-mdc-form-field-outline {
        border-radius: ios.$ios-radius-md;
        border-color: rgba(0, 122, 255, 0.2);
        transition: all 0.3s ease;
      }

      &:hover .mat-mdc-form-field-outline {
        border-color: rgba(0, 122, 255, 0.4);
      }

      &.mat-focused .mat-mdc-form-field-outline {
        border-color: ios.$ios-primary;
        border-width: 2px;
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
      }

      .mat-mdc-form-field-label {
        color: ios.$ios-text-secondary;
        font-family: ios.$ios-font-family;
        font-weight: ios.$ios-font-weight-medium;
      }

      .mat-mdc-input-element {
        color: ios.$ios-text-primary;
        font-family: ios.$ios-font-family;
        padding: ios.$ios-spacing-sm;
      }

      .mat-mdc-form-field-error.error-message {
        color: ios.$ios-error;
        font-family: ios.$ios-font-family;
        font-size: ios.$ios-font-size-caption-1;
        margin-top: ios.$ios-spacing-xs;
      }

      // 选择框样式
      .mat-mdc-select-value {
        color: ios.$ios-text-primary;
        font-family: ios.$ios-font-family;
        padding: ios.$ios-spacing-sm 0;
      }

      .mat-mdc-select-arrow {
        color: ios.$ios-text-secondary;
        transition: transform 0.3s ease;
      }

      &.mat-focused .mat-mdc-select-arrow {
        transform: rotate(180deg);
        color: ios.$ios-primary;
      }

      // 后缀图标样式
      .mat-mdc-form-field-icon-suffix {
        color: ios.$ios-text-secondary;
        transition: color 0.3s ease;
      }

      &:hover .mat-mdc-form-field-icon-suffix {
        color: ios.$ios-primary;
      }
    }

    // 信息展示区域
    .info-section {
      display: flex;
      flex-direction: column;
      gap: ios.$ios-spacing-md;
    }

    .info-card {
      background: ios.$ios-background-secondary;
      border: 1px solid ios.$ios-border;
      border-radius: ios.$ios-radius-lg;
      padding: ios.$ios-spacing-lg;
      margin-top: ios.$ios-spacing-lg;

      &:hover {
        transform: translateY(-2px);
        box-shadow: ios.$ios-shadow-md;
      }

      .card-title {
        font-family: ios.$ios-font-family;
        font-weight: ios.$ios-font-weight-semibold;
        color: ios.$ios-text-primary;
        margin-bottom: ios.$ios-spacing-md;
        font-size: ios.$ios-font-size-body;
        display: flex;
        align-items: center;
        gap: ios.$ios-spacing-xs;

        mat-icon {
          color: #007AFF;
          font-size: 20px;
          width: 20px;
          height: 20px;
        }
      }

      .card-content {
        border: 1px solid ios.$ios-border;
        border-radius: ios.$ios-radius-md;
        padding: ios.$ios-spacing-lg;
        box-shadow: ios.$ios-shadow-sm;

        &:hover {
          transform: translateY(-1px);
          box-shadow: ios.$ios-shadow-md;
        }

        .preview-header {
          display: flex;
          align-items: center;
          gap: ios.$ios-spacing-md;
          margin-bottom: ios.$ios-spacing-md;

          .preview-icon {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: ios.$ios-radius-md;
            background: rgba(0, 122, 255, 0.1);
            transition: all 0.3s ease;

            &:hover {
              background: rgba(0, 122, 255, 0.2);
              transform: scale(1.1);
            }
          }

          .preview-info {
            flex: 1;

            .preview-category {
              font-size: ios.$ios-font-size-caption-1;
              color: ios.$ios-text-secondary;
              font-family: ios.$ios-font-family;
              text-transform: uppercase;
              letter-spacing: 0.5px;
              margin-bottom: ios.$ios-spacing-xs;
            }

            .preview-name {
              font-size: ios.$ios-font-size-body;
              color: ios.$ios-text-primary;
              font-family: ios.$ios-font-family;
              font-weight: ios.$ios-font-weight-medium;
            }
          }
        }

        .content-grid {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
          gap: ios.$ios-spacing-md;
          margin-bottom: ios.$ios-spacing-md;
        }

        .content-item {
          display: flex;
          flex-direction: column;
          padding: 12px;
          background: #f8f9fa;
          border-radius: ios.$ios-radius-md;

          .label {
            font-size: ios.$ios-font-size-caption-1;
            color: ios.$ios-text-secondary;
            font-family: ios.$ios-font-family;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: ios.$ios-spacing-xs;
          }

          .value {
            font-size: ios.$ios-font-size-body;
            color: ios.$ios-text-primary;
            font-family: ios.$ios-font-family;
            font-weight: ios.$ios-font-weight-medium;
          }
        }

        .highlight-section {
          display: flex;
          align-items: center;
          gap: ios.$ios-spacing-sm;
          padding: ios.$ios-spacing-md;
          background: ios.$ios-background-secondary;
          border-radius: ios.$ios-radius-sm;

          .highlight-label {
            font-size: ios.$ios-font-size-caption-1;
            color: ios.$ios-text-secondary;
            font-family: ios.$ios-font-family;
          }

          .highlight-value {
            font-size: ios.$ios-font-size-title-2;
            font-weight: ios.$ios-font-weight-bold;
            color: ios.$ios-primary;
            font-family: ios.$ios-font-family;
            display: flex;
            align-items: center;
            gap: ios.$ios-spacing-xs;

            .currency {
              font-size: ios.$ios-font-size-caption-1;
              color: ios.$ios-text-secondary;
              font-weight: ios.$ios-font-weight-regular;
            }
          }
        }
      }
    }

    .section-title {
      margin: ios.$ios-spacing-lg 0 ios.$ios-spacing-md 0;
      color: ios.$ios-text-primary;
      font-size: ios.$ios-font-size-lg;
      font-weight: ios.$ios-font-weight-semibold;
      font-family: ios.$ios-font-family;
      border-bottom: 2px solid #007AFF;
      padding-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
  }

  .mat-mdc-dialog-actions {
    padding: ios.$ios-spacing-md ios.$ios-spacing-lg ios.$ios-spacing-lg;
    border-top: 1px solid ios.$ios-border;
    gap: ios.$ios-spacing-sm;

    .mat-mdc-button {
      font-family: ios.$ios-font-family;
      border-radius: ios.$ios-radius-md;
      padding: ios.$ios-spacing-sm ios.$ios-spacing-lg;
      font-weight: 500;

      &.mat-primary {
        background: ios.$ios-primary;
        color: white;
        border: none;

        &:hover {
          background: #0056CC;
        }

        &:disabled {
          background: ios.$ios-text-tertiary;
          color: white;
        }
      }

      &.mat-stroked-button {
        color: ios.$ios-text-secondary;
        border: 1px solid #e0e0e0;

        &:hover {
          color: ios.$ios-primary;
          border-color: #007AFF;
        }
      }

      &:hover {
        box-shadow: ios.$ios-shadow-sm;
      }

      &:active {
        box-shadow: ios.$ios-shadow-md;
        transform: translateY(1px);
      }
    }
  }
}

// 特殊样式：员工详情对话框
.employee-detail-dialog {
  .mat-mdc-dialog-container .mdc-dialog__surface {
    min-width: 600px;
    max-width: 800px;
  }

  .employee-avatar {
    width: 80px;
    height: 80px;
    border-radius: ios.$ios-radius-md;
    box-shadow: ios.$ios-shadow-lg;
    border: 1px solid ios.$ios-border;
    object-fit: cover;
  }

  .employee-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: ios.$ios-font-family;
    padding: ios.$ios-spacing-sm ios.$ios-spacing-md;

    .info-text {
      flex: 1;

      .name {
        font-size: 20px;
        font-weight: 600;
        color: ios.$ios-primary;
        margin-bottom: 4px;
      }

      .position {
        color: ios.$ios-primary;
        font-weight: ios.$ios-font-weight-medium;
        font-size: 14px;
      }
    }
  }

  .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: ios.$ios-spacing-sm;
    margin: ios.$ios-spacing-md;

    .detail-item {
      display: flex;
      flex-direction: column;
      padding: 12px;
      background: #f8f9fa;
      border-radius: 8px;

      .label {
        font-size: 12px;
        color: #666;
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      .value {
        font-size: 14px;
        color: #333;
        font-weight: 500;
      }
    }
  }
}