/* ===========================
   WORKSPACE
=========================== */

.workspace {
  display: flex;
  width: 100%;
  height: 100vh;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
}

/* ===========================
   PANELS
=========================== */

#timelinePanel {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;

  background: #fff;
  border-right: 1px solid #ececec;

  overflow: hidden;
}

#todoWorkspace {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}

/* ===========================
   TIMELINE HEADER
=========================== */

.timeline-header {
  flex-shrink: 0;
  padding: 28px 24px 16px;
  border-bottom: 1px solid #efefef;
  background: #fff;
}

.timeline-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  margin-bottom: 6px;
}

.timeline-header h2 {
  margin: 0;

  font-size: 1.8rem;
  font-weight: 600;

  color: #111;
}

.timeline-date-small {
  margin: 0;
  padding-left: 4px;

  font-size: 12px;

  color: #8d8d8d;
}

/* ===========================
   TIMELINE ENTRY HOVER
=========================== */

.timeline-entry {
  cursor: pointer;

  border-radius: 12px;

  transition:
    background 0.2s ease,
    transform 0.18s ease;
}

.timeline-entry:hover {
  background: #fafafa;

}



.timeline-entry:hover .timeline-content {
  border-left-color: #b8b8b8;
}

.timeline-entry:hover .timeline-time {
  color: #555;
}

.timeline-entry:hover .timeline-dot {
  color: #888;
}

/* ===========================
   SEARCH
=========================== */

.timeline-search {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 220px;

  padding: 0 0 6px;

  border-bottom: 1px solid #e6e6e6;

  transition: border-color 0.2s ease;
}

.timeline-search:focus-within {
  border-color: #111;
}

.timeline-search-icon {
  width: 16px;
  height: 16px;

  color: #9b9b9b;

  flex-shrink: 0;
}

#timelineSearch {
  flex: 1;

  border: none;
  outline: none;
  background: none;

  padding: 0;

  font: inherit;
  font-size: 0.9rem;

  color: #111;
}

#timelineSearch::placeholder {
  color: #9b9b9b;
}

/* ===========================
   TIMELINE BODY
=========================== */

#timelineContainer {
  flex: 1;

  overflow-y: auto;

  padding: 20px;
}

.timeline-page {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===========================
   DAY
=========================== */

.timeline-day {
  display: flex;
  flex-direction: column;
}

.timeline-day-title {
  margin: 12px 0 14px;

  font-size: 0.8rem;
  font-weight: 700;

  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: #777;
}

/* ===========================
   ENTRY
=========================== */

.timeline-entry {
  display: flex;
  align-items: flex-start;

  margin: 0;
}

.timeline-content {
  width: 100%;

  margin-left: 25px;

  padding: 10px 0 10px 16px;

  border-left: 2px solid #ececec;
}

.timeline-time {
  font-size: 0.78rem;

  color: #999;

  white-space: nowrap;
}

.timeline-dot {
  margin: 0 6px;

  color: #c5c5c5;
}

.timeline-text {
  color: #222;

  font-size: 0.8rem;

  font-weight: 400;

  line-height: 1.6;

  word-break: break-word;

  overflow-wrap: anywhere;
}

/* ===========================
   TITLES
=========================== */

#timelineTitle,
#todoTitle {
  cursor: pointer;

  user-select: none;

  transition: opacity 0.2s ease;
}

#timelineTitle:hover,
#todoTitle:hover {
  opacity: 0.7;
}

/* ===========================
   TIneline SCROLLBAR Design
=========================== */
#timelineContainer {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #d6d6d6 transparent;
}

/* Chrome, Edge, Safari */

#timelineContainer::-webkit-scrollbar {
  width: 8px;
}

#timelineContainer::-webkit-scrollbar-track {
  background: transparent;
}

#timelineContainer::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#timelineContainer::-webkit-scrollbar-thumb:hover {
  background: #bdbdbd;
  background-clip: content-box;
}

#timelineContainer::-webkit-scrollbar-thumb {
  background: transparent;
  transition: 0.2s;
}

#timelineContainer:hover::-webkit-scrollbar-thumb {
  background: #d9d9d9;
}

/* ===========================
   ITimepline text colors
=========================== */
.timeline-completed {
  color: #6fcf97; /* light green */
  font-weight: 500;
}

.timeline-rescheduled {
  color: #e9c46a;
  font-weight: 500;
}

.timeline-highlight {
  background: #fff8e8;

  border-radius: 16px;

  transition: 0.3s;

  animation: timelineFlash 0.8s ease;
}

@keyframes timelineFlash {
  0% {
    background: #ffe9a9;
  }

  100% {
    background: #fff8e8;
  }
}

/* ===========================
   TIMELINE POPUP
=========================== */

.timeline-popup {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.25);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;

  backdrop-filter: blur(5px);
}

.timeline-popup.hidden {
  display: none;
}

.timeline-popup-card {
  width: min(500px, 90vw);

  max-height: 85vh;

  overflow-y: auto;

  background: #fff;

  border-radius: 24px;

  padding: 26px;

  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.12);

  position: relative;
}
.timeline-popup-close {
  position: absolute;

  right: 18px;
  top: 18px;

  border: none;

  background: none;

  cursor: pointer;
}

.timeline-popup-header h2 {
  margin: 0;

  font-size: 1.4rem;
}

.timeline-popup-header p {
  margin-top: 6px;

  color: #888;

  font-size: 0.85rem;
}

.timeline-popup-text {
  width: 100%;

  box-sizing: border-box;

  margin-top: 18px;

  padding: 16px;

  border: 1px solid #ececec;

  border-radius: 16px;

  background: #fafafa;

  resize: none;

  min-height: 150px;

  font: inherit;

  line-height: 1.7;

  color: #222;

  transition: 0.2s;
}

.timeline-popup-text:focus {
  background: white;

  border-color: #111;

  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}

.timeline-popup-actions {
  display: flex;

  gap: 12px;

  margin-top: 22px;
}

.timeline-popup-actions button {
  flex: 1;

  height: 46px;

  border-radius: 14px;

  border: 1px solid #ececec;

  background: white;

  font: inherit;

  font-weight: 500;

  cursor: pointer;

  transition: 0.18s;
}

.timeline-popup-actions button:hover {
  transform: translateY(-1px);

  background: #fafafa;
}

.timeline-popup-actions button:active {
  transform: translateY(0);
}

.timeline-popup-actions .danger {
  color: #ef4444;

  border-color: #ffe2e2;
}

.timeline-popup-actions .danger:hover {
  background: #fff5f5;
}

.timeline-popup-close {
  width: 38px;

  height: 38px;

  border-radius: 50%;

  border: none;

  background: transparent;

  display: flex;

  align-items: center;

  justify-content: center;

  cursor: pointer;

  transition: 0.18s;
}

.timeline-popup-close:hover {
  background: #f5f5f5;
}

.timeline-popup-actions {
  display: flex;

  justify-content: space-between;

  gap: 12px;

  margin-top: 20px;
}

.timeline-popup-actions button {
  flex: 1;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 12px;

  border-radius: 12px;

  border: 1px solid #ececec;

  cursor: pointer;

  background: white;
}

.timeline-popup-actions .danger {
  color: #ef4444;
}

.timeline-popup {
  animation: fadePopup 0.18s ease;
}

.timeline-popup-card {
  animation: popupScale 0.22s ease;
}

@keyframes fadePopup {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popupScale {
  from {
    opacity: 0;

    transform: translateY(14px) scale(0.97);
  }

  to {
    opacity: 1;

    transform: translateY(0) scale(1);
  }
}

/* ===========================
   INPUT COMPOSER
=========================== */
.timeline-composer {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 8px 20px;

  background: #fff;

  border-top: 1px solid #efefef;
}

.timeline-add-btn,
#timelineSendBtn {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;

  border-radius: 50%;

  background: #f6f6f6;

  cursor: pointer;

  transition: 0.2s;
}

.timeline-add-btn:hover,
#timelineSendBtn:hover {
  background: #ededed;
}

#timelineInput {
  flex: 1;

  border: none;

  outline: none;

  background: transparent;

  font: inherit;

  font-size: 0.95rem;
}
/* ===========================
   MOBILE
=========================== */

@media (max-width: 768px) {
  #timelinePanel,
  #todoWorkspace {
    width: 100vw;
    min-width: 100vw;

    scroll-snap-align: start;
  }
}
