/* Grundlayout und dunkle Farbgebung */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.4;
  padding: 16px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 4px;
}

header p {
  font-size: 0.9rem;
  color: #a0a0a0;
}

section {
  margin-bottom: 32px;
}

section h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: #ffffff;
}

/* Aufgabenbereich heute */
#tasks-today {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.task-card {
  background-color: #1e1e1e;
  padding: 12px 16px;
  border-radius: 8px;
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.task-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: #ffffff;
}

.task-card p {
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #bdbdbd;
}

.task-card button {
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #3a3a3a;
  color: #ffffff;
  transition: background-color 0.2s;
}

.task-card button:hover {
  background-color: #575757;
}

/* Eingabefeld für Tagesziel */
.task-card input[type="text"],
.task-card input[type="number"] {
  margin-bottom: 8px;
  padding: 6px;
  font-size: 0.9rem;
  border: 1px solid #555555;
  border-radius: 4px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  width: 100%;
  box-sizing: border-box;
}

/* Fortschrittsbalken */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-label {
  width: 120px;
  font-size: 0.9rem;
  color: #cfcfcf;
}

.progress-bar {
  flex: 1;
  height: 16px;
  background-color: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* Die innere Füllung besteht nun aus zwei Ebenen: gelb für geplante Einheiten
   und grün für erledigte Einheiten. Sie werden absolut positioniert, damit
   sie sich überlagern können. */
.progress-bar-fill {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: width 0.3s;
}

/* Gelbe Füllung für geplante (state=1) und erledigte Einheiten */
.progress-yellow-fill {
  background-color: #ffc107;
  z-index: 1;
}

/* Grüne Füllung für erledigte Einheiten */
.progress-green-fill {
  background-color: #4caf50;
  z-index: 2;
}

/* Kleine Buttons zur Anpassung des Wochenziels */
.goal-btn {
  padding: 2px 6px;
  margin: 0 4px;
  font-size: 0.8rem;
  background-color: #3a3a3a;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.goal-btn:hover {
  background-color: #575757;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  transition: width 0.3s;
}

.progress-bar-count {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: #ffffff;
  z-index: 3;
}

/* Farben für die Fortschrittsbalken je nach Status */
.progress-grey   { background-color: #4a4a4a; }
.progress-yellow { background-color: #ffc107; }
.progress-green  { background-color: #4caf50; }
.progress-blue   { background-color: #2196f3; }

/* Hinweise zu fehlenden Säulen */
.missing {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #ffa726;
}

/* Tabellenplaner */
.schedule-wrapper {
  overflow-x: auto;
  border: 1px solid #303030;
  border-radius: 8px;
}

#schedule {
  width: 100%;
  border-collapse: collapse;
}

#schedule th,
#schedule td {
  border: 1px solid #303030;
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
}

#schedule th {
  background-color: #1e1e1e;
  color: #cfcfcf;
  position: sticky;
  top: 0;
  z-index: 1;
}

#schedule td.pillar-name {
  background-color: #1e1e1e;
  color: #cfcfcf;
  font-weight: bold;
  position: sticky;
  left: 0;
  z-index: 1;
}

.cell {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

/* Reduzierter horizontaler Abstand für Zellen mit Text */
.cell.has-text {
  padding-left: 2px;
  padding-right: 2px;
  font-size: 0.75rem;
  /* Text umbrechen, falls er länger ist */
  white-space: normal;
  word-break: break-word;
}

.cell.state-0 {
  background-color: #2a2a2a;
}

.cell.state-1 {
  background-color: #ffc107;
  color: #000000;
}

.cell.state-2 {
  background-color: #4caf50;
  color: #ffffff;
}

.cell:hover {
  filter: brightness(1.1);
}

/* Navigationsleiste für Wochenwechsel */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.week-nav button {
  padding: 6px 12px;
  background-color: #3a3a3a;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.week-nav button:hover {
  background-color: #575757;
}

.week-nav #week-label {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  color: #cfcfcf;
}

footer {
  margin-top: 32px;
  font-size: 0.75rem;
  text-align: center;
  color: #888888;
}