/* ========================================
   AUWeek Planner — Stylesheet
   ======================================== */

/* ----------------------------------------
   1. Reset & Base
   ---------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 960px;
  margin: 0 auto;
}

:root {
  --c-text: #1A1A1A;
  --c-text-secondary: #8B8680;
  --c-text-tertiary: #C4C0BB;
  --c-bg: #F7F5F2;
  --c-card: #FFFFFF;
  --c-border: #EDEBE8;
  --c-accent: #C4581A;
  --c-accent-warm: #D4A574;
  --c-accent-bg: #FFF8F3;
  --c-accent-border: #F0DDD0;
  --c-success: #3D7A3D;
  --c-success-bg: #E8F5E8;
  --c-card-muted: #FAFAF8;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-pill: 100px;
  --radius-btn: 12px;
}

/* ----------------------------------------
   2. Header
   ---------------------------------------- */
.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  background: white;
  border-bottom: 1px solid var(--c-border);
}

.header-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--c-text-secondary);
}

.header-nav {
  display: flex;
  gap: 4px;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--c-text-secondary);
}

.header-nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--c-text);
}

.header-nav-dot {
  color: var(--c-border);
}

/* ----------------------------------------
   3. Save Indicator
   ---------------------------------------- */
.save-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-tertiary);
  background: var(--c-card);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 500;
  pointer-events: none;
}

.save-indicator.saving,
.save-indicator.saved,
.save-indicator.error {
  opacity: 1;
}

.save-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.save-indicator-text {
  transition: color 0.3s;
}

.save-indicator.saving .save-indicator-dot {
  background-color: #D4A050;
  animation: pulse 1s ease-in-out infinite;
}
.save-indicator.saving .save-indicator-text {
  color: #D4A050;
}

.save-indicator.saved {
  animation: fadeOut 2s ease forwards;
}
.save-indicator.saved .save-indicator-dot {
  background-color: var(--c-success);
}
.save-indicator.saved .save-indicator-text {
  color: var(--c-success);
}

.save-indicator.error .save-indicator-dot {
  background-color: #C0392B;
}
.save-indicator.error .save-indicator-text {
  color: #C0392B;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; }
}

/* ----------------------------------------
   4. Week Navigation
   ---------------------------------------- */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 48px 24px;
  gap: 24px;
}

.week-nav-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: opacity 0.2s;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
}

.week-nav-arrow:hover {
  opacity: 0.6;
}

.week-nav-current {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.week-kw {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.week-range {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  color: var(--c-text-secondary);
}

.streak-badge {
  padding: 4px 12px;
  background: var(--c-accent-bg);
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 13px;
  color: var(--c-accent);
}

.task-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-secondary);
  padding: 0 48px 8px;
}

/* ----------------------------------------
   5. Import Button
   ---------------------------------------- */
.import-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border: 1px dashed var(--c-accent);
  border-radius: 8px;
  color: var(--c-accent);
  font-weight: 500;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}

.import-btn:hover {
  background: var(--c-accent-bg);
}

/* ----------------------------------------
   6. Section Headers
   ---------------------------------------- */
.section {
  padding: 0 48px;
  margin-top: 40px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--c-text-secondary);
}

/* ----------------------------------------
   7. Task Lists
   ---------------------------------------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--c-bg);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.task-item.removing {
  opacity: 0;
  transform: translateX(-10px);
}

.task-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid var(--c-border);
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.task-checkbox:checked {
  background: var(--c-success);
  border-color: var(--c-success);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6.5L5 9L9.5 3.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.task-text {
  font-weight: 400;
  font-size: 14px;
  color: var(--c-text);
  border: none;
  background: transparent;
  font-family: var(--font-body);
  outline: none;
}

.task-delete {
  opacity: 0;
  color: var(--c-text-tertiary);
  cursor: pointer;
  font-size: 18px;
  transition: opacity 0.15s, color 0.15s;
  background: none;
  border: none;
  line-height: 1;
}

.task-delete:hover {
  color: var(--c-accent);
}

.task-delete.confirm {
  opacity: 1;
  color: #C0392B;
  font-weight: 700;
}

.task-add-input,
.task-edit-input {
  width: 100%;
  padding: 6px 0;
  border: none;
  border-bottom: 1.5px solid var(--c-accent);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--c-text);
  outline: none;
}

.task-add-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--c-text-tertiary);
  font-weight: 400;
  font-size: 13px;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-input);
  background: none;
  font-family: var(--font-body);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.task-add-placeholder:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background-color: var(--c-accent-bg);
}

/* ----------------------------------------
   8. Task States
   ---------------------------------------- */
.task-item.done .task-text {
  text-decoration: line-through;
  color: var(--c-text-tertiary);
  opacity: 0.6;
}

.task-item.focused {
  border-radius: 6px;
  padding-left: 10px;
  padding-right: 10px;
  background-color: #F0F8F0;
  background-image: linear-gradient(
    45deg,
    rgba(61, 122, 61, 0.05) 25%, transparent 25%,
    transparent 50%, rgba(61, 122, 61, 0.05) 50%,
    rgba(61, 122, 61, 0.05) 75%, transparent 75%, transparent
  );
  background-size: 20px 20px;
  animation: focusStripe 16s linear infinite;
}

@keyframes focusStripe {
  0% { background-position: 0 0; }
  100% { background-position: 200px 0; }
}

.task-item.focused .task-text {
  font-weight: 600;
  color: var(--c-success);
}

.task-item:hover .task-delete {
  opacity: 1;
}

/* Quick-assign day pills for imported tasks */
.quick-assign {
  display: none;
  gap: 3px;
  flex-shrink: 0;
}

.task-item:hover .quick-assign {
  display: flex;
}

.quick-assign-pill {
  padding: 2px 6px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-card);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.quick-assign-pill:hover {
  background: var(--c-accent);
  color: white;
  border-color: var(--c-accent);
}

.quick-assign-next-week {
  margin-left: 2px;
  border-style: dashed;
}

.quick-assign-next-week:hover {
  background: var(--c-accent-warm);
  border-color: var(--c-accent-warm);
}

.grip-handle {
  width: 16px;
  color: var(--c-text-tertiary);
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.grip-handle:hover {
  opacity: 1;
}

.grip-handle svg {
  display: block;
}

/* ----------------------------------------
   9. Rocks Grid
   ---------------------------------------- */
.rocks-grid {
  display: flex;
  gap: 20px;
  padding: 32px 48px 0;
}

.rock-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--c-border);
}

.rock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.rock-dot.accent {
  background: var(--c-accent);
}

.rock-dot.secondary {
  background: var(--c-text-secondary);
}

.rock-dot.warm {
  background: var(--c-accent-warm);
}

.rock-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}

.rock-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--c-text-secondary);
}

.rock-card.big-rocks .task-checkbox {
  border-color: var(--c-accent);
}

/* ----------------------------------------
   10. Day Blocks
   ---------------------------------------- */
.day-block {
  margin-bottom: 4px;
}

.day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: border-radius 0.15s;
}

.day-header.open {
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}

.day-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.day-date {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--c-text-secondary);
}

.day-badge-today {
  padding: 3px 10px;
  background: var(--c-success-bg);
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 12px;
  color: var(--c-success);
}

.day-task-count {
  font-weight: 400;
  font-size: 13px;
  color: var(--c-text-tertiary);
  margin-left: auto;
}

.day-progress {
  margin-left: 8px;
}

.day-columns {
  display: flex;
  border: 1px solid var(--c-border);
  border-top: none;
}

.day-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  background: white;
}

.day-column + .day-column {
  border-left: 1px solid var(--c-border);
}

.day-column-title {
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-column-title.deepwork {
  color: var(--c-accent);
}

.day-column-title.nachmittag {
  color: var(--c-text-secondary);
}

/* ----------------------------------------
   11. Feierabend
   ---------------------------------------- */
.feierabend {
  background: var(--c-card-muted);
  border: 1px solid var(--c-border);
  border-top: none;
  padding: 16px 20px;
  border-radius: 0 0 12px 12px;
}

.feierabend-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--c-text-secondary);
  background: none;
  border: none;
  font-family: var(--font-body);
}

.feierabend-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease;
  margin-top: 0;
}

.feierabend.open .feierabend-content {
  max-height: 800px;
  opacity: 1;
  margin-top: 14px;
}

.feierabend-done-badge {
  padding: 3px 10px;
  background-color: var(--c-success-bg);
  color: var(--c-success);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: auto;
}

.feierabend.answered .feierabend-header {
  color: var(--c-success);
}

.feierabend.answered {
  border-color: var(--c-success-bg);
  background-color: #FAFFF7;
}

.feierabend-question {
  font-weight: 500;
  font-size: 13px;
  color: var(--c-text);
}

.feierabend-answer {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  font-weight: 400;
  font-size: 14px;
  resize: vertical;
  font-family: var(--font-body);
  color: var(--c-text);
  outline: none;
}

.feierabend-answer:focus {
  border-color: var(--c-accent-warm);
}

/* ----------------------------------------
   11b. Next Week Block
   ---------------------------------------- */
.next-week-block {
  margin-top: 16px;
  padding: 20px;
  background-color: var(--c-accent-bg);
  border: 1px dashed var(--c-accent-border);
  border-radius: var(--radius-card);
}

.next-week-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.next-week-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--c-text);
}

.next-week-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--c-accent);
  padding: 2px 10px;
  background-color: var(--c-card);
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-accent-border);
}

/* ----------------------------------------
   12. Guideline Box
   ---------------------------------------- */
.guideline {
  padding: 16px;
  background: var(--c-accent-bg);
  border-radius: 10px;
  border: 1px solid var(--c-accent-border);
  margin-bottom: 12px;
}

.guideline-label {
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--c-accent);
}

.guideline-text {
  font-weight: 400;
  font-size: 14px;
  color: #6B5D52;
}

/* ----------------------------------------
   13. Brain Dump
   ---------------------------------------- */
.braindump-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--c-bg);
}

.braindump-item:hover .task-delete {
  opacity: 1;
}

.braindump-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent-warm);
  flex-shrink: 0;
}

.braindump-archive-btn,
.braindump-restore-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0 2px;
  color: var(--c-text-muted, #999);
  margin-left: auto;
}

.braindump-item:hover .braindump-archive-btn,
.braindump-item:hover .braindump-restore-btn {
  opacity: 1;
}

.braindump-archive {
  margin-top: 12px;
}

.braindump-archive.collapsed .braindump-archive-list {
  display: none;
}

.braindump-archive-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--c-text-muted, #999);
  padding: 4px 0;
  user-select: none;
}

.braindump-archive-header:hover {
  color: var(--c-text, #333);
}

.braindump-archive-toggle {
  font-size: 10px;
}

.braindump-item.archived {
  opacity: 0.5;
}

.braindump-item.archived .braindump-dot {
  background: var(--c-text-muted, #999);
}

/* ----------------------------------------
   14. Wochenabschluss
   ---------------------------------------- */
.abschluss-grid {
  display: flex;
  gap: 20px;
}

.abschluss-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--c-border);
}

.abschluss-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ----------------------------------------
   15. Weekly Recap
   ---------------------------------------- */
.recap-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--c-border);
}

.recap-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.recap-question {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.recap-input {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  font-weight: 400;
  font-size: 14px;
  resize: vertical;
  font-family: var(--font-body);
  color: var(--c-text);
  outline: none;
}

.recap-input:focus {
  border-color: var(--c-accent-warm);
}

/* ----------------------------------------
   16. Close Week Button
   ---------------------------------------- */
.close-week-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 48px 60px;
  gap: 12px;
}

.close-week-divider {
  width: 200px;
  height: 1px;
  background: var(--c-border);
}

.close-week-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--c-accent);
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: opacity 0.2s;
}

.close-week-btn:hover {
  opacity: 0.9;
}

.close-week-btn:disabled {
  background: var(--c-text-tertiary);
  cursor: default;
}

.close-week-hint {
  font-weight: 400;
  font-size: 13px;
  color: var(--c-text-secondary);
}

/* Close week confirmation dialog */
.close-week-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.close-week-dialog {
  background: var(--c-card);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.close-week-dialog-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 16px;
}

.close-week-dialog-warning {
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  border-radius: var(--radius-input);
  padding: 12px 14px;
  font-size: 13px;
  color: #E65100;
  margin-bottom: 12px;
  line-height: 1.5;
}

.close-week-dialog-info {
  font-size: 14px;
  color: var(--c-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.close-week-dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.close-week-dialog-btn {
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.close-week-dialog-btn:hover {
  opacity: 0.85;
}

.close-week-dialog-btn.cancel {
  background: var(--c-bg);
  color: var(--c-text);
}

.close-week-dialog-btn.confirm {
  background: var(--c-accent);
  color: white;
}

/* ----------------------------------------
   17. Gamification
   ---------------------------------------- */
.progress-bar {
  height: 4px;
  background: var(--c-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: var(--radius-pill);
  transition: width 0.3s;
}

/* ----------------------------------------
   18. Summary Overlay
   ---------------------------------------- */
.summary-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.summary-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  max-width: 400px;
}

.summary-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
}

.summary-stat {
  font-weight: 400;
  font-size: 18px;
  color: var(--c-text-secondary);
  margin: 8px 0;
}

.summary-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--c-accent);
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  margin-top: 24px;
  margin-left: auto;
  margin-right: auto;
  transition: opacity 0.2s;
}

.summary-btn:hover {
  opacity: 0.9;
}

/* ----------------------------------------
   19. Confetti Canvas
   ---------------------------------------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ----------------------------------------
   20. Drag & Drop
   ---------------------------------------- */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sortable-drag {
  opacity: 0.9;
}

/* ----------------------------------------
   22. Timer Widget
   ---------------------------------------- */

/* Container */
.timer-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 500;
  font-family: var(--font-body);
}

@media (max-width: 768px) {
  .timer-widget {
    display: none;
  }
}

/* ── Mini timer ── */
.timer-mini {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-card);
  border-radius: 14px;
  border: 1px solid var(--c-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.timer-mini.hidden {
  display: none;
}

.timer-mini-ring {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}

.timer-mini-ring svg {
  width: 100%;
  height: 100%;
}

.timer-mini-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  color: var(--timer-color, var(--c-accent));
}

.timer-mini-pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.timer-mini-pause-overlay svg {
  width: 50%;
  height: 50%;
}

.timer-mini-ring:hover .timer-mini-pause-overlay {
  opacity: 1;
}

.timer-mini-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.timer-mini-phase {
  font-weight: 600;
  font-size: 13px;
  color: var(--c-text);
}

.timer-mini-count {
  font-size: 11px;
  color: var(--c-text-secondary);
}

.timer-mini-dots {
  display: flex;
  gap: 4px;
  margin-left: 4px;
}

.timer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.timer-dot.filled {
  background: var(--timer-color, var(--c-accent));
}

.timer-dot.empty {
  border: 1.5px solid var(--c-border);
  background: transparent;
}

/* ── Expanded timer ── */
.timer-expanded {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 24px;
  background: var(--c-card);
  border-radius: 20px;
  border: 1px solid var(--c-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  width: 320px;
}

.timer-expanded.visible {
  display: flex;
}

.timer-expanded-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.timer-expanded-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--c-text);
}

.timer-expanded-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-expanded-stats-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--timer-color, var(--c-accent));
}

.timer-expanded-settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--c-text-secondary);
}

.timer-expanded-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--c-text-tertiary);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.timer-expanded-close-btn:hover {
  color: var(--c-text);
  background: var(--c-bg);
}

/* Ring */
.timer-ring-container {
  width: 160px;
  height: 160px;
  position: relative;
}

.timer-ring-container svg {
  width: 100%;
  height: 100%;
}

.timer-ring-bg {
  fill: none;
  stroke: var(--c-border);
  stroke-width: 5;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--timer-color, var(--c-accent));
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 42px;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

.timer-phase-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 20px);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--timer-color, var(--c-accent));
}

.timer-action-text {
  font-weight: 500;
  font-size: 14px;
  color: var(--c-text-secondary);
}

.timer-expanded-dots {
  display: flex;
  gap: 6px;
}

.timer-expanded-dots .timer-dot {
  width: 8px;
  height: 8px;
}

/* Buttons */
.timer-buttons {
  display: flex;
  gap: 12px;
}

.timer-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--c-border);
  background: var(--c-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.timer-btn:hover {
  background: var(--c-bg);
  border-color: var(--c-text-secondary);
}

.timer-btn-secondary {
  opacity: 0;
  transition: opacity 0.2s, background 0.15s, border-color 0.15s;
}

.timer-buttons:hover .timer-btn-secondary {
  opacity: 1;
}

.timer-btn svg {
  color: var(--c-text-secondary);
}

/* ── Pulsing animation ── */
.timer-ring-progress.pulsing {
  animation: timerPulse 1.5s infinite;
}

.timer-mini.pulsing {
  animation: timerPulse 1.5s infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Settings panel ── */
.timer-settings {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.timer-settings.visible {
  display: flex;
}

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

.timer-settings-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--c-text);
}

.timer-settings-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  color: var(--c-text-secondary);
}

.timer-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-bg);
}

.timer-setting-row:last-child {
  border-bottom: none;
}

.timer-setting-label {
  font-weight: 500;
  font-size: 14px;
  color: var(--c-text);
}

.timer-setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-setting-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  background: var(--c-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--c-text-secondary);
}

.timer-setting-btn:hover {
  background: var(--c-bg);
}

.timer-setting-value {
  width: 48px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}

.timer-setting-value.focus {
  color: #C4581A;
}

.timer-setting-value.short-break {
  color: #3D7A3D;
}

.timer-setting-value.long-break {
  color: #5B7BA8;
}

/* ── Reset popover ── */
.timer-reset-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  min-width: 180px;
}

.timer-reset-popover.visible {
  display: flex;
  flex-direction: column;
}

.timer-reset-option {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
}

.timer-reset-option:hover {
  background: var(--c-bg);
}

.timer-reset-option + .timer-reset-option {
  border-top: 1px solid var(--c-border);
}

/* ── Toast notification ── */
.timer-toast {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #1A1A1A;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  animation: toastIn 0.3s ease forwards, toastOut 0.3s ease 2.5s forwards;
  pointer-events: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
}

/* ── Pomodoro recap chart ── */
.pomodoro-recap {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 16px;
  background: var(--c-card);
}

.pomodoro-recap-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-secondary);
  margin-bottom: 4px;
}

.pomodoro-recap-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--c-text);
  margin-bottom: 12px;
}

.pomodoro-recap-chart {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  height: 56px;
  gap: 2px;
}

.pomodoro-recap-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.pomodoro-recap-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--c-accent);
  min-height: 2px;
}

.pomodoro-recap-label {
  font-size: 11px;
  color: var(--c-text-secondary);
  margin-top: 4px;
}

/* ── Phase color classes ── */
.timer-phase-focus {
  --timer-color: #C4581A;
}

.timer-phase-short-break {
  --timer-color: #3D7A3D;
}

.timer-phase-long-break {
  --timer-color: #5B7BA8;
}

/* Expanded background tint per phase */
.timer-expanded.timer-phase-short-break {
  background: #83ac83;
  border-color: #6B946B;
}

.timer-expanded.timer-phase-long-break {
  background: #D0DCF0;
  border-color: #8BA8D4;
}

/* Mini background tint per phase */
.timer-mini.timer-phase-short-break {
  background: #83ac83;
  border-color: #6B946B;
}

.timer-mini.timer-phase-long-break {
  background: #D0DCF0;
  border-color: #8BA8D4;
}

/* Paused state — dimmed to show timer is stopped */
.timer-paused .timer-time,
.timer-paused .timer-mini-time {
  opacity: 0.35;
  transition: opacity 0.3s;
}

/* ----------------------------------------
   23. Responsive
   ---------------------------------------- */
@media (max-width: 768px) {
  .rocks-grid,
  .abschluss-grid {
    flex-direction: column;
  }

  .day-columns {
    flex-direction: column;
  }

  .section,
  .rocks-grid,
  .close-week-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header {
    padding: 16px 20px;
  }

  .week-nav {
    padding: 24px 20px 16px;
  }

  .week-kw {
    font-size: 36px;
  }

  .task-counter {
    padding-left: 20px;
    padding-right: 20px;
  }

  .day-column + .day-column {
    border-left: none;
    border-top: 1px solid var(--c-border);
  }

  .header-nav {
    display: none;
  }

  .week-nav {
    gap: 12px;
  }

  .week-range {
    font-size: 14px;
  }
}
