/* static/css/common.css */

@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Inter:wght@300;400;600;700&display=swap");

:root {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1a2235;
  --border: #1e2d45;
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --accent3: #10b981;
  --accent4: #f59e0b;
  --accent5: #ef4444;
  --text: #e8f0fe;
  --text-muted: #6b7fa3;
  --text-dim: #3a4a6b;
  --glow: rgba(0, 212, 255, 0.15);
  --glow2: rgba(124, 58, 237, 0.15);
  --font-main: "Noto Sans KR", sans-serif;
  --font-data: "Inter", sans-serif;
  --large-mode: 1;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* =========================================================
   [완벽한 밝은 화면 모드 (Light Theme) 오버라이딩]
========================================================= */
body.light-theme {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --glow: rgba(0, 212, 255, 0.4);
  --glow2: rgba(124, 58, 237, 0.4);
}

body.light-theme .nav-bar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body.light-theme#screen-home {
  background:
    radial-gradient(
      ellipse at 60% 0%,
      rgba(0, 212, 255, 0.15) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 10% 80%,
      rgba(124, 58, 237, 0.15) 0%,
      transparent 50%
    ),
    var(--bg);
}
body.light-theme#screen-chat {
  background:
    radial-gradient(
      ellipse at 80% 20%,
      rgba(124, 58, 237, 0.1) 0%,
      transparent 50%
    ),
    var(--bg);
}
body.light-theme#screen-robot {
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(16, 185, 129, 0.1) 0%,
      transparent 50%
    ),
    var(--bg);
}
body.light-theme .map-mock {
  width: 100%;
  height: 250px;
  border-radius: 12px;
  /* 기존 그라데이션을 지우고 img 폴더의 지도 이미지를 불러옵니다. */
  background-image:
    linear-gradient(rgba(10, 14, 26, 0), rgba(10, 14, 26, 0)),
    url("../img/dashboard-map.png");
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
body.light-theme .map-road {
  background: #cbd5e1;
}
body.light-theme .arena-canvas {
  background: #e2e8f0;
}
body.light-theme .robot-dot {
  box-shadow: 0 0 10px var(--accent3);
}
body.light-theme .chat-sidebar {
  background: #f8fafc;
}
body.light-theme .msg.ai .msg-bubble {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-color: #e2e8f0;
}
body.light-theme .nav-tab.active,
body.light-theme .report-btn.active {
  color: #ffffff;
}

/* dark theme */
[data-theme="dark"] {
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
/* =========================================================
   [전역 리셋 및 레이아웃]
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

/* =========================================================
   [네비게이션 바 (공통)]
========================================================= */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(10, 14, 26, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
  margin-right: 40px;
}
.nav-logo span {
  color: var(--text);
  font-weight: 400;
}
.nav-dot {
  width: 8px;
  height: 8px;
  background: var(--accent3);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.nav-tabs {
  display: flex;
  gap: 10px;
}
.nav-tab {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-tab:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-tab.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.nav-time {
  font-family: var(--font-data);
  font-size: 24px;
  color: var(--text-muted);
}

/* =========================================================
   [보이스 모달 (공통)]
========================================================= */
.voice-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}
.voice-modal.open {
  display: flex;
}
.voice-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 56px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 650px;
  width: 90%;
}
.voice-orb {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 212, 255, 0.3),
    rgba(0, 212, 255, 0.05)
  );
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.3);
  animation: breathe 2s ease-in-out infinite;
}
@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 80px rgba(0, 212, 255, 0.6);
  }
}
.voice-title {
  font-size: 80px;
  font-weight: 700;
}
.voice-sub {
  font-size: 32px;
  color: var(--text-muted);
  line-height: 1.6;
}
.voice-transcript {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  width: 100%;
  font-size: 32px;
  color: var(--accent);
  min-height: 50px;
  font-family: var(--font-data);
}
.btn-close-voice {
  padding: 12px 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 32px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-close-voice:hover {
  border-color: var(--accent5);
  color: var(--accent5);
}

/* =========================================================
   [스크롤바 유틸리티 (공통)]
========================================================= */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
