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

.profile-img-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.profile-img-wrapper.has-image {
  cursor: pointer;
}

.profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.profile-img-wrapper.has-image:hover .profile-overlay,
.profile-img-wrapper.overlay-visible .profile-overlay {
  opacity: 1;
  pointer-events: auto;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f9fafb;
  color: #111827;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.header .container {
  max-width: 100%;
  padding-left: 32px;
  padding-right: 32px;
}

.header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #bef264, #84cc16);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}

.logo-text {
  font-size: clamp(1.05rem, 1vw, 1.25rem);
  font-weight: bold;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-primary {
  background: #84cc16;
  color: white;
}

.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
}

.btn-primary:hover {
  background: #65a30d;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-outline:hover {
  background: #f9fafb;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-full {
  width: 100%;
}

.main-content {
  min-height: calc(100vh - 60px - 60px);
  padding-bottom: 80px;
}

.bottom-nav {
  display: none;
  background: white;
  border-top: 1px solid #e5e7eb;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  text-decoration: none;
  color: #6b7280;
  transition: color 0.2s;
}

.nav-item.active {
  color: #84cc16;
}

.nav-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.nav-label {
  font-size: 0.75rem;
}

.tabs-list {
  display: inline-flex;
  flex-wrap: wrap;
  background: #f3f4f6;
  padding: 0.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  gap: 0.25rem;
}

.tab-trigger,
.radius-trigger {
  flex: 1;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

.tab-trigger.active,
.radius-trigger.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #84cc16;
  transition: width 0.3s;
}

.info-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 1rem;
}

.info-box-title {
  font-weight: 600;
  color: #15803d;
  margin-bottom: 0.25rem;
}

/* ================================
   Toast
================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

/* ================================
   Utility
================================ */
.hidden {
  display: none !important;
}

.text-lime {
  color: #84cc16;
}

.text-green {
  color: #22c55e;
}

.text-blue {
  color: #3b82f6;
}

.text-gray {
  color: #6b7280;
}

.text-yellow {
  color: #eab308;
}

.back-link {
  margin-bottom: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  margin-bottom: 2rem;
}

.avatar-circle-md {
  width: 48px;
  height: 48px;
  background: #d1d5db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  object-fit: cover;
}

.badge-chip {
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-chip-host {
  background: #84cc16;
}

.badge-chip-member {
  background: #3b82f6;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.list-item-main {
  flex: 1;
}

.list-item-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.list-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-text {
  font-size: 0.75rem;
  color: #6b7280;
}

.icon-lg {
  font-size: 1.25rem;
}

.icon-success {
  color: #22c55e;
}

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

.split-row-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.split-row-start {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.inline-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-right {
  text-align: right;
}

.rating-value {
  font-weight: 600;
}

.small-note {
  font-size: 0.875rem;
}

.medium-note {
  font-size: 0.875rem;
  color: #374151;
}

.link-reset {
  text-decoration: none;
}

.logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo-link h1 {
  margin-top: 0.3rem;
  font-size: 1.2rem;
}

.logo-image {
  height: 48px;
  width: auto;
  display: block;
}

/* ================================
   Modal - 내용형 (참여하기 등)
   사용: detail.html #joinModal
================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 90%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: modalFade 0.2s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-header button {
  border: none;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-desc {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.modal-section {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.modal-section strong {
  display: block;
  margin-bottom: 0.25rem;
}

.modal-price {
  margin: 1rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.modal-price p {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 400;
  margin-top: 0.25rem;
}

@keyframes modalFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   Modal - 지도형 (카카오맵)
   사용: index.html   #mapModal
         detail.html  #pickupMapModal

   padding을 없애고 flex로 구성해야
   .modal-map의 height:100%가 정확히 계산됨.
   padding이 있으면 카카오맵이 컨테이너 크기를
   0으로 인식해 빈 화면이 됨.
================================ */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.map-modal.hidden {
  display: none;
}

.map-modal-content {
  position: relative;
  width: min(80vw, 800px);
  height: min(80vw, 800px);
  background: white;
  border-radius: 1rem;
  /* padding 제거 — modal-map이 height:100%를 정확히 받아야 카카오맵이 렌더링됨 */
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.map-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #374151;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-map {
  width: 100%;
  height: 100%;
  /* border-radius 제거 — 부모의 overflow:hidden + border-radius로 처리 */
}

/* 지도 위 내 위치 버튼 - 지도 내부 우하단 고정 */
.location-btn {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 3;
  background: white;
  color: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-location-btn {
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10;
}

/* ================================
   Notification
================================ */
.notification-wrap {
  position: relative;
}

#notificationBtn {
  position: relative;
  padding: 0.5rem;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  transform: translate(30%, -30%);
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow: hidden;
}

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

.notification-dropdown-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #111827;
}

.notification-read-all {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #6b7280;
  padding: 0;
}

.notification-read-all:hover {
  color: #374151;
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-item {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.notification-item:hover {
  background: #f9fafb;
}

.notification-item.unread {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.notification-item.unread:hover {
  background: #dcfce7;
}

.notification-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notification-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  margin: 0;
}

.notification-item-content {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
}

.notification-item-time {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.notification-empty {
  padding: 24px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  margin: 0;
}

/* ================================
   Responsive
================================ */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .bottom-nav {
    display: flex;
  }

  .header-content {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .header-actions .btn:not(.btn-primary) {
    display: none;
  }

  .tabs-list {
    width: 100%;
  }

  .map-modal-content {
    width: 92vw;
    height: 92vw;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }

  .logo-text {
    font-size: 1rem;
  }
}
