/* --- Reset / globals --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family:
    FixelText,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'Noto Sans',
    system-ui,
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji';
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Default = light */
:root {
  --bg: rgb(248,248,248);
  --bg-todo: rgb(255, 255, 255);
  --text: rgb(36, 36, 36);
  --bg-sidebar: rgb(255, 255, 255);
  --bg-detailspane: rgb(240,240,240);
  --bg-sidebar-hover: rgb(151, 150, 150);
  --bg-dropdownmenu: #fff;
  --bg-dropdownmenu-hover: rgb(240, 240, 240);
  --shadow-dropdownmenu: rgb(250, 250, 250) 0px 5px 5px 0px;
  --bg-input-focus: #fff;
  --highlight-color: #7a5af5;
  --bg-todo-hover: rgb(245, 245, 245);
  --text-field-hyperlink: blue;
  --text-aboutlink: #7a5af5;

  /* Pills */
  --bg-pill-list: #7a5af5;
  --text-pill-list: #fff;
  --bg-pill-waiting: green;
  --text-pill-waiting: #fff;
  --bg-pill-deadline: yellow;
  --text-pill-deadline: black;
  --bg-pill-today: orange;
  --text-pill-today: black;
  --bg-pill-overdue: red;
  --text-bg-overdue: white;
  --text-pill-tag: purple;
}

/* System dark (only applies if no manual override) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: rgb(41, 41, 41);
    --bg-todo: #444;
    --text: #eee;
    --bg-sidebar: rgb(21, 23, 26);
      --bg-detailspane: #444;
    --bg-sidebar-hover: rgb(143, 142, 142);
    --bg-dropdownmenu: #444;
    --bg-dropdownmenu-hover: #555;
    --shadow-dropdownmenu: #666;
    --highlight-color: white;
    --bg-todo-hover: rgb(85,85,85);
    --bg-input-focus: rgb(85,85,85);
    --text-field-hyperlink: white;
    --text-aboutlink: #7a5af5;
  }
}

/* Manual dark override */
:root[data-theme='dark'] {
  --bg: rgb(41, 41, 41);
  --bg-todo: #444;
  --text: #eee;
        --bg-detailspane: #444;
  --bg-sidebar: rgb(21, 23, 26);
  --bg-sidebar-hover: rgb(143, 142, 142);
  --bg-dropdownmenu: #444;
  --bg-dropdownmenu-hover: #555;
  --shadow-dropdownmenu: #666;
  --highlight-color: white;
  --bg-todo-hover: rgb(85,85,85);
      --bg-todo-hover: rgb(85,85,85);
    --bg-input-focus: rgb(85,85,85);
    --text-field-hyperlink: white;
    --text-aboutlink: #7a5af5;
}

.caret-icon {
  color: var(--text);
  width: 1.5em;
  height: 1.5em;
}

/* --- Fonts --- */
@font-face {
  font-family: 'FixelText';
  src: url('./../assets/fonts/FixelText-Regular.woff2') format('woff');
}

/* --- App container --- */
.app-container {
  display: flex;
  flex: 1; /* fill remaining viewport height */
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* --- Sidebar (projects) --- */
.sidebar {
  flex: 0 0 20%; /* fixed 25% width */
  max-width: 20%;
  padding: 20px 15px;
  background: var(--bg-sidebar);
  color: var(--text);
  font-size: 13px;
  overflow-y: auto;
 
}
.sidebar ul {
  list-style: none;
}
.sidebar li {
  padding: 0.05rem 0.5rem;
  cursor: pointer;
}

.sidebar li .name {
    text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar li:hover .name {
  color: var(--bg-sidebar-hover);
  transition: background-color 0.5s ease;
}
  
/** App title and about */
#imgLogo {
  height: 40px;
  width: 40px;

}
#proudnl {
  text-align: center;
  font-size: smaller;
  margin-bottom: 20px;
}

#aboutlink {
  color: var(--text-aboutlink);
  text-decoration: none;
}

#aboutlink:hover {
  text-decoration: underline;
}

/* --- Wrapper for list headers  
   --- rendered as a grid with 3 columns. the last 2 columns are 20px, for the collapse and add buttons 
   --- The first column takes up the remaining space
   --- */
.sidebar-wrapper {
  display: grid;
  margin-top: 10px;
  width: 100%;
  grid-template-columns: 1fr 20px 20px;
  border-top: 1px solid var(--bg-detailspane);
  padding-top: 6px;
}

.sidebar-headerwrapper {
  margin-bottom: 8px;
  cursor: pointer;
}
.sidebarexpand,
.sidebaradd {
  cursor: pointer;
}
.sidebarexpand {
  position: relative;
  top: 2px;
}

#toggleAreas {
  /* Default = invisible */
  display: none;
}
#toggleProjects {
  /* Default = invisible */
  display: none;
}
#toggleLists {
    /* Default = invisible */
  display: none;
}
.expandvisible {
  display: block !important;
}

.sidebaradd {
  font-size: 16px;
  left: 2px;
}

.sidebar h2 {
  font-size: medium;
}

/* Sidebar lists */
.listitem {
  display: grid;
  width: 100%;
  grid-template-columns: 30px 1fr 20px;
}
.activelist {
  border-left: 3px solid var(--highlight-color);
  font-weight: 600;
}

.listcount {
  font-size: 0.9em;
  padding-top: 1px;
  text-align: center;
  color: var(--text);
}

.listcount.noitems {
  display: none;
}

.icon {
  font-size: 1.3em;
  position: relative;
  top: -2px;
}

/* --- Sidebar list, hidden or not --- */
#sidebar-listareas.hidden {
  display: none;
}
#sidebar-listprojects.hidden {
  display: none;
}
#sidebar-listlists.hidden {
  display: none;
}

/* --- Main (todo column) --- */
.todo-column {
  flex: 1 1 auto; /* this will expand to fill available space */
  min-width: 0; /* important so flex child can shrink properly */
  display: flex;
  flex-direction: column;
  transition: all 300ms ease;
  background: transparent;
   box-shadow: 0px 1px 1px 2px rgba(0, 0, 0, 0.1);
}
 

#listheaderwrapper {
  padding-top: 20px;
  display: grid;
  width: 100%;
  grid-template-columns: 60px 1fr 80px;
}

/* List icon column */
#listheadercol1 {
  padding-left: 20px;
  font-size: 24px;
}

/* List title, in second column */
h1#listtitle {
  font-size: 1.25em;
  color: var(--text);
}

.listdescription_editing {
  width: 100%;
  height: 26px;
  font-size: 0.8em;
  outline: none;
  resize: none;
  border: 1px solid lightgray;
  border-radius: 6px;
  font-family:
    FixelText,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
}

.listtitle_editing {
  width: 100%;
  height: 26px;
  font-size: 1.2em;
  font-weight: bold;
  outline: none;
  resize: none;
  border: 1px solid lightgray;
  border-radius: 6px;
  font-family:
    FixelText,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
}

/* List details button */
#listheadercol3 {
  font-size: 20px;
  padding-right: 10px;
 
}

/* Edit list button, for dropdown menu */
#btneditlist {
  text-align: center;
  font-weight: 900;
  cursor: pointer;
  color: var(--text);
}
#btneditlist:hover {
  background-color: var(--bg);
}

#listdropdownmenu {
  background-color: var(--bg-dropdownmenu);
  border: 1px solid var(--bg-sidebar-hover);
  position: absolute;
  top: 50px;
  right: 20px;
  visibility: hidden;
  box-shadow: var(--shadow-dropdownmenu);
  padding: 5px;
  font-size: small;
  border-radius: 3px;
}
#listdropdownmenu.opened {
  visibility: visible;
}

#listeditmenu {
  list-style-type: none;
}
.listeditmenuitem {
  padding: 6px;
  cursor: pointer;
  border-radius: 3px;
  color: var(--text);
}
.listeditmenuitem:hover {
  background-color: var(--bg-dropdownmenu-hover);
}

#listdescription {
  font-size: 0.8em;
  color: gray;
}

/* The todo list itself */
.todo-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  color: var(--text);
}

/* The todo-item cards */
.todo-item {
  background: var(--bg-todo);
  border-radius: 8px;
  padding: 0.75rem 1rem 0 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 0.5s ease;
}

.todo-item:hover {
  background-color: var(--bg-todo-hover);
}

/* Todo pills and details */
.todoitem-details {
  margin-left: 16px;
  margin-top: 4px;
}
.todowaiting {
  background-color: var(--bg-pill-waiting);
  color: var(--text-pill-waiting);
  padding: 4px;
  border-radius: 5px;
}
.todoprojectorarea {
  background-color: var(--bg-pill-list);
  color: var(--text-pill-list);
  padding: 4px;
  border-radius: 5px;
  margin-right: 6px;
}
.tododeadline {
  padding: 4px;
  border-radius: 5px;
}

.todotags {
  padding: 3px;
}
.todotag {
  color: var(--text-pill-tag);
  margin-right: 6px;
}

.todohasnote {
  margin-right: 20x;
}
.overdue {
  background-color: var(--bg-pill-overdue);
  color: var(--text-bg-overdue);
}
.scheduled {
  color: var(--text-pill-deadline);
  background-color: var(--bg-pill-deadline);
}
.today {
  background-color: var(--bg-pill-today);
  color: var(--text-pill-today);
}

.add-todo {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--bg-todo);
  background: var(--bg);
}
.add-todo input {
  flex: 1;
  outline: none;
  background: var(--bg-todo);
  color: var(--text);
  padding: 0.5rem;
  border: 1px solid var(--bg-todo);
  border-radius: 6px;
}

.add-todo input:focus {
  border: 1px solid orange;
}

.add-todo button {
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-todo);
  color: var(--text);
}

/* --- Details pane --- */
/* Closed: width 0 so it doesn't take layout space.
       Open: fixed width (25%) so main column shrinks. */
.details-pane {
  flex: 0 0 0;
  width: 0;
  max-width: 0;
  overflow-y: scroll;
  background: var(--bg-detailspane);
  padding: 0; /* no padding while closed */
  transition:
    width 300ms ease,
    max-width 300ms ease,
    padding 200ms ease;
    box-shadow: 0px 1px 1px 2px rgba(0, 0, 0, 0.1);
}
.details-pane.active {
  flex: 0 0 25%;
  width: 25%;
  max-width: 25%;
  padding: 1rem;
}

/* small visual inside details */
.details-pane h2 {
  /* margin-top: 50px; */
  margin-bottom: 0.5rem;
  font-size: 1.25em;
  color: var(--text);
}
.details-pane p {
  color: var(--text);
  line-height: 1.4;
}
#details-priority {
  height: 30px;
  margin-top: 10px;
  border: 1px solid lightgray;
  border-radius: 6px;
  color: var(--text);
  padding-left: 4px;
  font-size: 0.8em;
}
#prio-icon {
  font-size: 1.4em;
  position: relative;
  top: 3px;
}
#details-completeddate {
  color: var(--text);
}
/* --- Editable fields in details div --- */
#details-description {
  min-height: 120px;
  border: 1px solid lightgray;
  border-radius: 6px;
  color: var(--text);
  padding: 4px;
  font-size: 0.8em;
  display: block;
  margin: 1em 0;
  /*Show line breaks when present*/
  white-space: pre-wrap;
 word-wrap: break-word;
}
#details-description a {
  color: var(--text-field-hyperlink);
 
}
 

#details-deadline {
  height: 30px;
  margin-top: 10px;
  
  border: 1px solid lightgray;
  border-radius: 6px;
  color: var(--text);
  padding: 6px;
  font-size: 0.8em;
}

#deletedeadline {
  
  float: right;
  display: none;
 
  color: var(--text);
  background: none;
  border: none;
 
  position: relative;
  top: -28px;
  right: 12px;
  cursor: pointer;
  font-size: 1.1rem;
}

#deletedeadline:hover {
  color: red;
}
#details-area,
#details-project,
#details-iswaiting,
#details-list {
  height: 30px;
  margin-top: 10px;
  border: 1px solid lightgray;
  border-radius: 6px;
  color: var(--text);
  padding: 6px;
  font-size: 0.8em;
}
.details-editable:hover {
  background-color: var(--bg-input-focus);
}

#details-completeddate {
  font-size: 0.8em;
}
.details_title_editing {
  margin-top: 27px;
  outline: none;
  resize: none;
  margin-bottom: 7px;
  border: 1px solid lightgray;
  padding: 0px;
  font-size: 1.2em;
  font-weight: bold;
  font-family:
    FixelText,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
}

.details_description_editing {
  padding: 4px;
  outline: none;
  resize: none;
  border: 1px solid lightgray;
  border-radius: 6px;
  font-size: 0.8em;
  font-family:
    FixelText,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
}

#btndeletetodo {
  margin-top: 15px;
}

/* Dropdown list for List targets */
#targetlistdropdown {
  background-color: var(--bg-dropdownmenu);
  border: 1px solid var(--bg-sidebar-hover);
  box-shadow: var(--shadow-dropdownmenu);
  padding: 5px;
  border-radius: 3px;
  display: none;
  position: absolute;
  padding: 6px;
  max-height: 400px;
  overflow-y: scroll;
}

#targetlistdropdown ul {
  list-style-type: none;
}

.targetlistitem {
  padding: 6px;
    font-size: 0.8em;
  cursor: pointer;
  border-radius: 3px;
  color: var(--text);
}
.targetlistitem:hover {
  background-color: var(--bg-dropdownmenu-hover);
}

/* --- Hamburger for small screens --- */
.hamburger {
  display: none;
  padding: 0.6rem 1rem;
  background: #2c3e50;
  color: var(--bg-todo);
  cursor: pointer;
}

#closeDetails {
  float: right;
  color: var(--text);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
}

/* small nicety: ensure todo-list children don't overflow horizontally */
.todo-list > * {
  min-width: 0;
}

/* Todo item checkboxes */
.checkbox-rounded {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 18px;
  user-select: none;
}

.checkbox-rounded input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark-rounded {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: transparent;
  border: 1px solid grey;
  border-radius: 50%;
}

.checkbox-rounded:hover input ~ .checkmark-rounded {
  background-color: #ccc;
  border: none;
}

.checkbox-rounded input:checked ~ .checkmark-rounded {
  background-color: lightgreen;
  border: none;
}

.checkmark-rounded:after {
  content: '';
  position: absolute;
  display: none;
}

.checkbox-rounded input:checked ~ .checkmark-rounded:after {
  display: block;
}

.checkbox-rounded .checkmark-rounded:after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.todo-title {
  position: relative;
  left: 35px;
  top: -15px;
  font-size: 14px;
}

/* Settings dialog */
.settingshidden {
  width: 75vw !important;
  height: 75vh !important;
  padding: 20px !important;
}

#settingsdialog {
  width: 0;
  height: 0;
  overflow: hidden;
  background-color: azure;
  border: 1px solid grey;
  border-radius: 10px;
  position: absolute;
  z-index: 999;
  top: 50%;
  left: 50%;
  padding: 0px;
  transform: translate(-50%, -50%);
}

#settingsdialog > h3 {
  margin-top: 26px;
  margin-bottom: 8px;
}

#settingsheader {
  display: grid;
  grid-template-columns: 1fr 90px;
}

div#closesettings {
  text-align: right;
  font-weight: bold;
  cursor: pointer;
}

/** Buttons **/
.btn {
  cursor: pointer;
  overflow: hidden;
  padding: 6px;
  border-width: 0;
  outline: none;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  background-color: #2ecc71;
  color: #ecf0f1;
  transition: background-color 0.3s;
}

.btn:hover,
.btn:focus {
  background-color: #27ae60;
}

.btn > * {
  position: relative;
}

.btn span {
  display: block;
  padding: 12px 24px;
}

.btn:before {
  content: '';
  display: block;
  width: 0;
  padding-top: 0;
  border-radius: 100%;
  background-color: rgba(236, 240, 241, 0.3);
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.btn:active:before {
  transition:
    width 0.2s ease-out,
    padding-top 0.2s ease-out;
}

.btn.orange {
  background-color: #e67e22;
}

.btn.orange:hover,
.btn.orange:focus {
  background-color: #d35400;
}

.btn.red {
  background-color: #e74c3c;
}

.btn.red:hover,
.btn.red:focus {
  background-color: #c0392b;
}

/* TOASTS */
.toastContain {
  position: absolute;
  bottom: 60px;
  right: 30px;
  outline: none;
}

.toast {
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  font-size: small;
  opacity: 70%;
}

/* Create different toasts by providing extraClasses and styling them here. */
.toast.success {
  background-color: green;
  color: white;
}
.toast.failure {
  background-color: red;
}
.toast.warning {
  background-color: blue;
}

/* THEME BUTTON */
#theme-toggle,
#theme-icon {
  background: none;
  border: none;
  float: left;
  cursor: pointer;
  font-size: 1em;
}
#theme-toggle {
  padding-top: 6px;
}

/** Search */
#searchwrapper {
    margin-top: 10px;
}

#searchwrapper input {
  
  outline: none;
  background: var(--bg-todo);
  color: var(--text);
  padding: 0.3rem;
  border: 1px solid var(--text);
  border-radius: 6px;
}

#searchwrapper input:focus {
  border: 1px solid orange;
}

#search {
 width: 100%;
}