@import url("../../fonts/monoid.css");

.ph-light {
  filter: brightness(1.2);
  font-size: 120%;
}

:root {
  /* Solarized Dark Palette */
  --base03: #001015;
  --base02: #073642;
  --base01: #586e75;
  --base00: #657b83;
  --base0: #839496;
  --base1: #93a1a1;
  --yellow: #b58900;
  --orange: #cb4b16;
  --red: #dc322f;
  --magenta: #d33682;
  --violet: #6c71c4;
  --blue: #268bd2;
  --cyan: #2aa198;
  --green: #859900;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--base03);
  color: var(--base0);
  font-family: "Monoid", "Menlo", "Monaco", "Courier New", monospace;
  font-size: 14px;
  margin: 0;
  padding: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.input-line {
  /* position: fixed; removed to fix spacing issue */
  /* top: 0; left: 0; right: 0; */
  min-height: 50px;
  display: flex;
  align-items: flex-start;
  background-color: var(--base03);
  border-bottom: 1px solid var(--base02);
  padding: 12px 10px;
  z-index: 1000;
}

.prompt {
  color: var(--base01);
  margin-right: 12px;
  font-weight: bold;
  font-size: 16px;
  user-select: none;
  flex-shrink: 0;
  line-height: 24px;
}

#unsaved-dot {
  color: #8b2020;
  font-size: 10px;
  margin-right: 4px;
  vertical-align: middle;
}

.input-stack {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: flex-start;
  min-height: 24px;
}

textarea#cmd-input,
.ghost {
  font-family: "Monoid", "Menlo", "Monaco", "Courier New", monospace;
  font-size: 16px;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  line-height: 24px;
  letter-spacing: normal;
  white-space: pre-wrap;
  word-wrap: break-word;
  -webkit-text-size-adjust: 100%;
}

textarea#cmd-input {
  color: var(--base1);
  z-index: 2;
  resize: none;
  overflow: hidden;
  min-height: 24px;
  max-height: 200px;
  field-sizing: content;
}

textarea#cmd-input::placeholder {
  color: var(--base01);
  opacity: 0.5;
}

textarea#cmd-input:placeholder-shown {
  height: 24px;
}

.ghost {
  color: var(--base01);
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
}

#terminal-output {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 10px 50px 10px;
  -webkit-overflow-scrolling: touch;
  user-select: text;
  -webkit-user-select: text;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--base02);
}
::-webkit-scrollbar-thumb {
  background: var(--base01);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--base00);
}
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--base01) var(--base02);
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 15px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  min-width: 320px;
}
th {
  border-bottom: 1px solid var(--base01);
  color: var(--base1);
  padding: 8px 4px;
  font-size: 12px;
}
td {
  padding: 4px 2px;
  vertical-align: top;
  border-bottom: 1px solid #07364240;
}
td:first-child {
  border-left: 2px solid transparent;
}
tr.row-active td:first-child {
  border-left-color: var(--base1);
}
tr.row-active .row-desc {
  font-style: italic;
}

.row-id {
  color: var(--base01);
  font-weight: bold;
  width: 25px;
  text-align: right;
  padding-left: 0.3rem;
}
/* Project depth colors - cycle through solarized palette */
.row-proj-d0 {
  color: var(--yellow);
}
.row-proj-d1 {
  color: var(--orange);
}
.row-proj-d2 {
  color: var(--red);
}
.row-proj-d3 {
  color: var(--magenta);
}
.row-proj-d4 {
  color: var(--violet);
}
.row-proj-d5 {
  color: var(--blue);
}
.row-desc {
  padding-left: 0.3em;
  word-break: break-word;
}
.row-urgency {
  color: var(--base01);
  text-align: right;
  font-size: 0.9rem;
  width: 40px;
}

.msg-success {
  color: var(--base1);
}
.msg-error {
  color: var(--red);
}
.msg-info {
  color: var(--base01);
  font-style: italic;
}
.msg-help {
  color: var(--base01);
  font-size: 0.9em;
  margin-bottom: 15px;
  border-bottom: 1px dashed var(--base02);
  padding-bottom: 10px;
}
.msg-standalone {
  margin-top: 8px;
}
.msg-hl {
  color: var(--base1);
  font-weight: bold;
}
.msg-arg {
  color: var(--blue);
}

.tag-pill {
  background: var(--base02);
  color: var(--blue);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.85em;
  display: inline-block;
  margin-top: 2px;
}
.dep-pill {
  color: var(--orange);
  font-weight: bold;
  margin-right: 4px;
  font-size: 0.9em;
}
.blocked-pill {
  color: var(--base01);
  font-weight: bold;
  margin-right: 4px;
  font-size: 0.9em;
}
.blocker-pill {
  color: #8b2020;
  font-weight: bold;
  margin-right: 4px;
  font-size: 0.9em;
}
.blocker-icon {
  font-size: 110%;
  font-weight: bold !important;
}
.date-pill {
  font-size: 0.85em;
  margin-right: 6px;
}
.date-far {
  color: var(--base01);
}
.date-soon {
  color: var(--yellow);
  font-weight: bold;
}
.date-urgent {
  color: var(--red);
  font-weight: bold;
}
.date-wait {
  color: var(--base01);
  opacity: 0.7;
}
.recur-icon {
  color: var(--violet);
  font-size: 0.9em;
  margin-right: 4px;
}
.anno-count {
  color: var(--green);
  font-size: 0.9em;
  margin-left: 4px;
}
.task-link {
  color: var(--cyan);
  text-decoration: none;
  margin-right: 4px;
}
.task-link:hover {
  color: var(--blue);
}
.task-info {
  padding: 10px 0;
  margin-bottom: 10px;
  user-select: text;
  -webkit-user-select: text;
}
.inline-code {
  font-size: 95%;
  color: var(--cyan);
}
.active-icon {
  color: var(--green);
  font-size: 0.8em;
}
.order-badge {
  color: var(--base01);
  font-size: 0.7em;
  margin-right: 6px;
  opacity: 0.8;
}
.context-banner {
  background-color: var(--base02);
  color: var(--cyan);
  padding: 4px 8px;
  margin-bottom: 8px;
  border-left: 3px solid var(--cyan);
  font-size: 0.9em;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Project banners */
.project-banner {
  background-color: var(--base03);
  color: var(--base01);
  padding: 4px 0;
  margin-bottom: 8px;
  font-size: 0.85em;
  overflow: hidden;
  white-space: nowrap;
  width: min(50em, 100%);
}

/* Ticker animation (JS-based) */
.project-banner-ticker {
  position: relative;
}

.project-banner-ticker .project-banner-text {
  display: inline-block;
  white-space: nowrap;
}

/* Typewriter animation */
.project-banner-typewriter .project-banner-text::after {
  content: "▌";
  animation: blink 0.7s infinite;
}

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

/* Today view section separators */
.overdue-separator,
.started-separator,
.ready-separator {
  border-top: 1px solid var(--red);
  margin: 12px 0 8px 0;
  position: relative;
}

.overdue-label,
.started-label,
.ready-label {
  position: absolute;
  top: -0.6em;
  left: 0;
  background: var(--base03);
  font-size: 0.75em;
  padding: 0 6px;
  text-transform: lowercase;
}

.overdue-separator {
  border-color: var(--red);
}
.overdue-label {
  color: var(--red);
}

.started-separator {
  border-color: var(--cyan);
}
.started-label {
  color: var(--cyan);
}

.ready-separator {
  border-color: var(--blue);
}
.ready-label {
  color: var(--blue);
}

#update-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--base02);
  color: var(--green);
  padding: 8px 12px;
  text-align: center;
  font-size: 0.9em;
  z-index: 1000;
}
#update-banner a {
  color: var(--cyan);
  text-decoration: underline;
}
#update-banner a:hover {
  color: var(--blue);
}

/* Checklist styles */
.checklist-parent-row {
  /* Parent row styling if needed */
}

.checklist-member-row td {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.checklist-member-desc {
  padding-left: 24px !important;
}

.checklist-dimmed {
  opacity: 0.5;
}

.checklist-summary {
  font-weight: normal;
}

/* Priority-based text animations */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* Priority 100: Clauer rainbow gradient */
.priority-100-text {
  background-image: linear-gradient(
    32deg,
    #c60,
    #cc0,
    #0cc,
    #06c,
    #0cc,
    #cc0,
    #c60
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 10s linear infinite alternate;
}

/* Priority 500: KITT scanner in yellow */
.priority-500-text {
  background-image: linear-gradient(
    90deg,
    #330,
    #660,
    #990,
    #cc0,
    #ff0,
    #cc0,
    #990,
    #660,
    #330
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 2s linear infinite alternate;
}

/* Priority 1000: KITT scanner in red */
.priority-1000-text {
  background-image: linear-gradient(
    90deg,
    #300,
    #600,
    #900,
    #c00,
    #f00,
    #c00,
    #900,
    #600,
    #300
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 2s linear infinite alternate;
}
