/* ======================== 
   Reset and base styles 
======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background-color: #ffffff;
  font-family: "Plus Jakarta Sans", sans-serif;
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ========================
   Dark Theme Styles
======================== */
body.dark-theme {
  background-color: #000112;
  color: #ffffff;
}

body.dark-theme .sidebar {
  background-color: #2b2c37;
}

body.dark-theme .launch-sidebar {
  background: #20212c;
}

body.dark-theme .logo-dark-icon {
  display: flex;
}

body.dark-theme .logo-light-icon {
  display: none;
}

body.dark-theme .board-btn,
body.dark-theme .hide-sidebar-btn,
body.dark-theme .eye-btn,
body.dark-theme .new-task-btn,
body.dark-theme .plus-btn,
body.dark-theme .taskCard {
  color: #ffffff;
}

body.dark-theme .modal,
body.dark-theme .modal-content {
  background: #2b2c37;
}

body.dark-theme header {
  background-color: #2b2c37;
  color: #ffffff;
}

body.dark-theme .taskCard {
  background-color: #2b2c37;
  box-shadow: 0px 4px 6px 0px #364e7e1a;
}

body.dark-theme .toggle-container,
body.dark-theme .hide-sidebar-btn,
body.dark-theme .eye-btn {
  background: #635fc7;
}

body.dark-theme .hide-sidebar-btn:hover,
body.dark-theme .eye-btn:hover {
  background-color: #514bb0;
}

body.dark-theme .hide-sidebar-btn:active,
body.dark-theme .eye-btn:active {
  background-color: #403a97;
}

body.dark-theme .mobile-nav-modal {
  background-color: #2b2c37;
}

/* ========================
   Layout container 
======================== */
.container {
  display: flex;
  min-height: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #ffffff;
  width: 18.75rem;
  min-width: 13.75rem;
  border-right: 1px solid #e4ebfa;
}

.navigation-section {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.launch-sidebar {
  background-color: #f4f7fd;
  width: 100%;
  flex-grow: 1;
}

/* ======================== 
   Sidebar logo and boards 
======================== */
.logo {
  padding: 1.875rem 0 0 1.875rem;
  display: flex;
  justify-content: flex-start;
}

.logo-light-icon {
  width: 75%;
  cursor: pointer;
}

.logo-dark-icon {
  display: none;
  width: 75%;
  cursor: pointer;
  margin-bottom: 6px; /* Keeps element positioned consistently with the default theme */
}

.logo-mobile {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.dark-logo-mobile {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.board h4 {
  margin-bottom: 5px;
  padding-left: 2rem;
}

h4 {
  color: #828fa3;
  font-weight: bold;
  font-size: 0.75rem;
  line-height: 0.9375rem;
  letter-spacing: 0.15rem;
}

.board-btn {
  display: block;
  background-color: #635fc7;
  line-height: 100%;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  width: 90%;
  height: 3rem;
  border-bottom-right-radius: 6.25rem;
  border-top-right-radius: 6.25rem;
  border: none;
  cursor: pointer;
}

/* ========================
   Toggle Styles
======================== */
.toggle-slider {
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
  margin-bottom: 15px;
}

.toggle-container {
  display: flex;
  background: #f4f7fd;
  align-items: center;
  justify-content: center;
  width: 80%;
  height: 3rem;
  border-radius: 6px;
  padding: 0 1rem;
  margin-left: 10px;
  gap: 15px;
}

.icon {
  width: 20px;
  height: 24px;
  font-size: 16px;
}

.theme-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.theme-toggle input {
  display: none; /* hide the real checkbox */
}

.switch {
  display: inline-block;
  position: relative;
  cursor: pointer;
  width: 40px;
  height: 20px;
  background: #635fc7;
  border-radius: 20px;
  transition: all 0.3s;
}

.switch::after {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 4px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.theme-toggle input:checked + .switch:after {
  left: 22px;
  content: "";
}

.theme-toggle input:checked + .switch {
  background: #000112;
}

.hide-sidebar-btn {
  background-color: #f4f7fd;
  line-height: 100%;
  color: #635fc7;
  font-weight: 700;
  font-size: 0.9375rem;
  width: 90%;
  height: 3rem;
  border-bottom-right-radius: 6.25rem;
  border-top-right-radius: 6.25rem;
  border: none;
  cursor: pointer;
}

.eye-btn {
  display: none;
  position: fixed;
  bottom: 25px;
  background-color: #e4ebfa98;
  font-weight: 700;
  width: 3.5rem;
  height: 3rem;
  border-bottom-right-radius: 6.25rem;
  border-top-right-radius: 6.25rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: 0 10px;
}

.eye-icon {
  width: 20px;
  height: 24px;
  font-size: 16px;
  display: flex;
  align-self: center;
  font-size: 20px;
}

.eye-btn:hover {
  background: #a8a4ff;
}

.eye-btn:active {
  background: #8a85f0;
}

.hide-sidebar-btn:hover {
  background: #e4ebfa;
}

.hide-sidebar-btn:active {
  background: #d0d7f2;
}

.board-btn:hover,
.new-task-btn:hover,
.plus-btn:hover {
  background-color: #514bb0;
}

/* ========================
   Header and board list 
======================== */
header {
  background-color: #ffffff;
  color: #000112;
  padding: 2.125rem 1.25rem 1.25rem 1.25rem;
  font-size: 1.125rem;
  line-height: 1.4375rem;
  border-bottom: 1px solid #e4ebfa;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
}

.new-task-btn {
  background-color: #635fc7;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 100%;
  border: none;
  cursor: pointer;
  border-radius: 1.25rem;
  padding: 10px 12px;
}

.plus-btn {
  display: none;
  background-color: #635fc7;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.board-list {
  display: flex;
  gap: 0.9375rem;
}

/* ========================
  Columns section 
======================== */
.columns {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 340px));
  gap: 1.5625rem;
  width: 100%;
}

.column {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.column h4 {
  display: flex;
  margin-bottom: 0.9375rem;
  gap: 10px;
}

.dot {
  height: 0.9375rem;
  width: 0.9375rem;
  border-radius: 50%;
  display: inline-block;
}

.indigo {
  background-color: #49c4e5;
}

.purple {
  background-color: #8471f2;
}

.green {
  background-color: #67e2ae;
}

.tasks-container {
  display: flex;
  flex-direction: column;
}

.taskCard {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  background-color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 16px;
  width: 100%;
  height: 3.75rem;
  border-radius: 8px;
  box-shadow: 0px 4px 6px 0px #364e7e1a;
  padding-left: 0.9375rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  overflow: hidden;
}

.taskCard .task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taskCard:hover {
  transform: scale(1.02);
}

/* ========================
   Mobile Navigation Modal
======================== */

.mobile-board {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.mobile-board h4 {
  position: relative;
  left: 65px;
  margin-top: 10px;
}

.mobile-board .toggle-slide {
  position: relative;
  left: 20px;
}

/* Navigation Backdrop */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  top: 4.375rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.mobile-nav-modal {
  position: fixed;
  background: #ffffff;
  top: 4.4688rem;
  left: 17px;
  border-radius: 8px;
  width: 21.25rem;
  height: 12.5rem;
  box-shadow: 0px 10px 20px 0px #364e7e40;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

/* Active state */
.mobile-nav-backdrop.show .mobile-nav-modal {
  transform: translateX(0); /* slide in */
}

.mobile-close-btn {
  position: absolute;
  color: #ea5555;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.875rem;
  cursor: pointer;
  font-weight: bold;
  width: 1.5625rem;
  height: 1.5625rem;
  transition: transform 0.2s ease-in-out, font-weight 0.2s ease-in-out;
  transition-delay: 0.1s;
}

/* Show only on mobile */
@media screen and (min-width: 801px) {
  #mobile-nav-backdrop {
    display: none !important;
  }
}

/* ========================
   Modal Styles
======================== */
.modal-backdrop,
.modal-new-task {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  position: relative;
  background: white;
  border-radius: 5px;
  width: 28.125rem;
  max-width: 90%;
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-weight: bold;
  font-size: 1.125rem;
  line-height: 100%;
}

.modal label {
  font-weight: 700;
  color: #828fa3;
  display: block;
  font-size: 12px;
  line-height: 100%;
  margin: 10px 0 5px;
}

.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #828fa340;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4375rem;
  margin-bottom: 10px;
}

.modal textarea {
  resize: none;
  overflow: auto;
}

#task-status,
#new-task-status,
#task-priority,
#new-task-priority {
  cursor: pointer;
}

#task-priority,
#new-task-priority {
  margin-bottom: 20px;
}

.faded {
  color: #828fa3;
}

.close-btn {
  position: absolute;
  color: #ea5555;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.875rem;
  cursor: pointer;
  font-weight: bold;
  width: 1.5625rem;
  height: 1.5625rem;
  transition: transform 0.2s ease-in-out, font-weight 0.2s ease-in-out;
  transition-delay: 0.1s;
}

.close-btn:hover {
  transform: scale(1.15);
}

.task-btn {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.view-btn {
  color: #ffffff;
  border: none;
  cursor: pointer;
  width: 200px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  height: 40px;
  text-align: center;
  line-height: 23px;
}

#save-btn {
  background: #635fc7;
}

#delete-btn {
  background: #ea5555;
}

#delete-btn:hover {
  background: #d64545;
}

#delete-btn:active {
  background: #b93636;
}

/* ========================
   Confirmation Modal
======================== */
.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 5px;
  text-align: center;
  width: 20rem;
  max-width: 80%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-content p {
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 500;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.25s ease;
  overflow: hidden;
}

/* Yes button (primary action) */
#confirm-yes {
  background-color: #ea5555;
  color: #ffffff;
}

#confirm-yes:hover {
  background-color: #d64545;
}

/* No button (secondary action) */
#confirm-no {
  background-color: #f4f7fd;
  color: #000112;
}

#confirm-no:hover {
  background-color: #e4ebfa;
}

/* ========================
   Create Task Modal 
======================== */
.create-task-btn {
  background-color: #635fc7;
  color: #ffffff;
  border: none;
  cursor: pointer;
  width: 100%;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  height: 40px;
  text-align: center;
  line-height: 23px;
}

.create-task-btn:hover,
#save-btn:hover {
  background-color: #514bb0;
}

.create-task-btn:active,
.new-task-btn:active,
.plus-btn:active,
.board-btn:active,
#save-btn:active {
  background-color: #403a97;
}

/* ========================
   UI Feedback Styles
======================== */
.error-div {
  text-align: center;
  color: red;
  font-weight: 600;
  padding-bottom: inherit;
}

.loading-div {
  text-align: center;
  padding-bottom: inherit;
  color: #828fa3;
  font-weight: 600;
}

/* ========================
   Priority Dot Styles
======================== */
.priority-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 8px;
  position: relative;
}

/* Tooltip base */
.priority-dot::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%; /* above the dot */
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.priority-dot::before {
  content: "";
  position: absolute;
  bottom: 115%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Show tooltip on hover */
.priority-dot:hover::after,
.priority-dot:hover::before {
  opacity: 1;
}

/* colors: high, medium, low */
.priority-dot.high {
  background: #d91919; /* red */
  border: 1px solid #bd1d1d;
}

.priority-dot.medium {
  background: #ef9c1c; /* yellow */
  border: 1px solid #dc7900;
}

.priority-dot.low {
  background: #01a501; /* green */
  border: 1px solid #019901;
}

/* ========================
   Responsive Styles
======================== */
/******** Tablets ********/
@media screen and (max-width: 800px) {
  .container {
    flex-direction: column;
  }

  .sidebar,
  .toggle-slider,
  .navigation-section {
    display: none;
  }

  #eye-btn {
    display: none !important;
  }

  header {
    border-bottom: unset;
    padding: 20px;
  }

  .board-list {
    display: none;
  }

  .new-task-btn {
    display: none;
  }

  .logo-mobile {
    display: block;
  }

  .plus-btn {
    display: block;
  }

  .columns {
    width: 100%;
    align-items: center;
  }

  main {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 16px;
  }

  .dot {
    height: 13px;
    width: 13px;
  }

  body.dark-theme .dark-logo-mobile {
    display: flex;
  }

  body.dark-theme .logo-mobile {
    display: none;
  }
}

/******** Mobile ********/
@media screen and (max-width: 376px) {
  .modal input,
  .modal textarea,
  .modal select {
    font-size: 13.5px;
  }

  * {
    font-size: 15px;
  }

  main {
    grid-template-columns: minmax(0, 380px);
    gap: 20px;
  }

  .task-btn {
    flex-direction: column;
  }

  .view-btn {
    width: 100%;
  }

  body.dark-theme .dark-logo-mobile {
    display: flex;
  }

  body.dark-theme .logo-mobile {
    display: none;
  }

  .mobile-nav-backdrop {
    justify-content: center;
    align-items: center;
  }

  .mobile-nav-modal {
    width: 90%;
    left: unset;
  }
}
