/* ============================================================
   SportsCond - カスタムCSS
   ============================================================ */

/* Body Map SVG */
.body-map-container { position: relative; user-select: none; }
.body-part-btn {
  position: absolute;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(59,130,246,0.15);
  border: 2px solid rgba(59,130,246,0.4);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #1e40af; font-weight: bold;
}
.body-part-btn:hover { background: rgba(59,130,246,0.4); border-color: #3b82f6; transform: translate(-50%,-50%) scale(1.2); }
.body-part-btn.selected { background: #ef4444; border-color: #dc2626; color: white; transform: translate(-50%,-50%) scale(1.2); }

/* RPE Scale */
.rpe-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px; border-radius: 8px; border: 2px solid #e5e7eb;
  cursor: pointer; transition: all 0.15s; min-width: 48px;
  background: white;
}
.rpe-btn:hover { border-color: #6366f1; background: #f0f4ff; }
.rpe-btn.selected { border-color: #6366f1; background: #6366f1; color: white; }
.rpe-btn .rpe-num { font-size: 1.25rem; font-weight: 700; }
.rpe-btn .rpe-label { font-size: 0.55rem; text-align: center; line-height: 1.1; }

/* Wellness score badge */
.wellness-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 700; font-size: 0.9rem;
}
.wellness-excellent { background: #dcfce7; color: #16a34a; }
.wellness-good      { background: #d1fae5; color: #059669; }
.wellness-fair      { background: #fef9c3; color: #ca8a04; }
.wellness-poor      { background: #fee2e2; color: #dc2626; }

/* ACWR Badge */
.acwr-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 0.8rem; font-weight: 700;
}
.acwr-none    { background: #f3f4f6; color: #6b7280; }
.acwr-low     { background: #dbeafe; color: #1d4ed8; }
.acwr-optimal { background: #dcfce7; color: #16a34a; }
.acwr-caution { background: #fef9c3; color: #b45309; }
.acwr-danger  { background: #fee2e2; color: #dc2626; }

/* Navigation */
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px; border-radius: 8px; cursor: pointer; transition: all 0.15s;
  color: #6b7280; text-decoration: none; font-size: 0.65rem; gap: 2px;
}
.nav-item:hover { background: #f3f4f6; color: #1e40af; }
.nav-item.active { color: #1e40af; background: #eff6ff; }
.nav-item i { font-size: 1.3rem; }

/* Card */
.card { background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 16px; }

/* Slider VAS */
input[type=range].vas-slider {
  -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; outline: none;
  background: linear-gradient(to right, #22c55e, #eab308, #ef4444);
}
input[type=range].vas-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: white; border: 3px solid #6366f1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Wellness slider */
.wellness-slider { display: flex; gap: 4px; }
.wellness-star {
  flex: 1; padding: 8px 4px; border: 2px solid #e5e7eb; border-radius: 8px;
  cursor: pointer; text-align: center; transition: all 0.15s; font-size: 1.1rem;
}
.wellness-star:hover { border-color: #6366f1; background: #f0f4ff; }
.wellness-star.selected { border-color: #6366f1; background: #6366f1; color: white; }

/* Page transitions */
.page-enter { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Alert pulse */
.critical-alert { animation: alertPulse 2s infinite; }
@keyframes alertPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8fafc; font-weight: 600; font-size: 0.75rem; color: #64748b; text-transform: uppercase; padding: 10px 12px; text-align: left; border-bottom: 2px solid #e2e8f0; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
.data-table tr:hover td { background: #f8fafc; }

/* Loading */
.spinner { border: 3px solid #f3f4f6; border-top: 3px solid #6366f1; border-radius: 50%; width: 32px; height: 32px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
.modal-content { background: white; border-radius: 16px 16px 0 0; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; padding: 24px; }
@media (min-width: 640px) { .modal-content { border-radius: 16px; } }

/* Toast */
#toast-container { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 10px; font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease;
  max-width: 320px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-success { background: #16a34a; color: white; }
.toast-error   { background: #dc2626; color: white; }
.toast-info    { background: #1d4ed8; color: white; }

/* PDF print */
@media print {
  body { background: white; }
  .no-print { display: none !important; }
  .print-page { page-break-after: always; }
  .card { box-shadow: none; border: 1px solid #e2e8f0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
