/* ============================================
   공용 스타일 - 헤더, 변수, 리셋, 네비게이션
   ============================================ */

:root {
  /* 메인 컬러 - 우유탄 녹색 */
  --color-primary: #8fbc8f;        /* 밝은 녹색 (기본) */
  --color-primary-light: #c8e6c0;  /* 연한 녹색 (배경 힌트) */
  --color-primary-pale: #eef5ec;   /* 아주 연한 녹색 (포인트 배경) */
  --color-primary-dark: #2e7d32;   /* 진한 녹색 (강조) */
  --color-primary-deep: #1b5e20;   /* 가장 진한 녹색 (텍스트 강조) */

  /* 중립 컬러 */
  --color-bg: #ffffff;
  --color-bg-subtle: #ffffff;
  --color-border: #e0e0e0;
  --color-border-strong: #8fbc8f;
  --color-text: #212121;
  --color-text-secondary: #757575;
  --color-text-muted: #9e9e9e;

  /* 기능 컬러 */
  --color-star: #f5a623;
  --color-member: #2e7d32;
  --color-public: #c48550;

  /* 레이아웃 */
  --panel-width: 420px;
  --header-height: 56px;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ============================================
   헤더
   ============================================ */
.header {
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: relative;
}

.header__logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary-dark);
  white-space: nowrap;
  padding-bottom: 4px;
}

.header__logo a {
  color: inherit;
  text-decoration: none;
}

.header__subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  padding-bottom: 4px;
}

.header__stats {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ============================================
   햄버거 버튼
   ============================================ */
.hamburger-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--color-primary-pale);
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--color-primary-dark);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ============================================
   네비게이션 드로어
   ============================================ */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  display: none;
}

.nav-drawer-overlay.open {
  display: block;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--color-bg);
  z-index: 1000;
  transition: right 0.3s ease;
  box-shadow: -2px 0 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}

.nav-drawer.open {
  right: 0;
}

.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.nav-drawer__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.nav-drawer__close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.nav-drawer__close:hover {
  background: var(--color-primary-pale);
  color: var(--color-text);
}

.nav-drawer__item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}

.nav-drawer__item:hover {
  background: var(--color-primary-pale);
}

.nav-drawer__item.active {
  border-left: 3px solid var(--color-primary-dark);
  background: var(--color-primary-pale);
  font-weight: 600;
  color: var(--color-primary-dark);
}

/* ============================================
   인증 UI (드로어 하단)
   ============================================ */
.nav-drawer__auth {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
}

.auth-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-avatar--default {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-pale);
  color: var(--color-primary-dark);
  font-size: 18px;
}

.auth-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn--google {
  background: #fff;
  color: #333;
  border: 1.5px solid #ddd;
}

.auth-btn--google:hover {
  background: #f5f5f5;
}

.auth-google-icon {
  flex-shrink: 0;
}

.auth-btn--logout {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.auth-btn--logout:hover {
  background: var(--color-primary-pale);
  color: var(--color-text);
}

/* 로그인 프롬프트 팝업 */
.login-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-prompt {
  background: var(--color-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 360px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-prompt__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.login-prompt__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.login-prompt__close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.login-prompt__close:hover {
  background: var(--color-primary-pale);
}

.login-prompt__text {
  padding: 20px 20px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
}

.login-prompt__google {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
}

/* 프로필 편집 힌트 (이름 옆 연필 아이콘) */
.auth-edit-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: auto;
  flex-shrink: 0;
}

.auth-profile {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 6px;
  margin: -6px;
  margin-bottom: 12px;
  transition: background 0.15s;
}

.auth-profile:hover {
  background: var(--color-primary-pale);
}

/* 내 정보 팝업 */
.profile-popup__body {
  padding: 20px;
}

.profile-popup__photo {
  text-align: center;
  margin-bottom: 16px;
}

.profile-popup__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-popup__avatar--default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-pale);
  color: var(--color-primary-dark);
  font-size: 32px;
}

.profile-popup__section {
  margin-bottom: 16px;
}

.profile-popup__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.profile-popup__value {
  font-size: 14px;
  color: var(--color-text);
}

.profile-popup__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  transition: border-color 0.15s;
}

.profile-popup__input:focus {
  outline: none;
  border-color: var(--color-primary-dark);
}

.profile-popup__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.profile-popup__save {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 12px;
  background: var(--color-primary-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.profile-popup__save:hover {
  background: var(--color-primary-deep);
}

.profile-popup__save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   모바일 반응형 - 공용
   ============================================ */
@media (max-width: 768px) {
  .header {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .header__logo {
    font-size: 16px;
    order: 0;
    margin-right: 8px;
    align-self: flex-end;
  }

  .header__subtitle {
    font-size: 12px;
    order: 1;
    align-self: flex-end;
  }

  .hamburger-btn {
    order: 2;
    align-self: flex-start;
  }

  .header__stats {
    font-size: 12px;
    width: 100%;
    order: 3;
  }

  .nav-drawer {
    width: 260px;
    right: -260px;
  }
}

/* 마커 라벨 (카카오맵 CustomOverlay — 공용) */
.marker-label {
  background: rgba(30, 70, 30, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 0;
  border-radius: 4px;
  max-width: 160px;
  line-height: 1.3;
  white-space: nowrap;
}

.marker-label__item {
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.marker-label__item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.marker-label__item + .marker-label__item {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
