/* Basisstile (Root-Variablen für Farbschemata) */
:root {
  --primary: #ff6600;
  --primary-rgb: 255, 102, 0; /* RGB-Werte für Transparenz */
  --bg: #f9f9f9;
  --card-bg: #ffffff;
  --text: #333;
  --text-secondary: #666;
  --border-color: #e0e0e0;
  --success: #4caf50;
  --info: #2196f3;
  --footer-height: 60px;
}

[data-theme="dark"] {
  --bg: #121212;
  --card-bg: #1e1e1e;
  --text: #f0f0f0;
  --text-secondary: #aaaaaa;
  --border-color: #333333;
  --primary: #ff9800;
}

/* EINFACHES, ROBUSTES LAYOUT - ZURÜCK ZU GRUNDLEGENDEN PRINZIPIEN */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
  /* Keine komplexen Layout-Eigenschaften */
}

/* Optimierte Styles für headerlose Ansicht */
.user-menu, 
.dropdown, 
.dropdown-hidden,
.user-menu button {
  display: none;
}

/* Container mit Mindesthöhe für Vollbild-Effekt */
main.container {
  min-height: calc(100vh - var(--footer-height));
  padding: 1rem;
  padding-bottom: calc(var(--footer-height) + 1rem); /* Wichtig: Platz für Footer */
  display: grid;
  gap: 1rem;
  box-sizing: border-box;
}

/* Standardkartendesign */
.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s;
}

/* Begrüßungskarte */
.card.user-greeting {
  position: relative;
  padding-top: 1.25rem;
}

/* Begrüßungszeile mit Namen */
.greeting-line {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1.3;
}

.greeting-line span {
  white-space: nowrap;
}

/* Hervorgehobener Benutzername */
.greeting-line .username {
  font-weight: 700;
  color: var(--primary);
}

/* Konsistenz bei Greeting-ID */
#greeting {
  font-size: inherit;
  font-weight: inherit;
}

/* Mood-Options-Bereich */
.mood-options {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
  gap: 0.25rem;
}

.mood-options span {
  text-align: center;
  cursor: pointer;
  padding: 0.7rem 0.3rem;
  border-radius: 10px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  flex: 1;
}

.mood-options span:hover {
  background-color: rgba(var(--primary-rgb), 0.05);
  transform: translateY(-2px);
}

/* Aktiver Zustand */
.mood-options span.active {
  background-color: rgba(var(--primary-rgb), 0.1);
  border: 1px solid var(--primary);
}

/* Emoji-Größe in den Mood-Optionen */
.mood-options span br {
  margin-bottom: 0.2rem;
}

.mood-options span::first-line {
  font-size: 1.5rem;
  line-height: 1.7;
}

/* Notizfeld */
#moodNote {
  width: 100%;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  resize: none;
  transition: all 0.2s ease;
  background-color: rgba(255,255,255,0.5);
  margin-top: 0;
  font-family: inherit;
  color: var(--text);
}

#moodNote:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

/* Dark Mode Anpassung für Textarea */
[data-theme="dark"] #moodNote {
  background-color: rgba(0,0,0,0.2);
}

/* Überschriften in den Karten */
.weekly-overview strong,
.tips strong {
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  color: var(--text);
}

/* Listen-Stile für Tipps */
.tips ul {
  list-style-type: none;
  padding-left: 0.5rem;
  margin: 0;
}

.tips li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.tips li::before {
  content: "•";
  color: var(--primary);
  font-size: 1.2rem;
  position: absolute;
  left: 0;
  top: -0.1rem;
}

/* Refresh-Button für Tipps */
.tips-refresh {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  background-color: rgba(var(--primary-rgb), 0.1);
}

.tips-refresh:hover {
  background-color: rgba(var(--primary-rgb), 0.2);
}

.tips-refresh svg {
  width: 14px;
  height: 14px;
}

/* Snackbar */
#snackbar {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  font-size: 0.95rem;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s, bottom 0.3s;
  z-index: 1001;
  bottom: calc(var(--footer-height) + 10px);
}

#snackbar.show {
  visibility: visible;
  opacity: 1;
  bottom: calc(var(--footer-height) + 10px);
}

/* Loading-Animation für dynamische Tipps */
.tips.loading li {
  position: relative;
  background: linear-gradient(90deg, var(--card-bg), rgba(var(--primary-rgb), 0.1), var(--card-bg));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  height: 1.4rem;
  margin-bottom: 0.7rem;
  opacity: 0.7;
}

.tips.loading li::before {
  display: none;
}

@keyframes shimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}

/* HÖHENBEGRENZUNG FÜR STARTSEITEN-KARTEN */
.weekly-overview {
  max-height: 200px; /* FESTE HÖHE FÜR DIESE KARTE */
  overflow-y: auto; /* SCROLLBAR WENN NÖTIG */
}

/* Responsives Design */
@media (max-width: 480px) {
  .greeting-line {
    font-size: 1.15rem;
  }
  
  .mood-options span {
    padding: 0.6rem 0.2rem;
    font-size: 0.8rem;
  }
  
  .mood-options span::first-line {
    font-size: 1.4rem;
  }
  
  .tips li {
    font-size: 0.9rem;
  }
  
  .tips-refresh {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .greeting-line {
    font-size: 1.05rem;
  }
  
  .mood-options {
    flex-wrap: wrap;
  }
  
  .mood-options span {
    flex-basis: 30%;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.2rem;
  }
  
  .mood-options span::first-line {
    font-size: 1.3rem;
  }
  
  .card {
    padding: 0.8rem;
  }
  
  .weekly-overview {
    max-height: 180px; /* NOCH KLEINERE HÖHE FÜR SEHR KLEINE BILDSCHIRME */
  }
}