@import "../../../customer-service-styles.scss";

// iOS风格咨询列表页面
.ios-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f2f2f7 0%, #e5e5ea 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

// iOS头部导航
.ios-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);

  .ios-back-btn {
    background: rgba(120, 120, 128, 0.12);
    border: none;
    border-radius: 10px;
    padding: 8px;
    color: #007AFF;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    
    &:hover {
      background: rgba(120, 120, 128, 0.16);
      transform: scale(1.05);
    }
    
    &:active {
      transform: scale(0.95);
      background: rgba(120, 120, 128, 0.2);
    }

    svg {
      width: 20px;
      height: 20px;
    }
  }

  h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.3px;
  }
}

// iOS内容区域
.ios-content {
  padding: 16px 20px 32px;
  max-width: 800px;
  margin: 0 auto;
}

// iOS搜索栏
.search-bar {
  position: relative;
  margin-bottom: 20px;

  input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(120, 120, 128, 0.12);
    transition: all 0.3s ease;
    outline: none;
    color: #1d1d1f;
    box-sizing: border-box;

    &::placeholder {
      color: rgba(60, 60, 67, 0.6);
    }

    &:focus {
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.4);
    }
  }

  svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(60, 60, 67, 0.6);
    pointer-events: none;
    width: 16px;
    height: 16px;
  }
}

// 咨询列表容器
.consultation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

// iOS风格横条卡片
.consultation-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 122, 255, 0.2);
  }

  &:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  // 紧急状态样式
  &.urgent {
    border-left: 4px solid #FF3B30;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);

    .status-badge.urgent {
      background: linear-gradient(135deg, #FF3B30 0%, #FF6B6B 100%);
      color: white;
    }
  }

  // 卡片头部
  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;

    .customer-info {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;

      .avatar {
        width: 44px;
        height: 44px;
        border-radius: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 16px;
        color: white;
        background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
      }

      div {
        flex: 1;
        min-width: 0;

        h3 {
          font-size: 17px;
          font-weight: 600;
          color: #1d1d1f;
          margin: 0 0 2px 0;
          line-height: 1.3;
        }

        .time {
          font-size: 13px;
          color: rgba(60, 60, 67, 0.6);
          margin: 0;
          font-weight: 500;
        }
      }
    }

    .status-badge {
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      background: rgba(120, 120, 128, 0.12);
      color: rgba(60, 60, 67, 0.8);
      white-space: nowrap;

      &.urgent {
        background: linear-gradient(135deg, #FF3B30 0%, #FF6B6B 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
      }
    }
  }

  // 咨询内容
  .content {
    font-size: 15px;
    color: rgba(60, 60, 67, 0.8);
    line-height: 1.4;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
  }

  // 卡片底部操作按钮
  .card-footer {
    display: flex;
    gap: 8px;
    align-items: center;

    .ios-btn {
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 600;
      border: none;
      cursor: pointer;
      transition: all 0.2s ease;
      flex: 1;
      text-align: center;

      &.primary {
        background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);

        &:hover {
          transform: translateY(-1px);
          box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
        }

        &:active {
          transform: translateY(0);
          box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
        }
      }

      &.secondary {
        background: rgba(120, 120, 128, 0.12);
        color: #007AFF;

        &:hover {
          background: rgba(120, 120, 128, 0.16);
          transform: translateY(-1px);
        }

        &:active {
          transform: translateY(0);
          background: rgba(120, 120, 128, 0.2);
        }
      }
    }
  }
}

// 空状态样式
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(60, 60, 67, 0.6);

  svg {
    margin-bottom: 16px;
    opacity: 0.5;
  }

  h3 {
    font-size: 20px;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.8);
    margin: 0 0 8px 0;
  }

  p {
    font-size: 15px;
    color: rgba(60, 60, 67, 0.6);
    margin: 0;
    font-weight: 400;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .ios-content {
    padding: 16px;
  }

  .consultation-card {
    .card-header {
      .customer-info {
        .avatar {
          width: 40px;
          height: 40px;
          border-radius: 20px;
          font-size: 14px;
        }

        div h3 {
          font-size: 16px;
        }
      }
    }

    .card-footer {
      flex-direction: column;
      gap: 8px;

      .ios-btn {
        width: 100%;
      }
    }
  }
}

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

.consultation-card {
  animation: slideInUp 0.3s ease-out;
}

// 加载动画
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  .consultation-card {
    animation: pulse 1.5s ease-in-out infinite;
  }
}