/* ==========================================================================
   Google Fonts Import
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Outfit:wght@700;800;900&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
  --primary: #1a6b8a;         /* Adriablau - Hauptfarbe */
  --primary-light: #2a9bc2;
  --primary-dark: #0d4a63;
  --accent: #f5a623;           /* Mediterranes Orange */
  --accent-light: #f7c06a;
  --success: #4caf7d;
  --warning: #e8a838;
  --danger: #e05c5c;
  --bg-main: #f4f8fb;
  --bg-card: #ffffff;
  --text-primary: #1c2d3a;
  --text-secondary: #5a7080;
  --border: #dde8ef;
  --shadow: rgba(26, 107, 138, 0.08);
  --shadow-intensity: rgba(26, 107, 138, 0.16);
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-input: 10px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   Dark Mode Customizations
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #0a131a;
    --bg-card: #121f2b;
    --text-primary: #f0f4f8;
    --text-secondary: #8da2b3;
    --border: #1e2f3d;
    --shadow: rgba(0, 0, 0, 0.25);
    --shadow-intensity: rgba(0, 0, 0, 0.4);
    --primary-light: #32aed9;
    --primary-dark: #073447;
  }
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: calc(76px + var(--safe-bottom));
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
  user-select: text;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  user-select: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #ffffff;
  padding: 18px 20px 24px 20px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

#app-main-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.app-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 600;
}

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

.btn-header {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: var(--transition);
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* Compact Route Map in Header */
.route-map-container {
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.route-map-container:active {
  cursor: grabbing;
}
.route-map-container::-webkit-scrollbar {
  display: none;
}

.route-map {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  padding: 0 8px;
}

.route-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  cursor: pointer;
}

.node-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px var(--accent);
  transition: var(--transition);
}

.route-node:hover .node-dot {
  transform: scale(1.3);
}

.node-label {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.route-line {
  height: 2px;
  width: 24px;
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Main App Container / Views
   ========================================================================== */
.app-content {
  flex: 1;
  padding: 16px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.app-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.app-view.active {
  display: block;
}

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

/* ==========================================================================
   Bottom Navigation
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  height: calc(64px + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  gap: 4px;
  transition: var(--transition);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  transform: translateY(-2px) scale(1.1);
  fill: var(--primary);
}

/* ==========================================================================
   Common UI Components: Cards & Badges
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  box-shadow: 0 6px 18px var(--shadow-intensity);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-primary { background-color: var(--primary); color: #fff; }
.badge-accent { background-color: var(--accent); color: #fff; }
.badge-success { background-color: var(--success); color: #fff; }
.badge-warning { background-color: var(--warning); color: #fff; }
.badge-danger { background-color: var(--danger); color: #fff; }
.badge-neutral { background-color: var(--border); color: var(--text-secondary); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:active {
  background-color: var(--primary-dark);
}

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
}
.btn-accent:active {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:active {
  opacity: 0.8;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:active {
  opacity: 0.9;
}

.btn-icon-only {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

.btn-fab {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.4);
  z-index: 90;
  transition: var(--transition);
}

.btn-fab:active {
  transform: scale(0.9) rotate(90deg);
}

.btn-fab svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ==========================================================================
   Tab 1: Reiseplan specific styles
   ========================================================================== */
.date-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.date-scroller:active {
  cursor: grabbing;
}
.date-scroller::-webkit-scrollbar {
  display: none;
}

.date-chip {
  flex: 0 0 54px;
  height: 72px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px var(--shadow);
  transition: var(--transition);
  position: relative;
}

.date-chip-day {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.date-chip-num {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
}

.date-chip-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1px solid #ffffff;
}

.date-chip-travel-icon {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.65rem;
}

.date-chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.date-chip.active .date-chip-day {
  color: rgba(255, 255, 255, 0.8);
}

.date-chip.past {
  opacity: 0.55;
  background-color: var(--border);
}

/* Day Itinerary Layout */
.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.day-card-title h2 {
  font-size: 1.3rem;
}

.day-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.day-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.day-meta-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.day-meta-editable {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-main);
  border: 1px dashed var(--border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.day-route-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.route-input {
  flex: 1;
  min-width: 0; /* Erlaubt das freie Schrumpfen in Flex-Containern auf kleinen Displays */
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.85rem;
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: var(--transition);
}

.route-input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-card);
}

.route-arrow {
  color: var(--text-secondary);
  font-weight: 700;
}

.day-accommodation-select {
  height: 32px;
  padding: 0 4px;
  font-size: 0.85rem;
  flex: 1;
}

@media (max-width: 480px) {
  .day-meta-item {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .day-meta-item > span {
    font-weight: 600;
  }
  .day-route-fields {
    width: 100%;
  }
  .day-accommodation-select {
    width: 100%;
    flex: none;
  }
}

/* Activity Lists inside Itinerary */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 50px;
}

.activity-card {
  padding: 12px;
  background-color: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
  touch-action: none; /* Crucial for custom touch drag */
}

.activity-card.dragging {
  opacity: 0.5;
  border: 2px dashed var(--primary);
  transform: scale(0.98);
}

.activity-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.activity-icon-container {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.activity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.activity-time-cost {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
}

.activity-drag-handle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: grab;
}

.activity-drag-handle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================================================
   Tabs 2, 3, 5: Grid & List Cards
   ========================================================================== */
.search-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1;
  min-width: 150px;
  position: relative;
}

.search-input-wrapper input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 36px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background-color: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 11px;
  color: var(--text-secondary);
}

.search-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.select-filter {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  font-weight: 600;
}

/* Accommodations List */
.accommodation-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.acc-detail-item {
  display: flex;
  flex-direction: column;
}

.acc-detail-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.acc-detail-val {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Pool Grid Layout */
.pool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.pool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.pool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.priority-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-top-left-radius: var(--radius-card);
  border-top-right-radius: var(--radius-card);
}
.priority-must { background-color: var(--danger); }
.priority-should { background-color: var(--warning); }
.priority-can { background-color: var(--success); }

/* ==========================================================================
   Tab 4: Kosten & Dashboard
   ========================================================================== */
.costs-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.donut-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.donut-svg-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
}

.donut-inner-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.donut-inner-val {
  font-size: 1.1rem;
  font-weight: 800;
}

.donut-inner-lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.donut-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.bar-chart-container {
  width: 100%;
  height: 80px;
  margin-top: 10px;
}

/* Category breakdown table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.breakdown-row {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.breakdown-row.clickable {
  cursor: pointer;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 8px;
}

.breakdown-row.clickable:hover {
  background-color: var(--bg-main);
}

.breakdown-row.active {
  border-bottom-color: transparent;
}

.breakdown-details {
  background-color: var(--bg-main);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.cost-detail-item:last-child {
  border-bottom: none;
}

.cost-detail-info {
  display: flex;
  flex-direction: column;
}

.cost-detail-desc {
  font-weight: 600;
  color: var(--text-primary);
}

.cost-detail-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.cost-detail-amount-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cost-detail-val {
  font-weight: 700;
  color: var(--text-primary);
}

.cost-detail-delete {
  background: transparent;
  border: none;
  color: #ef4444;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.75rem;
  border-radius: 4px;
  transition: var(--transition);
}

.cost-detail-delete:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.breakdown-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.breakdown-amounts {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.breakdown-ist {
  font-weight: 700;
  font-size: 0.95rem;
}

.breakdown-diff {
  font-size: 0.75rem;
  font-weight: 700;
}

.diff-saving { color: var(--success); }
.diff-over { color: var(--danger); }

/* Quick Add Cost form */
.quick-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .form-row-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Modals (Bottom Sheets)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(28, 45, 58, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background-color: var(--bg-card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background-color: var(--border);
  border-radius: 10px;
  margin: 10px auto;
  cursor: grab;
}

.sheet-header {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.sheet-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 12px;
  background-color: var(--bg-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 138, 0.15);
}

textarea.form-control {
  height: 80px;
  padding: 10px 12px;
  resize: none;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* File Upload Controls */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-input);
  padding: 20px;
  text-align: center;
  background-color: var(--bg-main);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.file-upload-zone:hover {
  border-color: var(--primary);
}

.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background-color: var(--bg-card);
  margin-top: 8px;
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-info img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}

.btn-remove-file {
  color: var(--danger);
  padding: 4px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2000;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.3s;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast-container.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.toast {
  background-color: var(--text-primary);
  color: var(--bg-card);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

.toast-icon {
  font-size: 1.1rem;
}

/* ==========================================================================
   PWA Update Banner
   ========================================================================== */
.update-banner {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  background-color: var(--accent);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1005;
  font-weight: 700;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.btn-update {
  background-color: #ffffff;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
}

.btn-maps {
  margin-top: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 0.85rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-input);
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 700;
}

.btn-maps:hover {
  background-color: var(--border);
  color: var(--primary-dark);
}

.btn-maps svg {
  stroke: currentColor;
}

/* ==========================================================================
   Responsive adjustments for Tablet/Desktop
   ========================================================================== */
@media (min-width: 768px) {
  body {
    padding-bottom: 110px; /* Raum für die schwebende Bottom-Nav */
    align-items: center; /* Horizontale Zentrierung für alle Kinder (Header, Content) */
  }
  .app-header {
    width: 100%;
    max-width: 800px;
    margin: 16px auto 0 auto;
    border-radius: 24px;
  }
  .bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    right: auto; /* Überschreibt das mobile 'right: 0', um echtes Zentrieren zu ermöglichen */
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 800px;
    margin: 0 auto;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    background: var(--bg-card);
    height: 68px;
    padding-bottom: 0;
  }
  .nav-item:hover {
    color: var(--primary);
    transform: translateY(-2px);
  }
  .btn-fab {
    bottom: 110px;
    left: calc(50vw - 380px);
    right: auto;
  }
}

/* ==========================================================================
   Einstellungen & Sync View Styles
   ========================================================================== */
.settings-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 12px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  letter-spacing: -0.01em;
}

.sync-status-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 16px;
}

.sync-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sync-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #94a3b8; /* Default gray */
  display: inline-block;
}

.sync-status-dot.success {
  background-color: #22c55e; /* Green */
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.sync-status-dot.error {
  background-color: #ef4444; /* Red */
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.sync-status-dot.warning {
  background-color: #f5a623; /* Orange/Yellow */
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
}

.sync-status-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.sync-status-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Spinner for Sync Button */
.spinning {
  animation: spin 1.2s linear infinite;
}

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