@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&display=swap');

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

:root {
    --bg: #faf6f1; --surface: #ffffff; --surface-2: #f5f0ea; --surface-3: #ebe5dc;
    --border: #e0d8ce; --border-hover: #c9bfb3;
    --text: #2d2a26; --text-2: #6b6560; --text-3: #9c948a;
    --accent: #c96442; --accent-soft: rgba(201,100,66,0.10); --accent-hover: #b5573a;
    --tag-bg: #eee7de; --tag-text: #8a7e72;
    --tip-bg: rgba(201,100,66,0.06); --tip-border: rgba(201,100,66,0.18); --tip-text: #b05a38;
    --shadow-sm: 0 1px 3px rgba(45,42,38,0.06); --shadow-md: 0 4px 16px rgba(45,42,38,0.08);
    --radius: 12px; --radius-lg: 16px;
    --font: 'DM Sans', -apple-system, sans-serif; --font-display: 'Fraunces', Georgia, serif;
    --transition: 0.2s cubic-bezier(0.25,0.46,0.45,0.94);
}

[data-theme="dark"] {
    --bg: #1a1915; --surface: #242320; --surface-2: #2e2d28; --surface-3: #3a3832;
    --border: #3e3c36; --border-hover: #555249;
    --text: #e8e4dd; --text-2: #a09a90; --text-3: #706b62;
    --accent: #e07a54; --accent-soft: rgba(224,122,84,0.12); --accent-hover: #f08a64;
    --tag-bg: #33322c; --tag-text: #8a8378;
    --tip-bg: rgba(224,122,84,0.08); --tip-border: rgba(224,122,84,0.20); --tip-text: #e89070;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2); --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
}

html, body { height: 100%; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow: hidden; transition: background var(--transition), color var(--transition); }

.app { display: grid; grid-template-columns: 400px 1fr; height: 100vh; height: 100dvh; }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); overflow: hidden; transition: background var(--transition); }
.sidebar-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 34px; background: var(--accent); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 2px 8px rgba(201,100,66,0.25); }
.logo-text { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.icon-btn { width: 34px; height: 34px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all var(--transition); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

/* INPUT */
.input-section { padding: 16px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.city-row { display: flex; gap: 6px; margin-bottom: 10px; }
.input-field { flex: 1; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 14px; outline: none; transition: all var(--transition); }
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input-field::placeholder { color: var(--text-3); }
.geo-btn { width: 40px; height: 40px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all var(--transition); flex-shrink: 0; }
.geo-btn:hover { border-color: var(--accent); color: var(--accent); }
.geo-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.query-wrap { position: relative; margin-bottom: 12px; }
.query-input { width: 100%; padding: 12px 14px 12px 14px; padding-right: 48px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; outline: none; resize: none; min-height: 64px; transition: all var(--transition); }
.query-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.query-input::placeholder { color: var(--text-3); }
.send-btn { position: absolute; bottom: 8px; right: 8px; width: 34px; height: 34px; background: var(--accent); border: none; border-radius: 8px; color: #fff; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); box-shadow: 0 2px 8px rgba(201,100,66,0.25); }
.send-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* TRANSPORT MODE */
.transport-row { display: flex; gap: 6px; margin-bottom: 12px; }
.transport-btn { flex: 1; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-2); cursor: pointer; font-size: 18px; text-align: center; transition: all var(--transition); }
.transport-btn:hover { border-color: var(--accent); color: var(--accent); }
.transport-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* CHIPS */
.theme-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-chip { padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all var(--transition); white-space: nowrap; user-select: none; }
.theme-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-icon { margin-right: 3px; }

/* ROUTE */
.route-area { flex: 1; overflow-y: auto; padding: 18px 22px; scroll-behavior: smooth; }
.route-area::-webkit-scrollbar { width: 5px; }
.route-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.route-header { margin-bottom: 14px; animation: slideUp 0.4s ease-out; }
.route-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.route-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.route-meta { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.meta-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 4px 10px; background: var(--tag-bg); color: var(--tag-text); border-radius: 20px; }

/* POINT CARDS */
.point-card { display: flex; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: all var(--transition); animation: slideUp 0.4s ease-out both; }
.point-card:nth-child(2) { animation-delay: 0.05s; }
.point-card:nth-child(3) { animation-delay: 0.10s; }
.point-card:nth-child(4) { animation-delay: 0.15s; }
.point-card:nth-child(5) { animation-delay: 0.20s; }
.point-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); transform: translateX(3px); }
.point-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.point-num { width: 30px; height: 30px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.point-info { flex: 1; min-width: 0; }
.point-name { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.point-rating { font-size: 12px; color: var(--accent); font-weight: 600; margin-left: 4px; }
.point-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.point-address { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-style: italic; }
.point-time { font-size: 11px; color: var(--accent); margin-top: 5px; font-weight: 600; }

/* TIPS */
.tips-box { margin-top: 14px; padding: 13px 15px; background: var(--tip-bg); border: 1px solid var(--tip-border); border-radius: var(--radius); font-size: 13px; color: var(--tip-text); line-height: 1.55; animation: slideUp 0.4s ease-out 0.3s both; }
.tips-label { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 5px; opacity: 0.8; }

/* MAP */
.map-container { position: relative; background: var(--surface-2); }
#map { width: 100%; height: 100%; }

/* STATES */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 14px; }
.spinner { width: 32px; height: 32px; border: 2.5px 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 { font-size: 13px; color: var(--text-3); animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 28px; text-align: center; gap: 8px; }
.empty-icon { font-size: 40px; opacity: 0.25; margin-bottom: 4px; }
.empty-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.empty-desc { font-size: 13px; color: var(--text-3); line-height: 1.55; max-width: 260px; }
.error-box { padding: 13px 15px; background: rgba(200,50,50,0.06); border: 1px solid rgba(200,50,50,0.18); border-radius: var(--radius); color: #c04040; font-size: 13px; margin: 18px 0; line-height: 1.5; }

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

/* MOBILE */
@media (max-width: 900px) { .app { grid-template-columns: 340px 1fr; } }
@media (max-width: 680px) {
    .app { grid-template-columns: 1fr; grid-template-rows: 1fr; position: relative; }
    .sidebar { position: absolute; bottom: 0; left: 0; right: 0; z-index: 100; max-height: 54vh; border-right: none; border-top: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,0.10); transition: max-height 0.35s ease; }
    .sidebar.collapsed { max-height: 68px; }
    .sidebar.expanded { max-height: 85vh; }
    .sidebar-header::before { content: ''; display: block; width: 36px; height: 4px; background: var(--border-hover); border-radius: 4px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); }
    .sidebar-header { position: relative; padding-top: 22px; cursor: grab; }
    .map-container { grid-row: 1; height: 100vh; height: 100dvh; }
    .input-section { padding: 12px 16px; }
    .route-area { padding: 14px 16px; }
}
