@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  width: 100%;
  background: #0d0d0d;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  padding: 24px;
}

/* ─── Terminal Window ─── */
.terminal-window {
  width: 100%;
  max-width: 960px;
  background: #111111;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px #2a2a2a,
    0 0 40px rgba(0, 255, 100, 0.06),
    0 32px 80px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: fadeSlideIn 0.6s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Title Bar ─── */
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: #1a1a1a;
  border-bottom: 1px solid #222;
  user-select: none;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: #555;
  letter-spacing: 0.04em;
}

/* ─── Terminal Body ─── */
.terminal-body {
  padding: 32px 36px 40px;
  color: #c8ffc8;
  line-height: 1.7;
}

/* ─── ASCII Art ─── */
.ascii-art {
  font-size: clamp(0.38rem, 2.5vw, 1.05rem);
  line-height: 1.25;
  color: #00ff66;
  text-shadow:
    0 0 8px rgba(0, 255, 100, 0.7),
    0 0 20px rgba(0, 255, 100, 0.3);
  white-space: pre;
  overflow-x: auto;
  margin-bottom: 36px;
  letter-spacing: 0;
  animation: glowPulse 4s ease-in-out infinite;
  /* prevent horizontal blowout on narrow screens */
  max-width: 100%;
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(0,255,100,0.7), 0 0 20px rgba(0,255,100,0.3); }
  50%       { text-shadow: 0 0 14px rgba(0,255,100,0.9), 0 0 36px rgba(0,255,100,0.5); }
}

/* ─── Prompt Lines ─── */
.terminal-prompt {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.prompt-user {
  color: #00ff66;
  font-weight: 700;
}
.at               { color: #888; font-weight: 400; }
.prompt-sep       { color: #888; margin: 0 1px; }
.prompt-path      { color: #6699ff; font-weight: 700; }
.prompt-dollar    { color: #fff; margin: 0 10px 0 2px; }
.prompt-command   { color: #fff; opacity: 0.9; }

/* ─── Output Text ─── */
.terminal-output {
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  color: #a8d8a8;
  margin: 0 0 28px 0;
  max-width: 100%;
  word-break: break-word;
}

.terminal-output p {
  margin-bottom: 14px;
}

/* ─── Blinking Cursor ─── */
.cursor {
  color: #00ff66;
  animation: blink 1.1s step-start infinite;
  font-size: 1.1em;
  line-height: 1;
  margin-left: 2px;
}

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

/* ─── CRT scanline overlay ─── */
.terminal-body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.07) 3px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 999;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* ─── Mobile Breakpoints ─── */
@media (max-width: 600px) {
  body {
    padding: 12px;
    align-items: flex-start;
  }

  .terminal-window {
    border-radius: 8px;
  }

  .terminal-titlebar {
    padding: 11px 14px;
  }

  .terminal-title {
    font-size: 0.68rem;
  }

  .terminal-body {
    padding: 20px 18px 28px;
  }

  .ascii-art {
    font-size: clamp(0.32rem, 3.8vw, 0.6rem);
    margin-bottom: 24px;
  }

  .terminal-prompt {
    font-size: clamp(0.78rem, 3.6vw, 0.95rem);
    margin-bottom: 10px;
  }

  .terminal-output {
    font-size: clamp(0.78rem, 3.4vw, 0.92rem);
    margin-bottom: 20px;
  }
}

/* ─── Todo Section ─── */
.todo-section {
  margin-bottom: 4px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
  animation: fadeInItem 0.2s ease both;
}

.todo-item:hover {
  background: rgba(0, 255, 100, 0.04);
}

@keyframes fadeInItem {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Checkbox Button ─── */
.todo-checkbox {
  background: none;
  border: none;
  color: #00ff66;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  letter-spacing: 0;
  transition: color 0.15s, text-shadow 0.15s;
  text-shadow: 0 0 6px rgba(0, 255, 100, 0.5);
}

.todo-checkbox:hover {
  color: #40ffaa;
  text-shadow: 0 0 10px rgba(0, 255, 100, 0.8);
}

/* ─── Todo Text ─── */
.todo-text {
  flex: 1;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  color: #a8d8a8;
  word-break: break-word;
  transition: color 0.2s, opacity 0.2s;
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  color: #4a6a4a;
  opacity: 0.7;
}

.todo-item.done .todo-checkbox {
  color: #4a8a4a;
  text-shadow: none;
}

/* ─── Delete Button ─── */
.todo-delete {
  background: none;
  border: none;
  color: #4a2a2a;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}

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

.todo-delete:hover {
  color: #ff5f57;
  background: rgba(255, 95, 87, 0.1);
}

/* ─── T / Ö Tag Buttons ─── */
.todo-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.todo-item:hover .todo-tags {
  opacity: 1;
}

.todo-tag {
  background: none;
  border: 1px solid #2a3a2a;
  color: #3a5a3a;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s, background 0.15s, text-shadow 0.15s;
  line-height: 1.6;
}

.todo-tag:hover {
  color: #00ff66;
  border-color: #00ff6655;
}

.todo-tag.active {
  color: #00ff66;
  border-color: #00ff6688;
  background: rgba(0, 255, 100, 0.07);
  text-shadow: 0 0 6px rgba(0, 255, 100, 0.5);
}

/* always show tags if one is active */
.todo-item:has(.todo-tag.active) .todo-tags {
  opacity: 1;
}


/* ─── Empty & Loading States ─── */
.todo-empty,
.todo-loading {
  color: #3a5a3a;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  padding: 4px 0;
  font-style: italic;
}

.cursor-sm {
  animation: blink 1.1s step-start infinite;
}

.loading-dots::after {
  content: '...';
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ─── Input Row ─── */
.todo-input-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 4px;
  padding: 6px 0 6px 8px;
  border-radius: 4px;
  border-left: 2px solid #00ff6633;
  transition: border-color 0.2s;
}

.todo-input-row:focus-within {
  border-left-color: #00ff66;
}

.input-arrow {
  color: #00ff66;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  flex-shrink: 0;
  text-shadow: 0 0 6px rgba(0, 255, 100, 0.5);
}

.todo-input {
  background: transparent;
  border: none;
  outline: none;
  color: #c8ffc8;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  width: 100%;
  caret-color: #00ff66;
}

.todo-input::placeholder {
  color: #2a4a2a;
}

.todo-input:disabled {
  opacity: 0.5;
}

@media (max-width: 600px) {
  .todo-input-row {
    padding: 5px 0 5px 6px;
  }

  .todo-checkbox,
  .todo-text,
  .input-arrow,
  .todo-input {
    font-size: clamp(0.75rem, 3.4vw, 0.9rem);
  }
}
