/* Container */
.ht-timeline {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 20px 0;
}

/* Rows: exakt gleiches Spaltenraster aus dem Wrapper übernehmen */
.ht-row {
  display: grid;
  grid-template-columns: var(--cols); /* <- wichtig */
  column-gap: 10px;
  align-items: stretch;               /* gleiche Höhe */
  margin-bottom: 8px;
}

/* Kopfzeile: mittig ausrichten und gleiche Höhe/Innenabstände */
.ht-row.ht-head .ht-cell {
  display: flex;              /* damit vertikal & horizontal mittig */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #1f2937;
}

/* Task-Header sauber mittig halten, kein Wrap-Zucken */
.ht-taskhead {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;       /* optional: verhindert zweizeiliges Springen */
}

/* Body-Zellen vertikal/horizontal mittig */
.ht-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Datumsspalte links: Breite kommt aus der ersten Spalte von --cols */
.ht-daycol {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
}

/* Wochentag groß, Meta darunter klein (deine Werte bleiben) */
.ht-weekday { font-size: 22px; font-weight: 800; letter-spacing: .2px; color: #f3f4f6; }
.ht-meta    { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #94a3b8; }
.ht-meta .ht-sep { opacity: .6; }

/* Task-Kacheln: gleiche Höhe wie Head, mittig */
.ht-box, .ht-perfect {
  min-width: 110px;
  height: 44px;
  line-height: normal;         /* kein line-height hack, wir zentrieren via flex */
  border-radius: 10px;
  border: 1px solid #243244;
  background: #0f172a;
  color: #e5e7eb;
}

/* Done/Perfect bleiben wie gehabt */
.ht-box.is-done {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  font-weight: 700;
}
.ht-perfect.is-perfect {
  background: #0891b2;
  border-color: #0e7490;
  color: #fff;
  font-weight: 800;
}


/* Wochen-/Monatsabstände (dezente Rhythmuslinien) */
.ht-row.is-week-break { margin-top: 16px; }
.ht-row.is-month-break { margin-top: 28px; }
.ht-row:not(.ht-head) {
  position: relative;
}
.ht-row:not(.ht-head)::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -5px;
  height: 1px;
  background: rgba(148, 163, 184, 0.12);  /* slate-400 @ 12% */
}

/* Responsiv kompakter */
@media (max-width: 900px) {
  .ht-box, .ht-perfect {
    min-width: 96px;
    height: 40px;
    line-height: 40px;
  }
  .ht-weekday { font-size: 20px; }
  .ht-meta { font-size: 12px; gap: 6px; }
  .ht-daycol { padding: 10px 12px; }
}

/* --- Größere, mittig ausgerichtete Header & Zellen --- */
.ht-row {
  display: grid;
  grid-template-columns: var(--cols); /* gleiche Spalten in allen Zeilen */
  column-gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

.ht-row.ht-head .ht-cell,
.ht-taskhead,
.ht-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Linke Datumsspalte (Dark) --- */
.ht-daycol {
  background: #111827;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  flex-direction: column; /* bereits durch .ht-cell gesetzt */
  gap: 6px;
  border: 1px solid #1f2937;
}
.ht-weekday { font-size: 22px; font-weight: 800; letter-spacing: .2px; color: #f3f4f6; }
.ht-meta    { margin-top: 2px; display: flex; gap: 8px; font-size: 13px; color: #94a3b8; }
.ht-meta .ht-sep { opacity: .6; }

/* --- Task-Header (Dark) --- */
.ht-taskhead {
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #1f2937;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap; /* verhindert 2 Zeilen */
}










/* --- Task-Kacheln (Standard = nicht gedrückt) --- */
.ht-box {
  min-width: 130px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid #ef4444;      /* rot-500 */
  background: #0f172a;            /* dunkler Hintergrund */
  color: #e5e7eb;
  text-align: center;
  line-height: 56px;
  cursor: default;
  transition: background .3s ease, border-color .3s ease;
}

/* Erledigt = grüner Verlauf (unten links → unten rechts) */
.ht-box.is-done {
  border: none;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(to bottom right, #16a34a, #22c55e);
}

/* --- Perfect-Spalte --- */
.ht-perfect {
  min-width: 130px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;      /* neutraler Rahmen, grau */
  background: #0f172a;
  color: #e5e7eb;
  text-align: center;
  line-height: 56px;
}

.ht-perfect.is-perfect {
  border: none;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(to bottom right, #0ea5e9, #3b82f6);
}








/* Standard (nicht gedrückt): statisch, roter Rahmen – KEINE Animation */
.ht-timeline .ht-box {
  min-width: 130px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid #ef4444;         /* rot-500 */
  background: #0f172a;               /* dunkel, ohne Verlauf */
  color: #e5e7eb;
  text-align: center;
  line-height: 56px;
  cursor: default;
}

/* ========== Deutlicher Color-Fade mit starken Farben, 2s Dauer ========== */

/* DONE (grün) */
.ht-timeline .ht-box.is-done {
  position: relative;
  border: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #15803d, #22c55e); /* Grundverlauf */
  overflow: hidden;
}
.ht-timeline .ht-box.is-done::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  /* viel helleres Grün, fast neon */
  background: linear-gradient(135deg, #86efac, #16a34a);
  opacity: 0;
  animation: htGreenFade 2.5s ease-in-out infinite;
}

/* PERFECT (blau) */
.ht-timeline .ht-perfect.is-perfect {
  position: relative;
  border: none;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #1e40af, #3b82f6); /* Grundverlauf */
  overflow: hidden;
}
.ht-timeline .ht-perfect.is-perfect::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  /* helles, fast chrom-artiges Blau */
  background: linear-gradient(135deg, #93c5fd, #2563eb);
  opacity: 0;
  animation: htBlueFade 2.5s ease-in-out infinite;
}

/* Keyframes: schnellerer Fade */
@keyframes htGreenFade {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}
@keyframes htBlueFade {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

/* Bewegungs-Reduzierung */
@media (prefers-reduced-motion: reduce) {
  .ht-timeline .ht-box.is-done::after,
  .ht-timeline .ht-perfect.is-perfect::after {
    animation: none;
    opacity: 0;
  }
}










/*zusäzliche Buttons*/

.ht-controls{display:flex;align-items:center;gap:10px;margin:10px 0}
.ht-add{border:1px dashed #94a3b8;border-radius:10px;padding:6px 10px;background:#0f172a;color:#e5e7eb;cursor:pointer}
.ht-buttons{display:flex;gap:8px;flex-wrap:wrap}
.ht-habit{padding:8px 12px;border-radius:10px;border:1px solid #374151;background:#111827;color:#e5e7eb;cursor:pointer}



/* Tooltip unter dem Button, ohne Overlay-Effekt */
.ht-tooltip{
  position:absolute;
  left:0; top:0;
  display:none;
  padding:10px 12px;
  background:#0b1220;
  color:#e6eaf2;
  border:1px solid #22304a;
  border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.3);
  font-size:12px;
  min-width:220px;
  pointer-events:none;  /* blockiert keine Klicks auf den Button */
  z-index:9999;
  opacity:0;
  transform:translateY(-4px);
  transition:opacity .15s ease, transform .15s ease;
}
.ht-tooltip.show{
  opacity:1;
  transform:translateY(0);
}
.ht-hint-row{
  display:flex; align-items:center; gap:10px; padding:3px 0;
}
.ht-kbd{
  display:inline-block;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  border:1px solid #3a4a6a;
  border-bottom-width:2px;
  border-radius:6px;
  padding:2px 6px;
  font-size:11px;
  background:#0e1a2e;
  color:#cfe1ff;
}




/* Scrollbarer Wrapper für die Timeline */
.ht-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  width:100%;
}
.ht-scroll > .ht-timeline{
  width:max-content;
}
/* optionale, dezente Scrollbar */
.ht-scroll::-webkit-scrollbar{ height:8px }
.ht-scroll::-webkit-scrollbar-thumb{ background:#64748b; border-radius:4px }

/* Datumsspalte auf Mobile fixieren (optional) */
@media (max-width:768px){
  .ht-timeline .ht-row .ht-date,
  .ht-timeline .ht-row.ht-head .ht-datehead{
    position:sticky; left:0; z-index:3;
    background:#0b1220;
    box-shadow:8px 0 10px -8px rgba(0,0,0,.35);
  }
}









