/* =============================================
   ミセミル × LUMINA TOKYO
   ブランドカラー: #d65f4b (東京タワー・コーラル), #111 (チャコール)
   ============================================= */

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

:root {
  --color-brand:       #d65f4b;
  --color-brand-dark:  #a84337;
  --color-black:       #111111;
  --color-white:       #ffffff;
  --color-bg:          #fafafa;
  --color-border:      #e5e7eb;
  --color-text:        #222222;
  --color-text-muted:  #6b7280;

  /* チャット */
  --color-chat-bg:         #ffffff;
  --color-msg-user-bg:     #111111;
  --color-msg-user-text:   #ffffff;
  --color-msg-ai-bg:       #f4f4f4;
  --color-msg-ai-text:     #222222;

  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', 'Segoe UI', sans-serif;
  --chat-width: 360px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================
   ヘッダー
   ============================================= */

.site-header {
  background: var(--color-black);
  border-bottom: 3px solid var(--color-brand);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-monogram {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-name {
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-left: 10px;
}

.logo-fallback {
  display: none;
  color: var(--color-white);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--color-white);
}

/* =============================================
   ページヒーロー
   ============================================= */

.page-hero {
  background:
    linear-gradient(90deg, rgba(17,17,17,0.95) 0%, rgba(17,17,17,0.72) 46%, rgba(17,17,17,0.34) 100%),
    url('/public/lumina-tokyo-hero.png') center / cover no-repeat;
  color: var(--color-white);
  padding: 40px 24px 36px;
  text-align: center;
}

.page-hero-demo {
  display: inline-block;
  margin-top: 16px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  color: rgba(255,255,255,0.58);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.page-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.page-hero-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 10px;
}

.page-hero-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.page-hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.8;
}

/* =============================================
   3Dツアーセクション
   ============================================= */

.tour-section {
  flex: 1;
  background: #111;
}

.tour-wrapper {
  display: grid;
  grid-template-columns: 1fr var(--chat-width);
  height: calc(100vh - 60px - 96px - 70px); /* ヘッダー・ヒーロー・店舗情報バーを除いた高さ */
  min-height: 480px;
  max-height: 700px;
}

/* Matterport ビューア */
#showcase-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
}

.showcase-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#showcase {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  position: relative;
  z-index: 1;
}

#showcase-wrapper.static-visual #showcase {
  display: none;
}

#showcase-wrapper.static-visual .sdk-loading {
  display: none;
}

.sdk-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  gap: 16px;
  transition: opacity 0.5s;
}

.sdk-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   チャットパネル
   ============================================= */

#chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-chat-bg);
  border-left: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

#chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-brand);
  color: var(--color-white);
  flex-shrink: 0;
}

.header-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.header-title {
  font-size: 13px;
  font-weight: 700;
}

.header-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}

/* メッセージエリア */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.message-bubble {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  gap: 6px;
  animation: fadeUp 0.2s ease;
}

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

.message-bubble.user    { align-self: flex-end; align-items: flex-end; }
.message-bubble.assistant { align-self: flex-start; align-items: flex-start; }

.bubble-text {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.message-bubble.user .bubble-text {
  background: var(--color-msg-user-bg);
  color: var(--color-msg-user-text);
  border-bottom-right-radius: 4px;
}

.message-bubble.assistant .bubble-text {
  background: var(--color-msg-ai-bg);
  color: var(--color-msg-ai-text);
  border-bottom-left-radius: 4px;
}

/* 予約ボタン */
.reserve-button {
  display: inline-block;
  padding: 9px 16px;
  background: var(--color-brand);
  color: var(--color-white);
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}

.reserve-button:hover  { background: var(--color-brand-dark); transform: translateY(-1px); }
.reserve-button:active { transform: translateY(0); }

/* タイピングインジケーター */
#typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px 2px;
  flex-shrink: 0;
}

#typing-indicator[hidden] { display: none; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: bounce 1.2s ease infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* サジェストチップ */
#suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 14px;
  flex-shrink: 0;
}

#suggestion-chips.hidden { display: none; }

.chip {
  padding: 5px 11px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  background: transparent;
  color: var(--color-text);
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--color-brand);
  background: rgba(178, 38, 39, 0.05);
}

/* 入力フォーム */
#chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  padding: 9px 13px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--color-text);
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s;
}

#chat-input:focus {
  border-color: var(--color-brand);
  background: var(--color-white);
}

#chat-input::placeholder { color: var(--color-text-muted); }

#send-button {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--color-brand);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

#send-button:hover   { background: var(--color-brand-dark); }
#send-button:active  { transform: scale(0.95); }
#send-button:disabled { background: var(--color-border); cursor: not-allowed; }

/* =============================================
   店舗情報バー
   ============================================= */

.store-info-bar {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.store-info-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.store-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-info-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.store-info-value {
  font-size: 13px;
  color: var(--color-text);
}

.store-info-value a {
  color: var(--color-text);
  text-decoration: none;
}

.store-reserve-btn {
  margin-left: auto;
  padding: 10px 22px;
  background: var(--color-brand);
  color: var(--color-white);
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.15s;
  white-space: nowrap;
}

.store-reserve-btn:hover { background: var(--color-brand-dark); }

/* =============================================
   フッター
   ============================================= */

.site-footer {
  background: var(--color-black);
  padding: 28px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-copy {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}

/* =============================================
   モバイル（768px以下）
   ============================================= */

@media (max-width: 768px) {
  .tour-wrapper {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  #showcase-wrapper {
    height: 52vw;
    min-height: 220px;
    max-height: 360px;
  }

  #chat-panel {
    height: 360px;
    border-left: none;
    border-top: 3px solid var(--color-brand);
  }

  .store-info-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .store-reserve-btn {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .header-inner {
    padding: 0 16px;
  }
}
