/* ================================================================
   FixOrPro AI — Premium Dark Chat UI
   Design: Glassmorphism · Deep Dark Mode · Vibrant Accents
   ================================================================ */

/* ── TOKENS ── */
:root {
  --bg-0: #08080f;
  --bg-1: #0e0e1a;
  --bg-2: #14142a;
  --bg-3: #1c1c38;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.14);

  /* Brand accents */
  --accent: #5b8cff;
  --accent-2: #a259ff;
  --accent-teal: #38e8c8;
  --gradient-brand: linear-gradient(135deg, #5b8cff 0%, #a259ff 100%);
  --gradient-teal: linear-gradient(135deg, #38e8c8 0%, #5b8cff 100%);
  --gradient-warn: linear-gradient(135deg, #ff6b6b 0%, #ff9f43 100%);

  /* Text - 고선명 고대비 톤업 */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;

  /* Chat bubbles */
  --bubble-user-bg: linear-gradient(135deg, #5b8cff 0%, #a259ff 100%);
  --bubble-ai-bg: #181b36;
  --bubble-ai-border: rgba(130, 165, 255, 0.35);

  /* Sidebar */
  --sidebar-w: 260px;
  --topbar-h: 64px;

  /* Spacing */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Shadows */
  --shadow-glow: 0 0 40px rgba(91,140,255,0.15);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.5);

  /* Typography */
  --font: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-primary);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100dvh;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 200;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-wrap { display: flex; align-items: center; gap: 12px; }

.logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient-brand);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(91,140,255,0.35);
}

.logo-name { font-size: 16px; font-weight: 700; color: var(--text-primary); display: block; }
.logo-sub { font-size: 11px; color: var(--text-muted); display: block; }

.sidebar-close { display: none; font-size: 14px; color: var(--text-muted); padding: 6px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(91,140,255,0.12);
  color: var(--accent);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer-text { font-size: 11px; color: var(--text-muted); line-height: 1.5; font-weight: 500; }

.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.legal-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.legal-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

.affiliate-disclosure-text {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================================================================
   APP SHELL
   ================================================================ */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  min-width: 0;
}

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  height: var(--topbar-h);
  background: rgba(8,8,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-brand { display: flex; align-items: center; gap: 10px; flex: 1; }

.topbar-icon {
  width: 36px; height: 36px;
  background: var(--gradient-brand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 12px rgba(91,140,255,0.3);
}

.topbar-name { font-size: 15px; font-weight: 700; }
.topbar-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 🌐 언어 전환 스위처 버튼 */
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  background: rgba(91, 140, 255, 0.16);
  border: 1.2px solid rgba(130, 165, 255, 0.4);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}

.lang-switch-btn:hover {
  background: var(--gradient-brand);
  border-color: #a259ff;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.35);
}

.lang-switch-btn:active {
  transform: scale(0.97);
}

/* ── Button icon base ── */
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text-primary); }

/* Hamburger */
.hamburger {
  display: block; width: 16px; height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all 0.2s ease;
}
.hamburger + .hamburger { margin-top: 4px; }

/* ================================================================
   CHAT AREA
   ================================================================ */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  scroll-behavior: smooth;
  position: relative;
}

/* ================================================================
   WELCOME SCREEN
   ================================================================ */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--topbar-h) - 180px);
  padding: 24px 16px;
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}

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

.hero-icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 24px rgba(91,140,255,0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-title {
  font-size: 30px;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.hero-sub { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; }

/* ── 메인 사진 촬영 즉시 진단 CTA 버튼 ── */
.hero-photo-cta {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 32px;
}

.hero-camera-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(91,140,255,0.18), rgba(162,89,255,0.15));
  border: 1.5px solid rgba(91,140,255,0.4);
  border-radius: var(--r-xl);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(91,140,255,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: left;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.hero-camera-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s ease;
}

.hero-camera-btn:hover::before {
  left: 100%;
}

.hero-camera-btn:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(91,140,255,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

.hero-camera-btn:active {
  transform: translateY(0) scale(0.99);
}

.hero-camera-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(91,140,255,0.25);
  border-radius: 16px;
  border: 1px solid rgba(91,140,255,0.4);
  flex-shrink: 0;
  animation: cameraPulse 2s infinite ease-in-out;
}

@keyframes cameraPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(91,140,255,0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 16px 4px rgba(91,140,255,0.3); }
}

.hero-camera-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-camera-info strong {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-camera-info small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.hero-camera-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-brand);
  padding: 4px 10px;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(162,89,255,0.4);
  white-space: nowrap;
}

.welcome-examples { margin-top: 20px; width: 100%; max-width: 640px; }

.examples-label { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.example-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91,140,255,0.15);
}

.example-icon { font-size: 24px; }
.example-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ================================================================
   MESSAGES
   ================================================================ */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 max(16px, calc(50% - 380px));
  max-width: 100%;
}

.message-row {
  display: flex;
  gap: 10px;
  animation: msgIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
}

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

.message-row.user { justify-content: flex-end; }
.message-row.ai { justify-content: flex-start; }

/* AI avatar */
.ai-avatar {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(91,140,255,0.3);
}

/* Bubble */
.bubble {
  max-width: min(520px, 80%);
  padding: 12px 16px;
  border-radius: var(--r-xl);
  line-height: 1.65;
  font-size: 14.5px;
  word-break: break-word;
}

.bubble.user {
  background: var(--bubble-user-bg);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bubble.ai {
  background: var(--bubble-ai-bg);
  border: 1px solid var(--bubble-ai-border);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(10px);
}

/* Markdown in bubble */
.bubble strong { color: inherit; font-weight: 600; }
.bubble em { font-style: italic; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.bubble li { margin-bottom: 3px; }
.bubble code {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  font-family: 'Fira Code', monospace;
}

/* Attached image in bubble */
.bubble-image {
  max-width: 240px;
  border-radius: var(--r-md);
  margin-bottom: 8px;
  display: block;
  cursor: zoom-in;
}

/* ── TYPING INDICATOR ── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}

.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ================================================================
   2-TRACK SOLUTION CARDS (고대비 & 고선명 리뉴얼)
   ================================================================ */
.track-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  width: 100%;
  max-width: 100%;
}

.track-card {
  border-radius: var(--r-lg);
  padding: 16px 14px;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
}

.track-card:hover {
  transform: translateY(-3px);
}

/* 🔧 DIY 카드: 산뜻한 딥 에메랄드 네이비 배경 & 선명한 민트 테두리 */
.track-card.diy {
  background: linear-gradient(150deg, #152433 0%, #161e38 100%);
  border: 1.8px solid #2fdcb9;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 16px rgba(47, 220, 185, 0.2);
}

.track-card.diy:hover {
  border-color: #5ef3d4;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(47, 220, 185, 0.35);
}

/* 👷 PRO 카드: 고급스러운 딥 바이올렛 네이비 배경 & 선명한 퍼플 테두리 */
.track-card.pro {
  background: linear-gradient(150deg, #281938 0%, #1a1a36 100%);
  border: 1.8px solid #a855f7;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 16px rgba(168, 85, 247, 0.22);
}

.track-card.pro:hover {
  border-color: #c084fc;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(168, 85, 247, 0.4);
}

.track-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
  width: fit-content;
}

.track-badge.diy {
  background: rgba(47, 220, 185, 0.2);
  color: #38e8c8;
  border: 1px solid rgba(47, 220, 185, 0.4);
}

.track-badge.pro {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* 🌟 선명한 카드 제목 */
.track-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* 🌟 선명한 카드 상세 정보 (회색 제거 -> 또렷한 화이트/아이보리) */
.track-meta {
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.7;
  font-weight: 500;
}

.track-meta span {
  display: block;
  color: #f8fafc;
}

/* 설명 요약 박스 */
.track-meta[style*="margin-top"] {
  background: rgba(255, 255, 255, 0.07);
  padding: 8px 10px;
  border-radius: 8px;
  color: #e2e8f0 !important;
  font-size: 12.5px !important;
  border-left: 3px solid #38e8c8;
}

.track-card.pro .track-meta[style*="margin-top"] {
  border-left-color: #a855f7;
}

.track-savings {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.track-urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  width: fit-content;
}

.urgency-routine { background: rgba(74,222,128,0.2); color: #4ade80; border: 1px solid rgba(74,222,128,0.4); }
.urgency-soon { background: rgba(251,191,36,0.2); color: #fde047; border: 1px solid rgba(251,191,36,0.4); }
.urgency-urgent { background: rgba(251,146,60,0.25); color: #fb923c; border: 1px solid rgba(251,146,60,0.5); }
.urgency-emergency { background: rgba(239,68,68,0.25); color: #f87171; border: 1px solid rgba(239,68,68,0.5); animation: urgencyPulse 1.5s infinite; }

@keyframes urgencyPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 🛒 필요 부품 리스트 (밝고 선명한 개별 카드 형태) */
.parts-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.parts-title {
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.part-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  margin-bottom: 5px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.part-row:last-child {
  margin-bottom: 0;
}

.part-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
}

.part-price {
  font-size: 12.5px;
  font-weight: 700;
  color: #38e8c8;
  white-space: nowrap;
}

.part-links {
  display: flex;
  gap: 4px;
}

.part-amazon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff9900 0%, #e68a00 100%);
  color: #111827 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(255, 153, 0, 0.35);
}

.part-amazon-btn:hover {
  background: linear-gradient(135deg, #ffac33 0%, #ff9900 100%);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.55);
  color: #000000 !important;
  text-decoration: none;
}

.part-amazon-btn:active {
  transform: translateY(0) scale(0.98);
}

.part-homedepot-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f96302 0%, #d84b00 100%);
  color: #ffffff !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(249, 99, 2, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.part-homedepot-btn:hover {
  background: linear-gradient(135deg, #ff7a1f 0%, #f96302 100%);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 12px rgba(249, 99, 2, 0.6);
  color: #ffffff !important;
  text-decoration: none;
}

.part-homedepot-btn:active {
  transform: translateY(0) scale(0.98);
}

.part-link {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  background: #2563eb;
  color: #ffffff !important;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.part-link:hover {
  background: #3b82f6;
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
  text-decoration: none;
}

.track-cta {
  margin-top: 14px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.track-cta.diy {
  background: var(--gradient-teal);
  color: #080a14;
  box-shadow: 0 4px 14px rgba(56, 232, 200, 0.35);
}

.track-cta.diy:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 232, 200, 0.5);
}

.track-cta.pro {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(162, 89, 255, 0.35);
}

.track-cta.pro:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(162, 89, 255, 0.5);
}

/* ================================================================
   CHIP BAR
   ================================================================ */
.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px max(16px, calc(50% - 380px));
  padding-bottom: 6px;
  min-height: 0;
  transition: all 0.2s ease;
  border-top: 1px solid transparent;
}

.chip-bar.has-chips {
  border-top-color: var(--border);
}

.chip {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  animation: chipIn 0.25s ease both;
}

@keyframes chipIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chip:hover {
  background: rgba(91,140,255,0.12);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.chip:nth-child(2) { animation-delay: 0.05s; }
.chip:nth-child(3) { animation-delay: 0.1s; }
.chip:nth-child(4) { animation-delay: 0.15s; }

/* ================================================================
   INPUT AREA & HIGH-CONTRAST CHAT BAR
   ================================================================ */
.input-area {
  padding: 12px max(16px, calc(50% - 380px)) 16px;
  border-top: 1px solid var(--border);
  background: rgba(8, 8, 15, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

/* Image preview */
.img-preview-wrap {
  margin-bottom: 8px;
}

.img-preview-inner {
  display: inline-flex;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-bright);
}

.img-preview {
  max-height: 100px;
  max-width: 160px;
  display: block;
  object-fit: cover;
}

.img-remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
}

/* 🌟 하단 입력 레이아웃 (사진진단 버튼 + 문자 입력칸 나란히 배치) */
.input-row-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* 📷 문자 입력칸 '바로 옆'에 확실하게 보이는 독립된 사진진단 버튼 */
.side-camera-btn {
  height: 50px;
  padding: 0 18px;
  border-radius: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2a3469 0%, #3a276b 100%);
  border: 2px solid rgba(130, 170, 255, 0.6);
  box-shadow: 0 4px 18px rgba(91, 140, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  text-decoration: none;
}

/* ⚡ 마우스 커서 올렸을 때 (Hover) 화려하고 선명한 네온 하이라이트! */
.side-camera-btn:hover {
  background: linear-gradient(135deg, #4d70ff 0%, #8c3df5 100%) !important;
  border-color: #a8c8ff !important;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 0 28px rgba(115, 165, 255, 0.7), 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.side-camera-btn:active {
  transform: translateY(0) scale(0.97);
}

.side-camera-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.side-camera-btn:hover .side-camera-icon {
  transform: scale(1.25) rotate(-10deg);
}

.side-camera-text {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: text-shadow 0.2s ease;
}

.side-camera-btn:hover .side-camera-text {
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

/* 💬 눈에 확 띄는 고대비 프리미엄 문자 입력칸 (Input bar) */
.input-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1c38; /* 배경과 확실히 구분되는 밝고 입체적인 네이비 */
  border: 2px solid rgba(130, 165, 255, 0.45);
  border-radius: 25px;
  padding: 4px 6px 4px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(91, 140, 255, 0.12);
  transition: all 0.22s ease;
  min-height: 50px;
  cursor: text;
}

/* ⚡ 문자 입력칸에 마우스 커서 올렸을 때 (Hover) 즉시 발광 하이라이트! */
.input-bar:hover {
  border-color: #6ea2ff;
  background: #232752;
  box-shadow: 0 0 25px rgba(91, 140, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

/* ⚡ 문자 입력칸 클릭하여 포커스될 때 (Focus) */
.input-bar:focus-within {
  border-color: #38e8c8;
  background: #262b5c;
  box-shadow: 0 0 30px rgba(56, 232, 200, 0.35), 0 0 16px rgba(91, 140, 255, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .side-camera-btn {
    padding: 0 12px;
    height: 46px;
  }
  .side-camera-text {
    font-size: 12.5px;
  }
}

/* 💬 텍스트 입력창 */
.message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px 0;
  caret-color: #5b8cff;
}

.message-input::placeholder {
  color: rgba(215, 225, 255, 0.65); /* 선명하고 또렷하게 보이는 안내 문구 */
  font-size: 14px;
  font-weight: 400;
}

/* 🚀 전송 버튼 */
.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(91, 140, 255, 0.3);
}

.send-btn svg { width: 16px; height: 16px; }

.send-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(91, 140, 255, 0.5);
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  line-height: 1.5;
}

.input-hint a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.input-hint a:hover {
  color: var(--accent);
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-xl);
  padding: 28px;
  width: min(480px, calc(100vw - 32px));
  position: relative;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 28px; height: 28px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text-primary); }

.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

.modal-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-md);
  padding: 11px 44px 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s ease;
}
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--text-muted); }

.modal-toggle-pw {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border: none;
  background: none;
}

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }

.btn-primary {
  padding: 9px 20px;
  border-radius: var(--r-sm);
  background: var(--gradient-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  padding: 9px 20px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover { background: var(--surface-hover); color: var(--text-primary); }

.modal-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

/* ================================================================
   RESPONSIVE — MOBILE
   ================================================================ */
@media (max-width: 680px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    z-index: 500;
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 400;
    animation: fadeIn 0.2s ease;
  }

  .track-container { grid-template-columns: 1fr; }

  .examples-grid { grid-template-columns: repeat(2, 1fr); }

  .hero-title { font-size: 22px; }
  .hero-icon { font-size: 44px; }

  .messages-list { padding: 0 12px; }
  .input-area { padding: 8px 12px 12px; }
  .chip-bar { padding: 8px 12px; }
}

@media (max-width: 400px) {
  .examples-grid { grid-template-columns: 1fr; }
}


/* ================================================================
   📋 LEAD 수집 모달 & 견적서 CTA 버튼 스타일 (v3.0)
   ================================================================ */

/* 견적서 받기 CTA 버튼 (트랙 카드 하단) */
.estimate-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #5b8cff 0%, #a259ff 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 20px rgba(91,140,255,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.estimate-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(91,140,255,0.50);
}
.estimate-cta-btn:active {
  transform: translateY(0);
  opacity: 0.88;
}

/* Lead 모달 전용 카드 */
.lead-modal-card {
  max-width: 420px;
  padding: 36px 32px 28px;
}

/* Lead 모달 아이콘 */
.lead-modal-icon {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 10px;
  animation: iconPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes iconPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Lead 폼 */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.lead-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lead-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.lead-label .required {
  color: #ff6b6b;
  margin-left: 2px;
}

/* Lead 모달 액션 버튼 행 */
.lead-modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.lead-modal-actions .btn-secondary {
  flex: 0 0 auto;
  min-width: 72px;
}

.lead-modal-actions .lead-submit-btn {
  flex: 1;
  font-size: 0.97rem;
  padding: 13px 20px;
  background: linear-gradient(135deg, #5b8cff 0%, #a259ff 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.lead-modal-actions .lead-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.lead-modal-actions .lead-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
