/* ============================================
   Smart-Navi — Styles + Tag/Nacht-Theme
   ============================================ */

/* --- CSS Variablen (Tag-Modus Standard) --- */
:root {
  --bg: #F0F4F8;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --text: #1A202C;
  --text-secondary: #4A5568;
  --accent: #2B6CB0;
  --accent-light: #3182CE;
  --border: #E2E8F0;
  --success: #38A169;
  --warning: #E53E3E;
  --shadow: rgba(0, 0, 0, 0.1);
  --radius: 12px;
}

/* Nacht-Modus */
[data-theme="dark"] {
  --bg: #1A202C;
  --bg-card: #2D3748;
  --bg-input: #2D3748;
  --text: #E2E8F0;
  --text-secondary: #A0AEC0;
  --accent: #63B3ED;
  --accent-light: #4299E1;
  --border: #4A5568;
  --shadow: rgba(0, 0, 0, 0.3);
}

/* --- Reset & Basis --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  z-index: 100;
  flex-shrink: 0;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-right {
  display: flex;
  gap: 8px;
}

.header-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.header-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Karte --- */
#map-container {
  flex: 1;
  min-height: 0;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-placeholder {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Ergebnis-Panel --- */
#results-panel {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  max-height: 40vh;
  overflow-y: auto;
  flex-shrink: 0;
}

#ai-response {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* --- Places-Liste --- */
#places-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.place-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.place-item:active {
  background: var(--border);
}

.place-info {
  flex: 1;
}

.place-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.place-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.place-distance {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-left: 12px;
  white-space: nowrap;
}

/* --- Navigation Actions --- */
.mode-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-btn {
  flex: 1;
  padding: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.navigate-btn {
  width: 100%;
  padding: 14px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.navigate-btn:active {
  background: #2f855a;
}

/* --- Reise-Tipps --- */
#travel-tips {
  margin-top: 10px;
  padding: 10px 12px;
  background: #FFF8E1;
  border-left: 4px solid #F6AD55;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #744210;
}

[data-theme="dark"] #travel-tips {
  background: #3D2E0A;
  color: #F6E05E;
}

/* --- Panels (Favoriten / Verlauf) --- */
.panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
}

.panel-header h2 {
  font-size: 1.1rem;
}

.panel-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.quick-favs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-fav {
  flex: 1;
  padding: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.quick-fav:active {
  border-color: var(--accent);
}

/* Favoriten- und Verlauf-Eintraege */
.fav-item, .history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.fav-item:active, .history-item:active {
  background: var(--border);
}

.item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.item-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.item-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.item-delete {
  background: none;
  border: none;
  color: var(--warning);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* --- Eingabe-Leiste --- */
#input-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.mic-btn.recording {
  background: var(--warning);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#input-text {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#input-text:focus {
  border-color: var(--accent);
}

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

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.send-btn:active {
  background: var(--accent-light);
}

/* --- Status-Bar --- */
#status-bar {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  padding: 6px 16px;
  background: var(--accent);
  color: white;
  font-size: 0.8rem;
  text-align: center;
  z-index: 150;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* --- Utilities --- */
.hidden {
  display: none !important;
}

/* --- Leer-Zustaende --- */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
