@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Space+Grotesk:wght@600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; height: 100%; }

/* ══════════════════════════════════
   THEME VARIABLES
   ══════════════════════════════════ */
:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface2: #f0f0f3;
  --border: rgba(0,0,0,0.08);
  --text: #1a1a2e;
  --text-muted: #6b6b80;
  --accent: #e53935;
  --accent-hover: #c62828;
  --accent-light: rgba(229,57,53,0.08);
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --logo-gradient: linear-gradient(135deg, #1a1a2e 30%, #e53935);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
}

/* ══════════════════════════════════
   SITE HEADER
   ══════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.site-header-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.site-header-logo-text {
  font-family: 'Space Grotesk', 'Noto Sans JP', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--logo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.site-header-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════
   MAP
   ══════════════════════════════════ */
#map {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* ══════════════════════════════════
   CUSTOM MARKER
   ══════════════════════════════════ */
.custom-marker {
  background: none;
  border: none;
}
.marker-pin {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(229,57,53,0.4);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.marker-pin:hover {
  transform: rotate(-45deg) scale(1.2);
  box-shadow: 0 5px 16px rgba(229,57,53,0.5);
}
.marker-pin .marker-icon {
  transform: rotate(45deg);
  font-size: 18px;
  line-height: 1;
}

/* ══════════════════════════════════
   SIDEBAR OVERLAY
   ══════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 400;
}
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════
   HOTEL SIDEBAR
   ══════════════════════════════════ */
.hotel-sidebar {
  position: fixed;
  top: 48px;
  right: 0;
  width: 380px;
  height: calc(100vh - 48px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  z-index: 500;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hotel-sidebar.open {
  transform: translateX(0);
}
.sidebar-handle { display: none; }
.sidebar-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 12px 12px 0 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.sidebar-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Sidebar content */
.sidebar-hotel-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.sidebar-body {
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-hotel-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}
.sidebar-hotel-address {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.sidebar-hotel-address::before {
  content: '';
  display: inline-block;
  width: 4px;
  min-height: 16px;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Info grid */
.sidebar-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sidebar-info-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-info-item.full-width {
  grid-column: 1 / -1;
}
.sidebar-info-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.sidebar-info-value {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

/* Review stars */
.sidebar-review {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-stars {
  color: #f59e0b;
  font-size: 0.9rem;
  letter-spacing: 1px;
}
.review-score {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.review-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Description */
.sidebar-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Access */
.sidebar-access {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.sidebar-access-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* Price */
.sidebar-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.sidebar-price-amount {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.sidebar-price-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Affiliate button */
.sidebar-affiliate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(229,57,53,0.3);
}
.sidebar-affiliate-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229,57,53,0.35);
}
.sidebar-affiliate-btn:active {
  transform: scale(0.98);
}

/* ══════════════════════════════════
   LEAFLET OVERRIDES
   ══════════════════════════════════ */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.leaflet-popup-content {
  margin: 0;
  line-height: 1.5;
}
.leaflet-popup-tip {
  box-shadow: none;
}

/* Mini popup on marker click */
.mini-popup {
  padding: 12px 16px;
  min-width: 200px;
  cursor: pointer;
}
.mini-popup-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.mini-popup-address {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.mini-popup-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mini-popup-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}
.mini-popup-cta {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
}

/* ══════════════════════════════════
   THREADS POST BUBBLE
   ══════════════════════════════════ */
.threads-bubble {
  padding: 14px 16px;
  min-width: 260px;
  max-width: 320px;
  cursor: pointer;
}
.threads-bubble-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.threads-bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e, #e53935);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.threads-bubble-avatar-icon {
  font-size: 16px;
  line-height: 1;
}
.threads-bubble-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.threads-bubble-username {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.threads-bubble-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.threads-bubble-logo {
  margin-left: auto;
  font-size: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}
.threads-bubble-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 12px;
}
.threads-bubble-engagement {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.threads-bubble-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.threads-bubble-stat-icon {
  font-size: 14px;
  line-height: 1;
}
.threads-bubble-cta {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

/* ══════════════════════════════════
   LOADING OVERLAY
   ══════════════════════════════════ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245,245,248,0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.loading-overlay.hidden {
  display: none;
}
.loading-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ══════════════════════════════════
   RESPONSIVE (MOBILE)
   ══════════════════════════════════ */
@media (max-width: 768px) {
  .site-header-sub { display: none; }

  /* ボトムシートスタイル */
  .hotel-sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 75vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transform: translateY(110%);
    box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
  }
  .hotel-sidebar.open {
    transform: translateY(0);
  }

  /* ドラッグハンドル */
  .sidebar-handle {
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 12px auto 4px;
    flex-shrink: 0;
  }

  .sidebar-hotel-image { height: 200px; }

  /* マーカーを大きく（タップしやすく） */
  .marker-pin {
    width: 48px;
    height: 48px;
  }
  .marker-pin .marker-icon { font-size: 22px; }
}
