@use "../vendor/progress_pie_scss";

@keyframes pulse {
  from {
    opacity: 0.8;
  }

  to {
    opacity: 0.2;
  }
}

@keyframes shrink {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.planner {
  position: relative;
}

.planner-progress-bar {
  overflow: hidden;
  display: flex;
  align-items: stretch;
  align-self: stretch;

  min-width: 100px;

  background-color: var(--text-faint);
  border-radius: var(--radius-s);
}

.planner-confirmation-modal-buttons {
  display: flex;
  gap: var(--size-4-2);
}

.planner-progress-value {
  background-color: var(--color-accent);
  height: 100%;
}

.planner-progress-value.green,
.planner .progress-pie.green::before {
  background-color: #4caf50;
}

.planner .progress-pie.green {
  background-image: linear-gradient(to right, transparent 50%, #4caf50 0);
}

.planner-status-bar-text {
  float: left;
  margin-right: 10px;
}

.planner-status-card {
  position: absolute;
  top: -140px;

  display: none;

  width: 300px;
  padding: 8px;

  background-color: var(--background-secondary-alt);
  border-radius: 4px;
}

.planner-status-card .arrow-down {
  position: absolute;

  width: 20px;

  border-top: 20px solid var(--background-secondary-alt);
  border-right: 20px solid transparent;
  border-left: 20px solid transparent;
}

.progress-pie.planner {
  width: 20px;
  height: 20px;
}

.progress-pie.planner::after {
  width: 80%;
  height: 80%;
}

.progress-pie.planner::after {
  font-size: 8px;
  font-weight: 900;
  line-height: 13px;
  color: transparent;

  background-color: transparent;
}

[data-type="planner-timeline"] .view-content,
[data-type="planner-time-tracker"] .view-content,
[data-type="planner-weekly"] .view-content {
  --scrollbar-width: 12px;
  --timeline-flex-basis: 180px;

  --border-base: 1px solid var(--background-modifier-border);

  --shadow-color: #00000010;
  --shadow-right: 2px 0px 2px var(--shadow-color);
  --shadow-bottom: 0px 2px 2px var(--shadow-color);

  // Copied from Canvas
  --shadow-stationary: 0px 0.5px 1px 0.5px rgba(0, 0, 0, 0.1);
  --shadow-drag: 0px 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-border-accent: 0 0 0 2px var(--color-accent);

  display: flex;
  flex-direction: column;
  padding: 0;

  .is-mobile & {
    --timeline-flex-basis: 120px;
  }
}

[data-type="planner-timeline"],
[data-type="planner-weekly"] {
  --planner-time-block-font-size: var(--font-ui-small);

  .is-mobile & {
    --planner-time-block-font-size: var(--font-ui-smaller);
  }
}

[data-type="planner-time-tracker"] {
  --time-block-border: 1px solid var(--background-modifier-border);
  --time-block-content-padding: var(--size-4-1);
  --time-block-content-layout-gap: var(--size-2-3);
  --planner-time-block-font-size: var(--font-ui-small);

  .workspace-split.mod-root & {
    --time-block-bg-color: var(--background-primary-alt);
  }
}

:root {
  --planner-time-block-shadow-on-timeline: 1px 1px 2px 0 #0000001f;
}

[data-type="planner-timeline"] {
  .view-content {
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "controls controls"
      "corner all-day"
      "ruler timeline";
  }
}

[data-type="planner-weekly"] {
  .view-header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .view-content {
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "corner dates"
      "corner multiday"
      "ruler timelines";
  }

  .view-actions {
    gap: var(--size-4-2);
    justify-self: end;
  }

  .view-header-title-container {
    grid-column: 2;
  }

  .view-header-title {
    font-size: var(--font-ui-medium);
    color: var(--text-muted);
  }
}

.absolute-stretch-x {
  position: absolute;
  right: 0;
  left: 0;
}

.planner-release-notes-modal {
  .modal-content {
    height: 100%;
    overflow: auto;
  }
}

.planner-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: var(--size-4-2);
}

.planner-release-notes-container {
  max-width: var(--file-line-width);
  margin-left: auto;
  margin-right: auto;
}

.undo-timeout-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-accent);
}

.notice:has(.undo-timeout-bar) {
  position: relative;
  overflow: hidden;
}

.planner-flex-container > * {
  flex: 1 1 0;
  min-height: 0;
  max-height: max-content;
}

.planner-flex-scrollable {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.planner-settings-warning {
  margin-bottom: var(--size-4-6);
}
