/* style.css — 데이코스 공통 스타일 (v3) */

/* ── 리셋 & 기본 ──────────────────────────────────────── */
@font-face {
  font-family: 'SchoolSafetyRoundedSmile';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-5@1.0/HakgyoansimDunggeunmisoTTF-R.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #D65A7C;
  --primary-light: #fdeef3;
  --accent:        #C54D6E;
  --accent2:       #D31655;
  --bg:            #ffffff;
  --bg-card:       #ffffff;
  --bg-section:    #fafafa;
  --dark:          #1a1a1a;
  --sub:           #767676;
  --text:          #1a1a1a;
  --text-muted:    #767676;
  --text-light:    #999999;
  --border:        #f0f0f0;
  --border-dark:   #e0e0e0;
  --liked-color:   #e8648a;
  --header-h:      52px;
  --sidebar-w:     280px;
  --radius:        0px;
  --radius-sm:     10px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06);
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    .18s ease;
}

body {
  font-family: -apple-system, 'Pretendard', BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; }
img { display: block; max-width: 100%; }

/* ── 헤더 ─────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 900;
}

.header-menu {
  font-size: 20px;
  color: var(--text);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background var(--transition);
}
.header-menu:hover { background: var(--border); }

.header-title {
  flex: 1;
  text-align: left;
  font-family: 'SchoolSafetyRoundedSmile';
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  cursor: pointer;
  color: var(--primary);
  text-decoration: none;
}

.header-right {
  width: 36px;
  display: flex; align-items: center; justify-content: flex-end;
}

/* 헤더 + 버튼 */
#headerCreateBtn {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition), background var(--transition);
}
#headerCreateBtn:hover { background: var(--accent); transform: scale(1.08); }

/* ── 사이드바 ─────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100%;
  background: var(--bg-card);
  z-index: 1100;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.sidebar.open { transform: translateX(0); }

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-top {
  padding: 20px 20px 16px;
}

.sidebar-close {
  float: right;
  font-size: 18px;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition);
}
.sidebar-close:hover { color: var(--text); }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 0 8px;
}

.sidebar-avatar {
  width: 42px; height: 42px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-nickname {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-profile-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.sidebar-profile-btn {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  transition: background var(--transition);
}
.sidebar-profile-btn:hover { background: var(--bg); }

.sidebar-login-prompt {
  margin-top: 20px;
  text-align: center;
}
.sidebar-login-prompt p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.sidebar-login-btn {
  display: inline-block;
  padding: 9px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition);
}
.sidebar-login-btn:hover { background: var(--accent); }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 18px;
  color: var(--text);
  transition: background var(--transition);
  position: relative;
  margin-bottom: 10px;
}
.sidebar-nav-item:hover { background: var(--bg); }
.sidebar-nav-item.active {
  background: var(--bg);
  font-weight: 600;
}

.sidebar-nav-icon { font-size: 22px; }

/* 알림 배지 */
.notif-badge {
  position: absolute;
  right: 12px;
  background: var(--accent2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-logout-btn {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.sidebar-logout-btn:hover { background: #fff0f0; color: var(--accent2); }

/* ── 페이지 공통 ─────────────────────────────────────── */
.page-wrap {
  padding-top: var(--header-h);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg);
}
@media (min-width: 768px) {
  .page-wrap {
    max-width: 65vw;
  }
}

.section-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.detail-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

/* ── 피드 카드 ─────────────────────────────────────── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 0 10px 80px;
}
@media (min-width: 768px) {
  .feed-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 0 80px;
  }
}

/* 모든 카드 동일 높이 — 썸네일 고정 + body 고정 */
.feed-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feed-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-dark);
}
.feed-card:active { transform: translateY(-1px); }

.feed-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  position: relative;
  background: linear-gradient(135deg, #2d1a22 0%, #c45578 50%, #e8648a 100%);
  overflow: hidden;
  flex-shrink: 0;
}
.feed-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.feed-card:hover .feed-thumb img { transform: scale(1.05); }

.feed-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}

.feed-region-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
  letter-spacing: .2px;
}

.feed-body {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
}

.feed-course-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.feed-places-path {
  font-size: 14px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

/* 설명글: 1줄로 잘리면 ... 처리 */
.feed-description {
  font-size: 14px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  line-height: 1.4;
  font-style: italic;
}

.feed-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
  /*border-top: 1px solid var(--border);*/
}

.feed-author {
  font-size: 10px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px;
  max-width: 70px;
  font-weight: 600;
}

.feed-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.feed-time-badge {
  font-size: 9px;
  color: var(--sub);
  background: var(--bg);
  padding: 2px 5px;
  border-radius: 100px;
  font-weight: 600;
}

.feed-like-btn, .feed-comment-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--sub);
  padding: 3px 5px;
  border-radius: 6px;
  transition: color var(--transition);
  background: none;
  border: none;
}
.feed-like-btn:hover, .feed-comment-btn:hover { color: var(--dark); }
.feed-like-btn.liked { color: var(--liked-color); font-weight: 700; }
.feed-like-btn .heart { font-size: 12px; }

/* 모바일 피드 단순화: 썸네일 + 코스 제목만 노출 */
@media (max-width: 767px) {
  .feed-course-name,
  .feed-places-path,
  .feed-description,
  .feed-time-badge
  {
    display: none;
  }
  .feed-meta {
    padding: 1px;
  }
  .feed-body {
    padding: 0px;
  }
}

/* ── 스피너 ─────────────────────────────────────────── */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm {
  width: 20px; height: 20px;
  border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 빈 상태 ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; margin-bottom: 6px; }
.empty-state small { font-size: 13px; color: var(--text-light); }

/* ── 토스트 ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,30,.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 바텀시트 ─────────────────────────────────────── */
.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.bottom-sheet-overlay.show { opacity: 1; pointer-events: auto; }

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 2100;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-dark);
  border-radius: 2px;
  margin: 12px auto 4px;
}

.bottom-sheet-item {
  padding: 15px 20px;
  font-size: 15px;
  color: var(--text);
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  display: flex; align-items: center; gap: 10px;
}
.bottom-sheet-item:hover { background: var(--bg); }
.bottom-sheet-item:first-of-type { border-top: none; }

/* ── 모달 ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 20px;
  width: min(90vw, 360px);
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform .2s;
}
.modal-overlay.show .modal-box { transform: scale(1); }

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-btn {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition);
}
.modal-btn.cancel {
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
}
.modal-btn.cancel:hover { background: var(--bg); }
.modal-btn.confirm {
  background: var(--accent2);
  color: #fff;
}
.modal-btn.confirm:hover { opacity: .9; }

/* ── Pull to Refresh ──────────────────────────────── */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  height: 48px;
  overflow: hidden;
  transition: height .2s;
}
.ptr-indicator.hidden { height: 0; padding: 0; }

/* ── 더 보기 / 무한 스크롤 ─────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.load-more-btn {
  padding: 10px 28px;
  border: 1px solid var(--border-dark);
  border-radius: 22px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: background var(--transition);
}
.load-more-btn:hover { background: var(--bg); }

.infinite-sentinel {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 탭 ─────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: var(--header-h);
  z-index: 100;
}

.tab-btn {
  flex: 1;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  text-align: center;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── 뱃지 ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-region {
  background: rgba(26,26,46,.08);
  color: var(--primary);
}
.badge-time {
  background: rgba(15,52,96,.08);
  color: var(--accent);
}

/* ── 버튼 공통 ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), opacity var(--transition);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { opacity: .88; }
.btn-outline {
  border: 1px solid var(--border-dark);
  color: var(--text);
  background: #fff;
}
.btn-outline:hover { background: var(--bg); }
.btn-danger {
  background: var(--accent2);
  color: #fff;
}
.btn-danger:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 인풋 공통 ─────────────────────────────────────── */
.input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--text-light); }

/* ── 반응형 ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .page-wrap { padding-bottom: 60px; }
}

/* ── 푸터 ─────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  color: var(--sub);
  font-size: 12px;
  line-height: 2;
}
.site-footer .footer-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.site-footer .footer-slogan {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.site-footer .footer-links a {
  color: var(--sub);
  text-decoration: none;
  font-size: 12px;
  transition: color .15s;
}
.site-footer .footer-links a:hover { color: var(--primary); }
.site-footer .footer-contact { margin-bottom: 8px; }
.site-footer .footer-copy {
  font-size: 11px;
  color: var(--text-light);
}

/* ── 아이콘/텍스트 정렬 보정 ──────────────────────────── */

/* 헤더 — 햄버거 아이콘과 타이틀 수직 정렬 */
.header {
  align-items: center;
}
.header-menu, .header-right button {
  display: flex;
  align-items: center;
  justify-content: center;
}
.header svg {
  display: block;
}

/* 사이드바 네비 아이콘+텍스트 정렬 */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}
.sidebar-nav-icon svg {
  display: block;
}

/* 로그아웃 버튼 */
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logout-btn svg { display: block; }

/* 댓글 헤더 — section-label과 sort chips 수직 정렬 */
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.comment-header .section-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.comment-header svg { display: block; }

/* 코스 액션 버튼 내부 정렬 */
.course-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.course-action-btn svg { display: block; }

/* 전체 버튼 SVG 기본 정렬 */
button svg {
  vertical-align: middle;
}

/* 칩/배지 텍스트+아이콘 정렬 */
.chip, .filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}