/* components.css - Premium 组件样式 */

/* ========== 球员卡片 ========== */
.player-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  border: 1px solid var(--gray-200);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.player-card.clickable { cursor: pointer; }
.player-card.clickable:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}
.player-card.selected {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 2px var(--green-glow), var(--shadow-md);
}
.player-card.compact { padding: var(--sp-2); }

.player-card-header {
  display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2);
}
.player-position {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--text-white);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.player-position.green, .player-rating.green { background: linear-gradient(135deg, #43a047, #2e7d32); }
.player-position.yellow, .player-rating.yellow { background: linear-gradient(135deg, #f9a825, #f57f17); }
.player-position.red, .player-rating.red { background: linear-gradient(135deg, #e53935, #c62828); }
.player-position.blue, .player-rating.blue { background: linear-gradient(135deg, #1e88e5, #1565c0); }
.player-position.purple, .player-rating.purple { background: linear-gradient(135deg, #8e24aa, #6a1b9a); }
.player-position.gray-rating { background: linear-gradient(135deg, #9e9e9e, #757575); }

.player-name { flex: 1; font-weight: 700; font-size: 14px; }
.player-rating {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--text-white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.player-card-body { margin-bottom: var(--sp-2); }
.player-meta { display: flex; gap: var(--sp-2); font-size: 11px; color: var(--gray-500); margin-bottom: var(--sp-1); flex-wrap: wrap; }
.player-status.injured { color: var(--red-danger); background: var(--red-light); padding: 1px 6px; border-radius: var(--radius-xs); font-size: 10px; font-weight: 600; }
.player-status.suspended { color: var(--gold-accent); background: var(--gold-light); padding: 1px 6px; border-radius: var(--radius-xs); font-size: 10px; font-weight: 600; }
.player-unavail-tag {
  color: #c62828;
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-left: 2.5px solid #c62828;
  white-space: nowrap;
}
.player-card-footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-500); }
.player-value { color: var(--green-primary); font-weight: 700; }
.player-attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: var(--sp-2); }
.attr-item { display: flex; justify-content: space-between; font-size: 11px; padding: 3px 0; }
.attr-name { color: var(--gray-500); }
.attr-val { font-weight: 700; }
.attr-val.green { color: #2e7d32; }
.attr-val.yellow { color: #f57f17; }
.attr-val.red { color: #c62828; }

/* ========== 属性进度条 ========== */
.stat-bar { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 6px; font-size: 12px; }
.stat-label { width: 40px; color: var(--gray-600); flex-shrink: 0; font-size: 11px; font-weight: 500; }
.stat-track { flex: 1; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 4px; transition: width 0.5s var(--ease-spring); }
.stat-fill.green { background: linear-gradient(90deg, #66bb6a, #2e7d32); }
.stat-fill.yellow { background: linear-gradient(90deg, #ffca28, #f57f17); }
.stat-fill.red { background: linear-gradient(90deg, #ef5350, #c62828); }
.stat-fill.blue { background: linear-gradient(90deg, #42a5f5, #1565c0); }
.stat-fill.fitness { background: linear-gradient(90deg, #26a69a, #00695c); }
.stat-fill.morale { background: linear-gradient(90deg, #ffa726, #e65100); }
.stat-value { width: 22px; text-align: right; font-weight: 700; flex-shrink: 0; font-size: 11px; }

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 1000;
  padding: 0; animation: fadeIn 0.2s;
  backdrop-filter: blur(2px);
}
.modal-overlay.large .modal-dialog { max-height: 85vh; }
.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 414px; max-height: 85vh;
  display: flex; flex-direction: column;
  animation: slideUp 0.3s var(--ease-spring);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-100); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  transition: background var(--duration-fast);
}
.modal-close:active { background: var(--gray-300); }
.modal-body { padding: var(--sp-4) var(--sp-5); overflow-y: auto; flex: 1; font-size: 14px; line-height: 1.6; }
.modal-footer {
  display: flex; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--gray-200);
  position: sticky; bottom: 0; background: var(--bg-card);
}
.modal-footer .btn { flex: 1; }

/* ========== 通知 Toast ========== */
.notification-container { position: fixed; top: 0; left: 0; right: 0; z-index: 2000; pointer-events: none; max-width: 414px; margin: 0 auto; }
.notification-toast {
  margin: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 14px;
  transform: translateY(-100%); opacity: 0;
  transition: transform 0.3s var(--ease-spring), opacity 0.3s;
  pointer-events: auto;
  border-left: 3px solid var(--gray-400);
}
.notification-toast.show { transform: translateY(0); opacity: 1; }
.notification-toast.success { border-left-color: #2d8f50; }
.notification-toast.warning { border-left-color: #e6a817; }
.notification-toast.error { border-left-color: #d32f2f; }
.notification-toast.info { border-left-color: #1976d2; }
.toast-icon { font-size: 18px; }
.toast-message { flex: 1; font-weight: 500; }

/* ========== 确认对话框 ========== */
.confirm-message { text-align: center; padding: var(--sp-4) 0; font-size: 15px; line-height: 1.6; }

/* ========== 通知列表 ========== */
.notification-list { max-height: 400px; overflow-y: auto; }
.notification-item { padding: var(--sp-2) 0; border-bottom: 1px solid var(--gray-100); }
.notification-item.read { opacity: 0.4; }
.notif-content { font-size: 13px; }
.notif-time { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ========== 加载/空状态 ========== */
.loading-container { display: flex; flex-direction: column; align-items: center; padding: var(--sp-10); }
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200); border-top-color: var(--green-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loading-text { margin-top: var(--sp-3); color: var(--gray-500); font-size: 14px; }
.empty-state { text-align: center; padding: var(--sp-10); color: var(--gray-400); }
.empty-state-icon { font-size: 48px; margin-bottom: var(--sp-3); opacity: 0.5; }

/* ========== 表单 ========== */
.form-group { margin-bottom: var(--sp-3); }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: var(--sp-1); }
.form-input {
  width: 100%; padding: 10px var(--sp-3);
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 15px; transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-card);
}
.form-input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.form-select {
  padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px; outline: none;
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.form-select:focus { border-color: var(--green-primary); }
.form-select-sm { padding: 6px 10px; font-size: 12px; }

/* ========== Tab 切换 ========== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: var(--sp-4);
  gap: 0;
}
.tab {
  flex: 1; padding: var(--sp-3) 0;
  border: none; background: none;
  font-size: 14px; color: var(--gray-500);
  cursor: pointer; position: relative;
  transition: color var(--duration-normal);
  font-weight: 500;
  -webkit-user-select: none; user-select: none;
}
.tab::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: transparent;
  transition: background var(--duration-normal) var(--ease-bounce);
  border-radius: 1px 1px 0 0;
}
.tab.active { color: var(--green-primary); font-weight: 700; }
.tab.active::after { background: var(--green-primary); }
.tab:active { opacity: 0.7; }

/* ========== 动画工具类 ========== */
.animate-in { animation: fadeInUp var(--duration-slow) var(--ease-spring); }
.animate-scale { animation: scaleIn var(--duration-slow) var(--ease-bounce); }
.stagger-1 { animation-delay: 50ms; animation-fill-mode: both; }
.stagger-2 { animation-delay: 100ms; animation-fill-mode: both; }
.stagger-3 { animation-delay: 150ms; animation-fill-mode: both; }
.stagger-4 { animation-delay: 200ms; animation-fill-mode: both; }

/* ========== 更多菜单 ========== */
.more-menu { }
.more-menu-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
  border-bottom: 1px solid var(--gray-100);
}
.more-menu-item:last-child { border-bottom: none; }
.more-menu-item:active { background: var(--gray-50); }
.menu-item-label { font-weight: 700; font-size: 15px; flex: 1; }
.menu-item-desc { font-size: 12px; color: var(--gray-500); }

/* ========== 确认对话框 ========== */
.confirm-actions { display: flex; gap: var(--sp-2); }
.confirm-actions .btn { flex: 1; }
