/* =========================================================
   우리가족챙기기 (Family Care) - Fresh Pastel Neo-Glassmorphism
   고도화: 카테고리 허브 & 즐겨찾기 퀵뷰 & 바텀 시트 상세 뷰어
   ========================================================= */

:root {
  --primary-coral: #ff6b6b;
  --primary-mint: #10b981;
  --primary-sky: #0ea5e9;
  --primary-orange: #f97316;
  --primary-purple: #8b5cf6;
  --primary-yellow: #f59e0b;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.92);
  --border-glass: rgba(255, 255, 255, 0.7);
  --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 10px -2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 8px 20px -3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 16px 30px -4px rgba(0, 0, 0, 0.09);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text-dark);
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(254, 240, 138, 0.45) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(253, 186, 116, 0.4) 0px, transparent 50%),
    radial-gradient(at 50% 35%, rgba(186, 230, 253, 0.45) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(167, 243, 208, 0.45) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(244, 208, 250, 0.35) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 40px;
}

/* 앱 메인 컨테이너 */
.app-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* 상단 헤더 */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 4px 2px;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #0ea5e9, #10b981, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
}

.kst-pill {
  font-size: 12px;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.15);
}

/* 위치 바 */
.location-bar {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

.loc-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.loc-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.loc-btn:hover {
  background: #e2e8f0;
}

/* 가족 멤버 탭 */
.member-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.member-tabs::-webkit-scrollbar {
  display: none;
}

.member-tab {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.member-tab.active {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
  transform: translateY(-1px);
}

/* 1. 상단 기본 날씨 요약 카드 */
.weather-summary-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.weather-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weather-temp-main {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #0f172a;
  line-height: 1.1;
}

.weather-temp-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 600;
}

.weather-icon-large {
  font-size: 44px;
}

.weather-badge-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 10px;
}

.badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-rain { background: #e0f2fe; color: #0369a1; }
.badge-air { background: #d1fae5; color: #065f46; }
.badge-umbrella-yes { background: #fee2e2; color: #b91c1c; animation: pulse 2s infinite; }
.badge-umbrella-no { background: #f1f5f9; color: #475569; }

.outfit-banner {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.75), rgba(253, 230, 138, 0.45));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.outfit-banner .icon { font-size: 24px; }
.outfit-banner .text { font-size: 12px; font-weight: 700; color: #78350f; line-height: 1.4; }

/* 2. 초기화면: 내가 등록한 즐겨찾기 퀵뷰 섹션 */
.favorites-section {
  margin-bottom: 20px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-sub-action {
  font-size: 12px;
  color: #0ea5e9;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.favorites-scroll-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.favorites-scroll-container::-webkit-scrollbar {
  display: none;
}

.fav-card {
  min-width: 170px;
  max-width: 200px;
  background: var(--bg-glass-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s;
  cursor: pointer;
}

.fav-card:hover {
  transform: translateY(-2px);
}

.fav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fav-badge {
  font-size: 11px;
  font-weight: 800;
  color: white;
  padding: 2px 7px;
  border-radius: 6px;
}

.fav-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-highlight {
  font-size: 14px;
  font-weight: 800;
  color: #e11d48;
  margin-top: 6px;
}

/* 3. 핵심 카테고리 카드 그리드 (2열 레이아웃) */
.category-section {
  margin-bottom: 24px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cat-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
}

.cat-card:active {
  transform: scale(0.97);
}

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

/* 카테고리별 악센트 그라디언트 테두리/배경 */
.cat-transit { border-top: 4px solid var(--primary-sky); }
.cat-hospital { border-top: 4px solid var(--primary-mint); }
.cat-restaurant { border-top: 4px solid var(--primary-orange); }
.cat-health { border-top: 4px solid var(--primary-purple); }
.cat-culture { border-top: 4px solid var(--primary-yellow); }
.cat-manage { border-top: 4px solid #64748b; }

.cat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.cat-icon {
  font-size: 28px;
}

.cat-arrow {
  font-size: 14px;
  color: #94a3b8;
  font-weight: bold;
}

.cat-name {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.cat-preview {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  line-height: 1.3;
}

.cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 6px;
  width: fit-content;
}

/* 4. 카테고리 상세 모달 / 바텀 시트 (Bottom Sheet) */
.detail-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 500;
  transition: opacity 0.3s ease;
}

.detail-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  border-radius: 28px 28px 0 0;
  padding: 24px 20px 36px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle-bar {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 0 auto 16px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.sheet-content {
  overflow-y: auto;
  padding-bottom: 20px;
}

/* 상세 뷰 내부 리스트 아이템 스타일 */
.detail-item-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

/* 필터 칩 */
.filter-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: #10b981; color: white; }

/* 모달 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 440px;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
