/* -------------Structural elements --------------*/

:root {
    color-scheme:dark;
  --body-bg: #222;
  --body-color: 221, 221, 221;
  --tile-borders: rgba(255, 255, 255, 0.7);
  --deleteButton-bg: rgba(255, 255, 255);
  --deleteButton-color: white;
  --highlights-body: #636363;
  --toolbar-background: #121212;
  --container-borders: rgba(17, 17, 17, 0.5);
  --saveButton: #111;
  --boxshadow-color: rgba(0, 0, 0, 0.8);
  --header-background: #333;
  --font: "system-ui";
  --font-strong: "ui-serif";
  --button-alignment: 50%;
  --notetile-bg: black;
  --note-date: pink;
}

:root.light-theme {
    color-scheme:light;
  --tile-borders: #2c3e50;
  --deleteButton-color: black;
  --highlights-body: #2c3e50;
  --toolbar-background: #2c3e50;
  --container-borders: rgba(256, 256, 256, 0.8);
  --deleteButton-bg: #2c3e50;
  --saveButton: #e8e4d6;
  --body-bg: rgb(255, 241, 229);
  --body-color: 74, 74, 74;
  --header-background: #fff7ef;
  --font: "system-ui";
  --font-strong: "ui-serif";
  --button-alignment: 40%;
  --notetile-bg: antiquewhite;
  --note-date: #2c3e50;
}

body {
  z-index: 0;
  /*overflow-x: hidden;*/
  display: flex;
  border-top:1px solid var(--container-borders);
}

body > * {
  min-width: 0;
}

body,
html {
  background-color: var(--body-bg);
  margin: 0;
  position: relative;
  color: rgb(var(--body-color));
  font-family: var(--font), "Nerd Font Symbols";
  font-size: 18px;
  /* scrollbar-width: none; /* Firefox */ 
  /* -ms-overflow-style: none; /* IE/Edge */ 
  touch-action: pan-y;
  overscroll-behavior-x: contain;
}

html, body {
  width: 100%;
  max-width: 100vw; /* Important */
  overflow-x:clip;
  height: calc(100% - 1px);
}

@media only screen and (min-width: 1082px) {
  body {
        height:calc(100vh - 1px);
  }
}

#first-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

@font-face {
  font-family: "jetbrains mono";
  src: url("../assets/fonts/JetBrainsMonoNerdFontMono-Regular.ttf")
    format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Nerd Font Symbols";
  src: url("../assets/fonts/SymbolsNerdFontMono-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

#sortable-container {
  box-sizing: border-box;
  /* padding-left: 2px; */
  /* padding-right: 2px; */
  /* /overflow: auto; */
  /* /-webkit-overflow-scrolling: touch; /* Add this line */
  /* /resize: horizontal; */
  /* /box-shadow: -1px 2px 5px var(--boxshadow-color) inset; */
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  flex-grow: 1;
    padding-bottom:50px;
}

#first-container {
    line-height:1.5;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */

    display: flex;
    flex-direction: column;
}

#list-slideover {
    overflow-x:hidden;
  position: absolute;
  top: 0;
  left: 0; /* ⬅️ Position on the left instead of right */
  width: 300px;
  height: calc(100vh - 61px);
  z-index: 1;
  border-right: 1px solid var(--container-borders);
  background-color: var(--body-bg);
  line-height: 1.5;
  overflow-y: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  display: none;
  flex-direction: column;
  flex-shrink: 0;
}

#list-slideover.active {
    display: flex;
}

#list-slideover::-webkit-scrollbar {
  display: none;
}

#second-column {
  flex-grow: 1;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width:0;
}

#note-tiles {
  width: 100%;
  box-sizing: border-box;
  height: 100%;
    padding-bottom:80px;
}

#lists {
  display: flex;
  box-sizing: border-box;
  max-width: 800px;
  /* margin: 0 auto; */
  flex-grow:1;
  flex-direction: column;
}

.sortable-columns {
  justify-content: space-evenly;
  display: flex;
  box-sizing: border-box;
  position: relative;
 /* margin: 10px 10px 0px 10px;*/
  z-index: 2;
  background-color: var(--body-bg);
  transform: translateX(0px);
  transition: transform 0.3s ease-out;
  flex-grow: 1;
    min-width:0;
}

.sortable-columns.active {
  transform: translateX(301px);
  height: calc(100vh - 51px);
  overflow: clip;
}

#sortable-column {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  /* justify-content: center; */
  align-items: center;
}

footer {
  font-family: monospace, "Nerd Font Symbols";
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: calc(100%);
  background-color: var(--body-bg);
  height: 40px;
  border-top: 1px solid var(--container-borders);
  border-bottom: 10px solid var(--body-bg);
  justify-content: space-between;
  align-items: center;
  text-align: center;
  -webkit-user-select: none;
  /* font-family: */
  /*   cmu typewriter text, */
  /*   "Nerd Font Symbols"; */
  box-sizing: content-box;
  z-index: 10000;
  font-size: 16px;
}

.hidden-footer {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

#footer-left {
  padding-left: 20px;
  font-weight: lighter;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  height: 27px;
}

#footer-right {
  display: flex;
  justify-content: flex-end;
  flex: 1;
  padding-right: 10px;
}

#trash {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10px 0 10px;
  background-color: var(--container-borders);
  cursor: pointer;
  border-radius: 3px;
}

.note-tile {
  position: relative;
  display: flex;
    flex-direction: column;
  max-height: 50px; /* Adjust this value according to your needs */
  overflow: hidden;
  padding: 5px;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer */
  user-select: none; /* Standard syntax */
  text-overflow: ellipsis;
  /*font-weight: 300;*/
}

.note-tile.selected {
  background: var(--notetile-bg);
}

.note-tile.active {
  /* display: block !important; */
  background-color: var(--header-background);
}

.note-tile p {
  display: -webkit-box;
  -webkit-line-clamp: 1; /* Limiting to three lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 5px 0 5px 0;
}

.note-heading {
  display: -webkit-box;
  -webkit-line-clamp: 1; /* Limiting to three lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-left:0px;
}

.note-date {
  opacity: 0.8;
  color: var(--note-date);
  font-size: x-small;
  line-height:1;
  font-family: jetbrains mono;
  margin-left:2px;
}

.note-date:empty {
  display: none;
}

.note-tile.no-date {
  line-height: inherit;
  padding: 5px;
}

/* Style for wide screens */
@media only screen and (min-width: 1082px) {
  /* #sortable-container, */
  /* #note-tiles, */
  /* #sortable-column { */
  /*   display: block; /* Show all panels by default on wider screens */
  /* } */
  /* #sortable-container { */
  /*   overflow: auto; */
  /* } */
  #sortable-column {
    overflow-y: auto;
  }

  #note-tiles {
    overflow: auto;
  }

  #sortable-container,
  #note-tiles {
    /* Hide the default scroll bars */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer and Edge */
  }

  #sortable-container::-webkit-scrollbar,
  #note-tiles::-webkit-scrollbar,
  .ql-editor::-webkit-scrollbar {
    /* Hide the default scroll bars for WebKit browsers */
    display: none;
  }

    #first-container {
        width: 300px;
        border-right: 1px solid var(--container-borders);
        flex-shrink: 0;
        display:flex;
        flex-direction:column;
        overflow-y:auto;
    }

    #focusInput {
        display: none;
    }

  #second-column {
  }

  /* .sortable-columns { */
  /*   height: calc(100vh - 51px); */
  /* } */

  .ql-editor {
    padding: 40px 60px;
  }
}

/* Style for small screens */
@media only screen and (max-width: 1081px) {
  .sortable-columns {
    /* padding-bottom: 60px; */
    min-height: calc(100% - 10px);
  }
  header {
    justify-content: space-around;
  }

  footer {
    align-items: start;
    padding-top: 5px;
  }

  #listNameInput,
  #notes-h2 {
    flex: 1;
    opacity: 0.5;
  }

  #compose-h2 {
    flex: 1;
  }

  #lists {
    height: 100%;
  }

  #first-container.hiddenpanel,
  #second-column.hiddenpanel {
    display: none; /* Hide all panels by default on smaller screens */
  }
}

/* Hide elements with the class "hide-on-mobile" on mobile devices */
@media only screen and (max-width: 1081px) {
  #second-column,
  #first-container {
    width: 100%;
  }
}

/* -------------Styles for sortable tags --------------*/

.sortable-tag {
  position: relative;
  margin-left: 5px;
  margin-top: 5px;
  margin-bottom: 0px;
  padding-left: 20px;
  box-sizing: border-box;
  cursor: grab;
  z-index: 1;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer */
  user-select: none; /* Standard syntax */
}

.sortable-tag.selected > .buttons-wrapper::after {
  background: var(--header-background);
}

.sortable-tag.parent > .buttons-wrapper::before {
  color: var(--highlights-body);
  content: var(--button-content, "󰌕 ");
  /* font-family: monospace; */
  font-size: small;
}

.buttons-wrapper:has(+ .nested-sortable:not(.collapsed))::before{
  content: var(--button-content, "󰌖 ");
} 

.sortable-tag.hidden {
  display: none;
}

.buttons-wrapper::before {
  content: "󰌖 ";
  position: absolute;
  top: 15px;
  left: -20px;
  right: 0;
  /* bottom: -5px; */
  opacity: 1;
  border-radius: 3px;
  transform: translateY(-55%);
  font-size: small;
  color: var(--highlights-body);
}

.buttons-wrapper::after {
  content: " ";
  position: absolute;
  top: -5px;
  left: -25px;
  right: -2px;
  bottom: -5px;
  opacity: 1;
  z-index: -1;
}

.tag-content {
  font-style: normal;
  font-weight: 300;
  padding: 0px;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
  display: inline-block;
  padding-right: 5px;
}

.counter {
  font-size: small;
  font-style: normal;
  font-weight: 200;
  opacity: 0.6;
}

.sortable-tag.sortable-ghost {
  opacity: 0.2;
  cursor: grabbing;
  border: 1px solid white;
}

.nested-sortable.collapsed {
  display: none;
}

/* use this for extra bit of colour 
.sortable-tag.dragover .tag-content {
  /* /border-color: blue; */
/* /color: blue; */
/* } */

/* -------------tag buttons & toggles --------------*/

.buttons-wrapper {
  position: relative;
  display: flex;
  align-content: center;
  align-items: center;
  width: 100%;
  min-height: 14px;
}

.toggle-button {
  font-size: small;
  opacity: 0.6;
  position: absolute;
  right: 0px;
  top: -8px;
}

.delete-button {
  justify-content: center;
  align-items: center;
  display: none;
  width: 28px;
  font-size: medium;
  cursor: crosshair;
  opacity: 0.2;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  position: absolute;
  right: 0;
  bottom: -4px;
  top: -3px;
  z-index: 20;
  font-family: "courier new", monospace;
  color: var(--deleteButton-color);
}

.sortable-tag.selected > .buttons-wrapper > .delete-button {
  display: inline-flex;
}

.note-delete {
  position: absolute;
  right: 0;
  top: 0;
  cursor: crosshair;
  z-index: 1;
  display: none;
  opacity: 0.2;
  font-family: "courier new", monospace;
  width: 28px;
  height: 100%;
  justify-content: center;
  align-items: center;
  font-size: large;
  color: var(--deleteButton-color);
}

.note-tile.selected > .note-delete {
  display: inline-flex;
}

/* -------------page buttons & toggles --------------*/

#new-tag-controls {
  /* display: flex; */
  /* align-items: center; */
  /* flex-direction: row; */
  /* flex-grow: 1; */
  width: 100%;
  position: sticky;
  position: -webkit-sticky;
  top: 0px;
  z-index: 10;
}

#new-tag-input {
  display: flex;
  box-sizing: border-box;
  height: 37px;
  flex: 1;
  border: none;
  background-color: #121212;
  color: #fff;
  font-family: inherit;
  font-size: 16px; /* Change font size */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none; /* Standard syntax */
  background-color: var(--toolbar-background);

  /* Reset additional default styles */
  box-shadow: none; /* Reset box-shadow */
  padding: 0; /* Reset padding */
  overflow: auto; /* Enable scrolling if needed */
  resize: none;
  outline: none;
  padding-left: 5px;
  vertical-align: middle;
  margin-right: 1px;
  width: 100%;
  border-radius:0px;
}

#new-tag-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#note-tags {
  width: 100%;
  display: flex;
  box-sizing: border-box;
  height: 37px;
  flex: 1;
  border: none;
  background-color: var(--toolbar-background);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  padding: 0;
  overflow: auto;
  resize: none;
  outline: none;
  padding-left: 5px;
  vertical-align: middle;
  border-radius:0px;
}

/* Save button styles */
#saveButton {
  cursor: pointer;
  font-family: inherit;
  filter: none;
  border-width: 1px;
  border-style: solid;
  border-color: var(--container-borders); /* Initial border color */
  opacity: 0.8;
  padding: 0px 5px;
  background-color: var(--container-borders);
  border-radius: 3px;
  margin-right: 5px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  transition: border-color 0.3s ease;
  color: inherit;
}

#saveButton.unsaved {
  color: var(--body-bg);
  background: rgb(var(--body-color));
}

#saveButton.loading {
  position: relative;
  color: var(--body-color) !important;
}

/* Ellipsis animation */
@keyframes ellipsis {
  0% {
    content: "";
  }
  33% {
    content: ".";
  }
  66% {
    content: "..";
  }
  100% {
    content: "...";
  }
}

#saveButton.loading::before {
  content: ""; /* Starts with no content */
  position: absolute; /* Position it to replace the text */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Center the ellipses inside the button */
  animation: ellipsis 1s steps(4, end) infinite; /* Animate the ellipses */
  color: inherit; /* Inherit the button's text color */
  font-weight: inherit; /* Inherit the button's font weight */
  color: var(--body-bg);
}

.loginButton {
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  filter: none;
  border-width: 1px;
  border-style: solid;
  border-color: var(--container-borders);
  color: var(--body-color);
  opacity: 0.8;
  padding: 0px 5px 0px 5px;
  background-color: var(--container-borders);
  border-radius: 3px;
  margin-right: 5px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* -----------------------columns -------------------------*/

/* .column-delete { */
/*   position: absolute; */
/*   margin-right: 5px; */
/*   color: red; */
/*   transition: none !important; /* Disable transitions */
/*   animation: none !important; /* Disable animations */
/*   cursor: crosshair; */
/*   bottom: 0; */
/*   right: 0; */
/*   font-family: "Roboto Mono", sans-serif; */
/* } */
/**/
.column-controls {
  position: -webkit-sticky;
  position: sticky;
  top:0px;
  /* text-align: center; */
  /* /display: flex; */
  /* align-items: center; */
  /* /width: 100%; */
   z-index: 2; 
  /* /border-bottom: 1px solid var(--container-borders); */
  /* /border-top: 1px solid var(--container-borders); */
  /* /background-color: var(--toolbar-background); */
  /* /box-shadow: 0 1px 2px #000; */
  /* border-radius: 5px; */
}
/**/
/* .column-wrapper { */
/*   position: relative; */
/* } */
/**/
/* header h2 { */
/*   font-size: inherit; */
/*   word-break: break-all; */
/*   width: 100%; */
/*   margin: 0px; */
/*   font-weight: lighter; */
/*   color: grey; */
/* } */
/**/
/* footer h2 { */
/*   font-size: inherit; */
/*   word-break: break-all; */
/*   width: 100%; */
/*   margin: 0px; */
/*   font-weight: lighter; */
/*   color: grey; */
/* } */

#toolbar-control {
  border-width: 1px;
  border-style: solid;
  font-size: 20px;
  margin: 0px 10px 0px 10px;
  padding: 0px 10px 0px 10px;
  border-radius: 3px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  border-color: var(--container-borders);
  cursor: pointer;
  font-family: monospace;
  background-color: var(--container-borders);
}

/* Add this CSS to your styles */
.spinner {
  -webkit-display: none;
  display: none; /* Hidden by default */
  position: fixed; /* Sit on top of the page content */
  z-index: 999; /* Ensure it sits above everything else */
  width: 100vw; /* Full width (cover the whole screen) */
  height: 100vh; /* Full height (cover the whole screen) */
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
  justify-content: center; /* Center the spinner horizontally */
  align-items: center; /* Center the spinner vertically */
}

.spinner.show {
  display: flex; /* Show the spinner */
  -webkit-display: flex;
}

.spinner::after {
  content: " ";
  display: block;
  width: 40px;
  height: 40px;
  margin: 1px;
  border-radius: 50%;
  border: 6px solid #fff;
  border-color: #fff transparent #fff transparent;
  animation: spinner 1.2s linear infinite;
}

@keyframes spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ::-webkit-scrollbar { */
/*     width: 8px; */
/*     height: 6px; */
/* } */
/**/
/* ::-webkit-scrollbar-thumb { */
/*     background: var(--container-borders); */
/*     border-radius: 6px; */
/* } */
/**/
/* ::-webkit-scrollbar-track { */
/*     background: 0 0; */
/* } */

/* #sortable-column { */
/*   -webkit-overflow-scrolling: touch; /* smoother on iOS */ */
/* } */

/* /* Hide scrollbar but allow scrolling */
/* #sortable-column::-webkit-scrollbar { */
/*   width: 8px; */
/*   height: 8px; */
/* } */

/* #sortable-column::-webkit-scrollbar-thumb { */
/*   background-color: rgba(255, 255, 255, 0.3);  /* light thumb on dark bg */
/*   border-radius: 4px; */
/* } */

/* #sortable-column::-webkit-scrollbar-track { */
/*   background-color: rgba(0, 0, 0, 0.2); /* dark track */ */
/* } */
