/**
 * 天偌装修平台 - 用户中心样式
 * Uses design-system.css tokens
 */

/* =============================================
   Animations
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-on-scroll {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animated {
  opacity: 1 !important; transform: translateY(0) !important;
}
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* =============================================
   Profile Header
   ============================================= */
.profile-header {
  background: linear-gradient(135deg, var(--dark) 0%, #0d1b33 50%, #132744 100%);
  border-radius: var(--radius-lg); padding: var(--space-xl);
  display: flex; align-items: center; gap: var(--space-lg);
  color: var(--white); position: relative; overflow: hidden;
}
.profile-header::before {
  content: ''; position: absolute; top: -30%; right: -10%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(224,123,57,.2) 0%, transparent 70%);
  border-radius: 50%;
}
.profile-header .profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid rgba(255,255,255,.3); object-fit: cover;
  position: relative; z-index: 1;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
  overflow: hidden;
}
.profile-header .profile-info { position: relative; z-index: 1; }
.profile-header .profile-name {
  font-size: 1.2rem; font-weight: 700; margin-bottom: 2px;
  display: flex; align-items: center; gap: 8px;
}
.profile-header .profile-phone { font-size: .85rem; opacity: .75; }
.profile-header .profile-actions { margin-left: auto; position: relative; z-index: 1; }

/* =============================================
   Tabs (in user center)
   ============================================= */
.uc-tabs {
  display: flex; gap: 2px; background: var(--white);
  border-radius: var(--radius); padding: 4px; margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-xs); border: 1px solid var(--border-light);
}
.uc-tab {
  flex: 1; padding: 10px 16px; text-align: center; font-size: .85rem;
  font-weight: 600; color: var(--text-secondary); border: none;
  background: transparent; cursor: pointer; border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}
.uc-tab:hover { color: var(--text); }
.uc-tab.active { background: var(--primary); color: var(--white); }

/* =============================================
   Info Card
   ============================================= */
.info-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  overflow: hidden; transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.info-card:hover { box-shadow: var(--shadow); }
.info-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: space-between;
}
.info-card-body { padding: var(--space-lg); }
.info-row {
  display: flex; align-items: center; padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  width: 90px; font-size: .85rem; color: var(--text-muted); flex-shrink: 0;
}
.info-value { font-size: .9rem; font-weight: 500; flex: 1; }

/* =============================================
   Project Card
   ============================================= */
.project-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  padding: var(--space-lg); transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary-border); }
.project-card:hover::before { transform: scaleX(1); }
.project-card .project-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--space-md);
}
.project-card .project-title { font-weight: 700; font-size: 1rem; }
.project-card .project-status { margin-bottom: var(--space-sm); }
.project-card .project-meta {
  display: flex; gap: var(--space-lg); font-size: .82rem; color: var(--text-muted);
}
.project-card .project-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--space-md); padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

/* =============================================
   Progress Steps
   ============================================= */
.progress-steps {
  display: flex; justify-content: space-between; position: relative;
  margin: var(--space-lg) 0;
}
.progress-steps::before {
  content: ''; position: absolute; top: 16px; left: 0; right: 0;
  height: 2px; background: var(--border);
}
.progress-step {
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1; flex: 1;
}
.progress-step .step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  margin-bottom: 6px; transition: var(--transition-fast);
}
.progress-step.active .step-dot {
  background: var(--primary); border-color: var(--primary); color: var(--white);
}
.progress-step.done .step-dot {
  background: var(--success); border-color: var(--success); color: var(--white);
}
.progress-step .step-label {
  font-size: .72rem; color: var(--text-muted); text-align: center;
}
.progress-step.active .step-label { color: var(--primary); font-weight: 600; }

/* =============================================
   Edit Form
   ============================================= */
.edit-section { margin-bottom: var(--space-lg); }
.edit-section-title {
  font-size: .95rem; font-weight: 700; margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border-light);
}
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column; text-align: center; padding: var(--space-lg);
  }
  .profile-header .profile-avatar { margin: 0 auto; }
  .profile-header .profile-actions { margin: var(--space-md) auto 0; }
  .uc-tabs { flex-wrap: wrap; }
  .uc-tab { flex: none; font-size: .8rem; padding: 8px 12px; }
  .progress-steps { overflow-x: auto; justify-content: flex-start; gap: var(--space-md); }
  .progress-step { min-width: 60px; }
}

/* =============================================
   Milestone Timeline (for progress modal)
   ============================================= */
.milestone-list { position: relative; padding-left: 24px; }
.milestone-list::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.milestone-item { position: relative; padding-bottom: var(--space-lg); }
.milestone-item:last-child { padding-bottom: 0; }
.milestone-item::before {
  content: ''; position: absolute; left: -20px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--border);
}
.milestone-item.done::before { background: var(--success); border-color: var(--success); }
.milestone-item.active::before { background: var(--primary); border-color: var(--primary); }
.milestone-item .milestone-title { font-weight: 600; font-size: .9rem; }
.milestone-item .milestone-date { font-size: .78rem; color: var(--text-muted); }

/* =============================================
   Project list wrapper
   ============================================= */
.project-list { display: flex; flex-direction: column; gap: var(--space-md); }

/* Status color overrides for profile header button */
.profile-header .btn-outline { color: var(--white); border-color: rgba(255,255,255,.3); }
.profile-header .btn-outline:hover { background: rgba(255,255,255,.1); }

/* =============================================
   Avatar Upload
   ============================================= */
.avatar-upload-container {
  padding: var(--space-md) 0;
}
.avatar-preview {
  transition: all 0.3s ease;
  overflow: hidden;
}
.avatar-preview:hover {
  border-color: var(--primary) !important;
  transform: scale(1.05);
}
.avatar-preview img {
  transition: transform 0.3s ease;
}
.avatar-preview:hover img {
  transform: scale(1.1);
}

/* =============================================
   Security Tab - Password Form
   ============================================= */
#changePasswordForm .form-group {
  margin-bottom: var(--space-lg);
}
#changePasswordForm .form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}
#changePasswordForm .form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#changePasswordForm .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 123, 57, 0.1);
}

/* =============================================
   Bindings Tab - 第三方账号绑定
   ============================================= */
.bindings-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.binding-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.binding-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.binding-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.binding-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wechat-icon {
  background: #07c160;
  color: white;
}

.alipay-icon {
  background: #1677ff;
  color: white;
}

.binding-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.binding-status {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
}

.binding-status.bound {
  color: var(--success);
}

.binding-status.unbound {
  color: var(--text-muted);
}

.binding-body {
  padding: var(--space-lg);
}

.binding-benefits {
  margin-bottom: var(--space-lg);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: .9rem;
  color: var(--text-secondary);
}

.benefit-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.binding-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

/* 收款说明卡片 */
.payment-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.info-item {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.info-content p {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* 微信扫码弹窗 */
.wechat-qr-modal {
  text-align: center;
}

.wechat-qr-modal .qr-container {
  margin: var(--space-lg) auto;
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius);
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.wechat-qr-modal .qr-tip {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
}

/* 绑定确认弹窗 */
.unbind-confirm-modal {
  text-align: center;
}

.unbind-confirm-modal .warning-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.unbind-confirm-modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.unbind-confirm-modal p {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.unbind-confirm-modal .modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* 响应式 */
@media (max-width: 768px) {
  .binding-header {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
  
  .binding-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .binding-actions .btn {
    width: 100%;
  }
  
  .info-item {
    flex-direction: column;
    gap: var(--space-sm);
  }
}
