/**
 * 🏠 caregiver-dashboard.css
 * 보호자 올인원 관제 대시보드 전용 스타일 | design-tokens.css 변수 준수
 * 서울대병원(홈 01) + 나만의닥터(배너/퀵카드) 최고 수준 UI/UX 융합
 */

/* 1. 대시보드 루트 */
.caregiver-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 16px;
  animation: db-fade-in 0.3s ease;
}
@keyframes db-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 2. 공통 위젯 카드 (20px 라디우스 & 레이어드 섀도우) */
.db-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card, 20px);
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
  border: none;
  position: relative;
  overflow: hidden;
}

/* 3. 서울대병원 스타일 환영 헤더 & 인앱 폰트 스케일러 */
.db-welcome-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: none;
  padding: 18px;
}
.db-welcome-user {
  font-size: var(--font-size-md, 16px);
  font-weight: 800;
  color: var(--sage-deep);
  letter-spacing: -0.3px;
  line-height: 1.35;
  margin-bottom: 10px;
}
.db-patient-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.db-chips-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.font-scaler-group {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: none;
  border-radius: var(--radius-full);
  padding: 3px 5px;
  gap: 2px;
  box-shadow: none;
}
.scaler-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}
.scaler-btn.active {
  background: var(--sage-primary);
  color: #ffffff;
}
.db-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: none;
}
.db-badge-chip.disease {
  background: var(--sage-pale);
  color: var(--sage-dark);
  border: none;
}
.db-badge-chip.date {
  background: var(--slate-100, #f1f5f9);
  color: var(--text-secondary);
  border: none;
}
.db-comfort-msg {
  font-size: var(--font-size-xs, 12px);
  color: var(--sage-primary);
  margin-top: 8px;
  font-weight: 600;
}

/* 4. 60일 입원 안심 타이머 카드 (나만의닥터 스타일 게이지) */
.db-timer-card {
  background: linear-gradient(135deg, #fffbf5 0%, #ffffff 100%);
  border: none;
}
.db-timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.db-timer-label {
  font-size: var(--font-size-xs, 12px);
  font-weight: 700;
  color: var(--amber-warm);
  letter-spacing: 0.3px;
}
.db-timer-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}
.db-timer-days {
  font-size: var(--font-size-3xl, 36px);
  font-weight: 900;
  color: var(--sage-deep);
  line-height: 1;
  letter-spacing: -1px;
}
.db-timer-of {
  font-size: var(--font-size-base, 14px);
  color: var(--text-muted);
  font-weight: 600;
}
.db-timer-dday {
  font-size: var(--font-size-sm, 13px);
  font-weight: 800;
  color: var(--amber-warm);
  margin-left: auto;
  background: var(--amber-bg);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}
.db-progress-wrap {
  background: var(--slate-100, #f1f5f9);
  border-radius: var(--radius-full);
  height: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.db-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--sage-primary), var(--amber-warm));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.db-progress-bar.near-end {
  background: linear-gradient(90deg, var(--amber-warm), var(--red-urgent));
}
.db-progress-text {
  font-size: var(--font-size-xs, 11px);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.db-transfer-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 12px;
  animation: db-pulse 2s infinite;
}
@keyframes db-pulse {
  0%, 100% { border-color: #fca5a5; }
  50%       { border-color: var(--red-urgent); }
}
.db-transfer-alert-text {
  font-size: var(--font-size-xs, 12px);
  color: #991b1b;
  font-weight: 600;
  line-height: 1.4;
}

/* 5. 나만의닥터 스타일 인라인 추천 배너 스와이퍼 */
.db-banner-swiper {
  position: relative;
  border-radius: var(--radius-card, 20px);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  user-select: none;
}
.swiper-container {
  overflow: hidden;
  width: 100%;
}
.swiper-wrapper {
  display: flex;
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}
.swiper-slide {
  flex: 0 0 100%;
  width: 100%;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}
.swiper-slide.slide-1 { background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%); color: #ffffff; }
.swiper-slide.slide-2 { background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%); color: #881337; }
.swiper-slide.slide-3 { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); color: #14532d; }
.slide-content-wrap { flex: 1; padding-right: 12px; }
.slide-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 4px;
}
.slide-1 .slide-tag { background: rgba(255,255,255,0.2); color: #d8f3dc; }
.slide-2 .slide-tag { background: #fecdd3; color: #9f1239; }
.slide-3 .slide-tag { background: #bbf7d0; color: #166534; }
.slide-title { font-size: var(--font-size-base, 14px); font-weight: 800; line-height: 1.35; }
.slide-sub { font-size: var(--font-size-xs, 11px); opacity: 0.85; margin-top: 2px; }
.slide-action-icon { font-size: 24px; flex-shrink: 0; }
.swiper-dots {
  position: absolute;
  bottom: 8px;
  right: 14px;
  display: flex;
  gap: 4px;
}
.swiper-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.2);
  transition: all 0.2s;
}
.slide-1 .swiper-dot { background: rgba(255,255,255,0.4); }
.slide-1 .swiper-dot.active { background: #ffffff; width: 14px; }
.swiper-dot.active { background: var(--sage-primary); width: 14px; }

/* 6. 나만의닥터 스타일 3열 둥근 스퀘어 카드 그리드 (첨부 레퍼런스 일치) */
.db-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 2px 8px;
}
.db-section-title {
  font-size: var(--font-size-base, 14px);
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.db-square-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.db-square-card {
  background: var(--bg-surface, #ffffff);
  border: none;
  border-radius: var(--radius-card, 20px);
  padding: 16px 8px 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  min-height: calc(96px * var(--font-scale, 1.0));
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.db-square-card:hover, .db-square-card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.square-card-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.square-card-label {
  font-size: var(--font-size-sm, 12px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.3px;
  word-break: keep-all;
}
.square-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 800;
  background: var(--red-bg, #fee2e2);
  color: var(--red-urgent, #dc2626);
  border-radius: var(--radius-full);
  padding: 2px 5px;
  line-height: 1;
}

/* 7. 핫라인 & 유선 확인 필수 가드레일 */
.db-hotline-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.db-hotline-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.db-hotline-info { flex: 1; }
.db-hotline-name {
  font-size: var(--font-size-xs, 12px);
  font-weight: 700;
  color: var(--text-secondary);
}
.db-hotline-number {
  font-size: var(--font-size-xl, 20px);
  font-weight: 900;
  color: var(--sage-primary);
  letter-spacing: 0.5px;
}
.db-hotline-call-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--sage-primary), var(--sage-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: var(--font-size-sm, 13px);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s;
}
.db-hotline-call-btn:active { transform: scale(0.97); }
.db-guardrail-banner {
  margin-top: 12px;
  background: var(--slate-100, #f1f5f9);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: var(--font-size-xs, 11px);
  color: var(--text-muted);
  line-height: 1.5;
}

/* 8. 토스트 */
.db-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(27, 67, 50, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.db-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

