/* ==========================================================================
   VIEWS.CSS — Ansichtsspezifische Styles
   Dashboard-Widgets, Task-Grid, Kanban, Notizen, Log, Heute-Ansicht
   ========================================================================== */

/* ==========================================================================
   DASHBOARD — Widget-Grid und Widgets
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

/* --------------------------------------------------------------------------
   Widget-Basis — Gemeinsame Styles fuer alle Widgets
   -------------------------------------------------------------------------- */
.widget {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-base);
}

.widget:hover {
  border-color: var(--border-default);
}

/* Widget ueber volle Breite (2 Spalten) */
.widget-wide {
  grid-column: span 2;
}

/* --------------------------------------------------------------------------
   Widget-Kopfzeile
   -------------------------------------------------------------------------- */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.widget-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent);
}

.widget-icon {
  color: var(--text-tertiary);
  width: 18px;
  height: 18px;
}

.widget-action {
  font-size: var(--text-xs);
  color: var(--accent);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.widget-action:hover {
  color: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   Statistik-Widget — Grosse Zahlen mit Label
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-3);
}

.stat-card {
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-base);
  border-radius: var(--radius-md);
}

.stat-number {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* --------------------------------------------------------------------------
   Streak-Widget — Tages-Serie
   -------------------------------------------------------------------------- */
.streak-display {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.streak-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-success);
}

.streak-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.streak-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

/* --------------------------------------------------------------------------
   Fortschrittsbalken-Widget
   -------------------------------------------------------------------------- */
.progress-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.progress-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-width: 80px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-active);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.progress-fill-accent  { background: var(--accent); }
.progress-fill-success { background: var(--color-success); }
.progress-fill-warning { background: var(--color-warning); }
.progress-fill-danger  { background: var(--color-danger); }

.progress-value {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  min-width: 35px;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Heatmap-Widget — Aktivitaets-Uebersicht (7 Zeilen x 12 Spalten)
   -------------------------------------------------------------------------- */
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  grid-auto-flow: column;
}

.heatmap-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--bg-hover);
  transition: background var(--transition-fast);
}

/* 4 Intensitaets-Stufen (keine Aktivitaet bis hoch) */
.heatmap-cell.level-0 { background: var(--bg-hover); }
.heatmap-cell.level-1 { background: rgba(63, 185, 80, 0.2); }
.heatmap-cell.level-2 { background: rgba(63, 185, 80, 0.4); }
.heatmap-cell.level-3 { background: rgba(63, 185, 80, 0.65); }
.heatmap-cell.level-4 { background: var(--color-success); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  justify-content: flex-end;
}

.heatmap-legend-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.heatmap-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Deadline-Widget — Naechste faellige Tasks
   -------------------------------------------------------------------------- */
.deadline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.deadline-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-base);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.deadline-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  min-width: 60px;
}

.deadline-date.overdue {
  color: var(--color-danger);
  font-weight: 600;
}

.deadline-date.today {
  color: var(--color-warning);
  font-weight: 600;
}

.deadline-title {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-prio {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Projekt-Balken-Widget
   -------------------------------------------------------------------------- */
.project-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.project-bar-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.project-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-active);
  border-radius: 4px;
  overflow: hidden;
}

.project-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-slow);
}

.project-bar-value {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  min-width: 30px;
  text-align: right;
}


/* ==========================================================================
   TASK-GRID — Karten-Raster fuer Task-Ansicht
   ========================================================================== */

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--space-4);
}


/* ==========================================================================
   KANBAN-ANSICHT — 4 Spalten Drag-and-Drop
   ========================================================================== */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  height: 100%;
  align-items: start;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-height: calc(100vh - 160px);
}

/* Spalten-Kopfzeile */
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.kanban-column-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.kanban-column-count {
  font-size: var(--text-xs);
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Wartend-Spalte: orange Akzent */
.kanban-column.col-wartend .kanban-column-title {
  color: var(--color-wartend);
}
.kanban-column.col-wartend .kanban-column-count {
  color: var(--color-wartend);
  background: rgba(245, 158, 11, 0.1);
}

/* Spalten-Inhalt (scrollbar) */
.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Drag-Over-Zustand — Visuelles Feedback beim Ziehen */
.kanban-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.kanban-column.drag-over .kanban-column-body {
  min-height: 80px;
}


/* ==========================================================================
   NOTIZEN-GRID
   ========================================================================== */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}


/* ==========================================================================
   LOG-ANSICHT — Monospace-Darstellung
   ========================================================================== */

.log-view {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  line-height: 1.7;
  overflow-x: auto;
}

.log-entry {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.log-entry:hover {
  background: var(--bg-hover);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-timestamp {
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Farbige Zeitstempel je nach Aktion */
.log-timestamp.created { color: var(--color-success); }
.log-timestamp.updated { color: var(--color-info); }
.log-timestamp.deleted { color: var(--color-danger); }
.log-timestamp.moved   { color: var(--color-warning); }

.log-action {
  color: var(--text-tertiary);
  min-width: 70px;
}

.log-message {
  color: var(--text-secondary);
  flex: 1;
}


/* ==========================================================================
   HEUTE / MEIN TAG — Tages-Uebersicht
   ========================================================================== */

.today-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.today-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.today-date {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.today-greeting {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* Sektionen innerhalb der Heute-Ansicht */
.today-section {
  margin-bottom: var(--space-6);
}

.today-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
