/* ==========================================================================
   TigerFit 모던 SaaS 다크 테마 CSS (Cyber Tiger Dark Aesthetic)
   - 레퍼런스: Linear / Raycast / Web3 SaaS 스타일 다크 글래스모피즘
   - 베이스: Cosmic Deep Black (#030407) + 앰비언트 글로우 번짐
   - 포인트: 타이거 앰버 / 네온 오렌지 / 웜 골드 (#ff6b00 / #f59e0b / #ffa336)
   - 가독성: 수치는 볼드 크리스탈 화이트 (#ffffff), 보조 라벨은 정돈된 쿨 슬레이트
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700;800&display=swap');

:root {
  --bg-deep: #030407;
  --bg-surface: rgba(14, 16, 23, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(245, 158, 11, 0.35);
  
  --tiger-orange: #ff6b00;
  --tiger-amber: #f59e0b;
  --tiger-glow: rgba(255, 107, 0, 0.18);
  --tiger-amber-glow: rgba(245, 158, 11, 0.22);
}

body {
  background-color: var(--bg-deep) !important;
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

.font-mono-val {
  font-family: 'JetBrains Mono', 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: 'tnum' 1;
}

/* ================= 앰비언트 글로우 & 호랑이 워터마크 ================= */
.ambient-glow-top {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 950px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.14) 0%, rgba(245, 158, 11, 0.07) 40%, transparent 70%);
  filter: blur(85px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-side {
  position: fixed;
  bottom: -160px;
  right: -100px;
  width: 750px;
  height: 520px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(255, 107, 0, 0.05) 50%, transparent 70%);
  filter: blur(95px);
  pointer-events: none;
  z-index: 0;
}

/* 미세 사이버 그리드 패턴 */
.bg-grid-mesh {
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* 은은한 배경 호랑이 실루엣 워터마크 */
.tiger-watermark-bg {
  position: fixed;
  right: 1%;
  top: 8%;
  width: 650px;
  height: 650px;
  pointer-events: none;
  opacity: 0.045;
  z-index: 0;
  transform: rotate(-4deg);
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 35px rgba(255, 107, 0, 0.25));
}

/* ================= 프리미엄 글래스모피즘 패널 ================= */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: var(--border-hover);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 107, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 카드 및 섹션 기본 다크 서피스 오버라이드 */
.bg-slate-900,
.bg-slate-900\/60,
.bg-slate-900\/90 {
  background: linear-gradient(180deg, rgba(14, 16, 23, 0.85) 0%, rgba(8, 9, 14, 0.95) 100%) !important;
  backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.07) !important;
}

.bg-slate-800,
.bg-slate-800\/40,
.bg-slate-800\/50,
.bg-slate-800\/60 {
  background-color: rgba(20, 24, 34, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* ================= 사이드바 네비게이션 ================= */
.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.18s ease;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}

.nav-item-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.nav-item-btn.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(255, 107, 0, 0.16) 0%, rgba(245, 158, 11, 0.06) 100%);
  border: 1px solid rgba(255, 107, 0, 0.32);
  box-shadow: 0 0 16px rgba(255, 107, 0, 0.12);
}

.nav-item-btn.active svg,
.nav-item-btn.active i {
  color: #ff9d3b;
  filter: drop-shadow(0 0 6px rgba(255, 157, 59, 0.6));
}

/* ================= 앰버/오렌지 버튼 시스템 ================= */
.btn-tiger-primary {
  background: linear-gradient(135deg, #ff7a00 0%, #ea580c 100%);
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}
.btn-tiger-primary:hover {
  background: linear-gradient(135deg, #ff8a1a 0%, #f97316 100%);
  box-shadow: 0 6px 24px rgba(234, 88, 12, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-tiger-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-tiger-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* ================= 월간 캘린더 커스텀 스타일 ================= */
.cal-cell {
  position: relative;
  min-height: 54px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background-color: rgba(10, 12, 17, 0.7);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 4px 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
}

.cal-cell:hover {
  background-color: rgba(20, 24, 34, 0.85);
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.cal-cell.is-outside-month {
  opacity: 0.25;
}
.cal-cell.is-outside-month:hover {
  opacity: 0.55;
}

.cal-cell.has-data {
  background-color: rgba(14, 17, 24, 0.85);
  border-color: rgba(255, 255, 255, 0.09);
}

/* [요청 4] 캘린더 운동 완료 날짜 칸 색상 스왑 (웨이트: 타이거 앰버 / 러닝: 에메랄드 그린) */
.cal-cell.is-weight-only {
  background-color: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.1);
}

.cal-cell.is-running-only {
  background-color: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.08);
}

.cal-cell.is-dual-workout {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.25) 0%, rgba(16, 185, 129, 0.25) 100%) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: inset 0 0 14px rgba(245, 158, 11, 0.1), 0 2px 8px rgba(16, 185, 129, 0.08);
}

.cal-cell.is-rest-day {
  background-color: rgba(71, 85, 105, 0.2) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

/* 오늘 날짜 표시 */
.cal-cell.is-today .cal-date-num {
  color: #bef264;
  font-weight: 800;
}
.cal-cell.is-today {
  border-color: rgba(132, 204, 22, 0.5);
}

/* 선택된 날짜 하이라이트 (깔끔하고 또렷한 화이트 포커스 링) */
.cal-cell.is-selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 18px rgba(255, 255, 255, 0.45) !important;
  border-color: #ffffff !important;
  z-index: 10;
}
.cal-cell.is-selected .cal-date-num {
  color: #ffffff !important;
  font-weight: 900;
}

.cal-date-num {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1;
}

.cal-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  min-height: 10px;
}

/* ================= 3대 운동 모드 독립 토글 버튼 스타일 ================= */
#toggleWeightBtn.is-active {
  background-color: rgba(245, 158, 11, 0.22) !important;
  color: #fbbf24 !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}
#toggleWeightBtn.is-inactive {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #64748b !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  opacity: 0.65;
}

#toggleRunningBtn.is-active {
  background-color: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}
#toggleRunningBtn.is-inactive {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #64748b !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  opacity: 0.65;
}

#toggleRestBtn.is-active {
  background-color: rgba(148, 163, 184, 0.16) !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}
#toggleRestBtn.is-inactive {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #64748b !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  opacity: 0.65;
}

/* ================= 웨이트 세트 체크박스 및 인터랙션 ================= */
.set-checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background-color: transparent;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.set-checkbox:hover {
  border-color: #ff7a00;
}
.set-checkbox:checked {
  background-color: #ff7a00;
  border-color: #ff7a00;
  box-shadow: 0 0 10px rgba(255, 122, 0, 0.45);
}
.set-checkbox::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #000000;
  border-bottom: 2px solid #000000;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.15s ease-in-out;
}
.set-checkbox:checked::before {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.set-row.is-completed {
  opacity: 0.65;
  background-color: rgba(255, 107, 0, 0.03);
}

/* [요청 1] 부위 선택 칩 - 부위별 고유 테마 컬러 및 활성 글로우 */
.part-chip {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  background-color: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  cursor: pointer;
}
.part-chip:hover {
  transform: translateY(-1px);
}

/* 부위별 비활성 틴트 & 활성 네온 테마 */
.part-chip[data-part="가슴"] { color: #fca5a5; border-color: rgba(244, 63, 94, 0.3); }
.part-chip[data-part="가슴"]:hover, .part-chip[data-part="가슴"].active {
  background-color: rgba(244, 63, 94, 0.22) !important;
  color: #fecdd3 !important;
  border-color: #f43f5e !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}

.part-chip[data-part="등"] { color: #7dd3fc; border-color: rgba(14, 165, 233, 0.3); }
.part-chip[data-part="등"]:hover, .part-chip[data-part="등"].active {
  background-color: rgba(14, 165, 233, 0.22) !important;
  color: #e0f2fe !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
}

.part-chip[data-part="하체"] { color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
.part-chip[data-part="하체"]:hover, .part-chip[data-part="하체"].active {
  background-color: rgba(245, 158, 11, 0.22) !important;
  color: #fef08a !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.part-chip[data-part="어깨"] { color: #d8b4fe; border-color: rgba(168, 85, 247, 0.3); }
.part-chip[data-part="어깨"]:hover, .part-chip[data-part="어깨"].active {
  background-color: rgba(168, 85, 247, 0.22) !important;
  color: #f3e8ff !important;
  border-color: #a855f7 !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.part-chip[data-part="이두"], .part-chip[data-part="팔"] { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
.part-chip[data-part="이두"]:hover, .part-chip[data-part="이두"].active,
.part-chip[data-part="팔"]:hover, .part-chip[data-part="팔"].active {
  background-color: rgba(16, 185, 129, 0.22) !important;
  color: #d1fae5 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.part-chip[data-part="삼두"] { color: #67e8f9; border-color: rgba(6, 182, 212, 0.3); }
.part-chip[data-part="삼두"]:hover, .part-chip[data-part="삼두"].active {
  background-color: rgba(6, 182, 212, 0.22) !important;
  color: #cffafe !important;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

.part-chip[data-part="복근"] { color: #bef264; border-color: rgba(132, 204, 22, 0.3); }
.part-chip[data-part="복근"]:hover, .part-chip[data-part="복근"].active {
  background-color: rgba(132, 204, 22, 0.22) !important;
  color: #ecfccb !important;
  border-color: #84cc16 !important;
  box-shadow: 0 0 12px rgba(132, 204, 22, 0.35);
}

.part-chip[data-part="기타"] { color: #94a3b8; border-color: rgba(148, 163, 184, 0.3); }
.part-chip[data-part="기타"]:hover, .part-chip[data-part="기타"].active {
  background-color: rgba(148, 163, 184, 0.22) !important;
  color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.25);
}

/* 빠른 추천 키워드 */
.quick-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-tag:hover {
  background-color: rgba(255, 107, 0, 0.18);
  color: #ff9d3b;
  font-weight: 700;
  border-color: #ff7a00;
}

/* ================= Leaflet 지도 다크모드 타일 ================= */
.leaflet-container {
  background: #030407 !important;
  font-family: inherit;
}
.leaflet-bar a {
  background-color: rgba(14, 16, 23, 0.9) !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.leaflet-bar a:hover {
  background-color: rgba(255, 107, 0, 0.2) !important;
  color: #ff9d3b !important;
}
.leaflet-control-attribution {
  background: rgba(3, 4, 7, 0.85) !important;
  color: #64748b !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a {
  color: #8e95a5 !important;
}

/* ================= 커스텀 스크롤바 ================= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 107, 0, 0.4);
}

/* 셀렉트 드롭다운 및 인풋 다크 스타일링 */
html, body, select {
  color-scheme: dark !important;
}
select {
  background-color: #0b0d14 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
select option {
  background-color: #0b0d14 !important;
  color: #f8fafc !important;
  padding: 8px 12px;
}

/* ================= 반응형 우측 대시보드 레이아웃 최적화 ================= */
@media (max-width: 1023px) {
  .responsive-sidebar-group {
    display: contents !important;
  }
}
@media (min-width: 1024px) {
  .responsive-sidebar-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }
}
