/* ========================
   HEADER
======================== */
.main-header {
  width: 100%;
  background: #fff;
  border-bottom: 0.0625em solid #f2f2f2; /* 1px → em */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}

.header-inner {
  max-width: 90%; /* 1280px → 약 80% 화면폭 */
  margin: 0 auto;
  padding: 1em 1.5em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================
   로고
======================== */
.logo-area {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.logo-area img {
  height: 1.4em;
}

.logo {
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  color: #000;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

/* ========================
   네비게이션 메뉴
======================== */
.nav-menu > ul {
  display: flex;
  align-items: center;
  gap: 1.6em;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu > ul > li {
  position: relative;
}

.nav-menu a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  font-size: 0.95rem;
  display: block;
  padding: 0.5em 0.3em;
}

/* ========================
   드롭다운
======================== */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 2.5em; /* 38px → em 단위 */
  left: 0;
  background: #fff;
  border: 0.0625em solid #e8e8e8;
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.05);
  border-radius: 0.6em;
  min-width: 12em;
  z-index: 2500;
  padding: 0.6em 0;
  list-style: none; /* ✅ 이 줄 추가: 동그라미 제거 */
}

.nav-menu > ul > li:hover > .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 0.7em 1em;
  font-size: 0.9rem;
  color: #333;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: #edf8e9;
  color: #2e7d32;
}

/* ========================
   오른쪽 유틸
======================== */
.user-utils {
  display: flex;
  align-items: center;
  gap: 1.4em;
}

.icon-link {
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

/* ========================
   버튼
======================== */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.btn {
  padding: 0.6em 1em;
  border-radius: 0.4em;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn.login {
  color: #4caf50;
  border: 0.0625em solid #4caf50;
  background: #fff;
}

.btn.signup {
  background: #66bb6a;
  color: #fff;
}

.btn.upload {
  background: #4caf50;
  color: #fff;
  font-weight: 600;
}

.btn.login:hover {
  background: #4caf50;
  color: #fff;
}

.btn.signup:hover,
.btn.upload:hover {
  background: #43a047;
}


.chat-icon {
  position: relative;
  margin-right:1em;
}
.chat-badge {
  position: absolute;
  top: -6px;
  right: -20px;   /* ← 기존 -10px → -20px으로 이동 */
  background: #ff4d4d;
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  animation: badge-pop 0.25s ease-out;
}


@keyframes badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}



/* ============================================================
   📱 모바일 헤더 (<= 768px): 메뉴 2열 그리드 버전
   ============================================================ */
@media screen and (max-width: 768px) { /* 768px */

  .header-inner .user-utils{
    margin-top:0;
  }

  .main-content {
    margin-top:6em;
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    padding: 1.2em 1em;
  }

  /* 로고는 단독으로 위에 */
  .logo-area {
    justify-content: center;
    width: 100%;
    margin-bottom: 1em;
  }

  /* 네비게이션 메뉴를 2열 Grid로 변경 */
  .nav-menu {
    width: 100%;
    margin-top: 0.5em;
  }

  .nav-menu > ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2열 */
    gap: 0.8em 1em;
    width: 100%;
    padding: 0;
    justify-items: center;
  }

  .nav-menu > ul > li {
    width: 100%;
    text-align: center;
  }

  .nav-menu a {
    display: block;
    padding: 0.7em 0.5em;
    border-radius: 0.5em;
    background: #f7f7f7;
    font-size: 0.9rem;
  }

  /* 드롭다운은 모바일에서 숨김 (필요하면 슬라이드 메뉴 구조로 리뉴얼 가능) */
  .dropdown-menu {
    display: none !important;
  }

  /* 유저 정보 / 로그인 버튼들은 아래로 배치 */
  .user-utils {
    margin-top: 1.2em;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.8em;
  }

  .auth-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .btn {
    width: auto;
    padding: 0.6em 1.2em;
  }
}
