/* ========================
   Global & Root Variables
======================== */
* {
  box-sizing: border-box; /* Ensures padding and border are included in total element size */
}

:root {
  --primary-color: #ffffff;
  --secondary-color: #f4f7fd;
  --primary-font-color: #000000;
  --secondary-font-color: #828fa3;
  --primary-box-shadow: 0px 4px 6px rgba(54, 78, 126, 0.1015); /* Subtle shadow for card depth */
  --sidebar-width: 300px; /* Sidebar fixed width */
}

/* ================
   Base Elements
================ */
body {
  font-family: "Plus Jakarta Sans", sans-serif;
  display: flex; /* Allow layout to span horizontally */
  flex-direction: row;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  background-color: var(--secondary-color);
  font-size: 1rem; /* Base font size for rem scaling */
  z-index: 1;
}

/* ================
   Loading Indicator
================ */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1001; /* Above modals and backdrop */
  box-shadow: var(--primary-box-shadow);
}

.dark .loading-indicator {
  background: rgba(43, 44, 55, 0.95); /* Matches .dark .task-modal */
  color: #ffffff;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--secondary-font-color);
  border-top: 4px solid #635fc7; /* Matches your primary button color */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.dark .spinner {
  border: 4px solid #828fa3;
  border-top: 4px solid #a8a4ff; /* Lighter shade for dark mode */
}

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

.loading-indicator p {
  margin-top: 10px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary-font-color);
}

.dark .loading-indicator p {
  color: #ffffff;
}

/* ================
   Sidebar Layout
================ */
.side-bar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--primary-color);
  border-right: 1px solid #e4ebfa; /* Light divider */
  width: var(--sidebar-width);
  height: 100vh;
}

.hidden {
  display: none;
}


.show-side-bar {
  position: fixed;
  background-color: #A8A4FF;
  border: none;
  bottom: 20px;
  width: 56px;
  height: 48px;
  border-radius: 0 100px 100px 0;
}

#side-logo-div {
  margin: 33px 113px 54px 34px; /* Spacing around logo */
  display: flex;
  justify-content: flex-start;
}

#logo {
  width: 100%; /* Make logo responsive within container */
}

#dark-logo {
  display: none;
}

.boards-nav-links-div {
  display: flex;
  flex-direction: column;
  color: var(--primary-font-color);
}

#headline-sidepanel {
  padding: 0 12px 0 50px; /* Aligns section content from left and right */
}

h4 {
  color: var(--secondary-font-color);
  font-size: 0.75rem;
  letter-spacing: 0.125rem; /* Makes heading more spaced */
}

.board-btn {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px; /* Space between icon and text */
  background-color: #635fc7;
  color: #fff;
  border: none;
  border-radius: 0 100px 100px 0; /* Pill shape only on right side */
  height: 48px;
  width: 276px;
  padding: 28px 12px 28px 50px;
  font-size: 0.9375rem;
  font-weight: bold;
  cursor: pointer;
  overflow: hidden; /* Prevents overflowed text/icons from showing */
}

.mode-hide {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  gap: 14px;
}

.mode-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 251px;
  height: 48px;
  background-color: #F4F7FD;
  border-radius: 6px;
  border-width: 0px;
  margin-left: 24.5px;  
}

.hide-sidebar {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 30px; /* Space between icon and text */
  background-color: #F4F7FD;
  color: #635FC7;
  border: none;
  border-radius: 0 100px 100px 0; /* Pill shape only on right side */
  height: 48px;
  width: 276px;
  padding: 28px 12px 28px 50px;
  font-size: 0.9375rem;
  font-weight: bold;
  cursor: pointer;
  overflow: hidden; 
  margin: 0px 0px 15px 0px;
}

.moon-icon {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.switch-align {
  display: flex;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-top: 2px;
  margin-left: 20px;
  margin-right: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 4px;
  top: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

input:checked + .slider {
  background-color: #20212C;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ===============
   Main Layout
================ */
#layout {
  flex: 1; /* Fills remaining space beside sidebar */
  overflow-x: hidden; /* Prevent horizontal scroll */
  width: 100%;
}

/* ===============
   Header Section
================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--primary-color);
  color: var(--primary-font-color);
  height: 96px;
  padding: 35px 35px 35px 30px;
  border-bottom: 1px solid #e4ebfa;
  width: 100%;
  font-size: 1.875rem;
  font-weight: 600;
}

.header-name-div {
  display: flex;
  align-items: center;
}

#add-task-btn {
    background-color: #635FC7;
    color: white;
    cursor: pointer;
    border: none;
    width: 164px;
    height: 48px;
    font-size: 15px;
    border-radius:  100px 100px 100px;
}

.logo-mobile {
  display: none; /* Hidden on desktop; shown on smaller screens */
}

.logo-dark-mobile {
  display: none;
}
/* ===============
   Board Columns
================ */
.container {
  display: flex;
  flex-direction: column;
  padding-left: 35px;
  box-sizing: border-box;
}

.card-column-main {
  display: grid;
  grid-template-columns: repeat(
    3,
    minmax(0, 304px)
  ); /* 3 columns with min size */
  gap: 8px; /* Space between columns */
}

.column-div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px;
}

.column-head-div {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between dot and column title */
}

.columnHeader {
  font-size: 0.75rem;
  letter-spacing: 0.125rem;
  color: var(--secondary-font-color);
  margin: 0;
}

/* Status Dots */
.dot {
  height: 15px;
  width: 15px;
  border-radius: 50%; /* Make it circular */
  display: inline-block;
}

#todo-dot {
  background-color: #49c4e5;
}

#doing-dot {
  background-color: #8471f2;
}

#done-dot {
  background-color: #219c90;
}

/* ===============
   Task Cards
================ */
.tasks-container {
  display: flex;
  flex-direction: column;
}

.task-div {
  display: flex;
  align-items: center;
  padding-left: 15px;
  width: 100%;
  height: 60px;
  background-color: var(--primary-color);
  color: var(--primary-font-color);
  border-radius: 12px;
  box-shadow: var(--primary-box-shadow);
  cursor: pointer; /* Indicate it's clickable */
  margin-bottom: 20px;
  font-size: 0.9375rem;
  font-weight: bold;
}


/* ===============
   Headings
================ */
h2 {
  font-size: 1.5rem;
  margin: 0;
}

/* ===============
   Modal Styles
================ */
/* Remove default dialog styles */
 .task-modal {
  position: fixed;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
}

.new-task-modal {
  position: fixed;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
}

/* Style the modal box */
#task-modal::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

#task-modal {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -40%);
  border-radius: 8px;
  width: 479px;
  height: 479px;
  max-width: 600px;
  padding: 24px;
  background-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  /*font-family: "Plus Jakarta Sans", sans-serif;*/
}

.dark #task-modal {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -40%);
  border-radius: 8px;
  width: 479px;
  height: 479px;
  max-width: 600px;
  padding: 24px;
  background-color: #2B2C37;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.dark .modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: #FFFFFF;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  color: #ea5555;
  transition: transform 0.2s ease-in-out, font-weight 0.2s ease-in-out;
  transition-delay: 0.1s; /* Delay before scaling */
}

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

.close-btn:focus {
  outline: none;
}

.task-btns {
  display: flex;
  justify-content: space-between;
  padding-top: 30px;
}

.save-changes-btn {
  background-color: #635FC7;
  border: none;
  font-size: 13px;
  color: #ffffff;
  width: 200px;
  height: 40px;
  border-radius:  100px 100px 100px;
}

.delete-task-btn {
  background-color: #EA5555;
  border: none;
  font-size: 13px;
  color: #ffffff;
  width: 200px;
  height: 40px;
  border-radius:  100px 100px 100px; 
}

.dark #task-status {
  color: #ffffff;
}

.dark .status-col {
  color: #000000;
}

/* New task modal */

#custom-backdrop {
  display: none; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3); 
  z-index: 999; 
}


#new-task-modal {
  display: none; 
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -40%);
  border-radius: 8px;
  width: 479px;
  height: 479px;
  max-width: 600px;
  padding: 24px;
  background-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  /*font-family: "Plus Jakarta Sans", sans-serif;*/
  z-index: 1000;
}

.dark #new-task-modal {
  display: none; 
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -40%);
  border-radius: 8px;
  width: 479px;
  height: 479px;
  max-width: 600px;
  padding: 24px;
  background-color: #2B2C37;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  /*font-family: "Plus Jakarta Sans", sans-serif;*/
  z-index: 1000;
}

.new-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dark .new-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: #ffffff;
}

.new-close-btn {
  background: none;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  color: #ea5555;
  transition: transform 0.2s ease-in-out, font-weight 0.2s ease-in-out;
  transition-delay: 0.1s; /* Delay before scaling */
}

.new-close-btn:hover {
  transform: scale(1.15);
  font-weight: 600;
}

.new-close-btn:focus {
  outline: none;
}

.create-task-btn {
  background-color: #635FC7;
  border: none;
  font-size: 13px;
  color: #ffffff;
  margin-top: 30px;
  width: 425px;
  height: 40px;
  border-radius:  100px 100px 100px;
}

.dark #new-task-status {
  color: #ffffff;
}

.dark .status-col {
  color: #000000;
}

/* Form elements */
form label {
  display: block;
  font-weight: 600;
  font-size: 0.75em;
  margin-top: 12px;
  margin-bottom: 4px;
  color: #828fa3;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #828fa3;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8125em;
  resize: vertical;
}

form select {
  appearance: none; /* Remove native arrow */
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="%23828FA3" stroke-width="3" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"/></svg>')
    no-repeat right 0.75rem center;

  background-size: 1.4rem;
  padding-right: 1rem;
}


/* ========================
   Mobile view side-panel modal
======================== */


.mobile-modal-light {
  position: fixed;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
}

.mobile-modal-light {
  width: 340px;
  height: 200px;
  background-color: #FFFFFF;
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -40%);
  border-radius: 8px;
  max-width: 600px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  /*font-family: "Plus Jakarta Sans", sans-serif;*/
  z-index: 1000;
}

.dark .mobile-modal-light {
  background-color: #3E3F4E;
}

#mobile-modal-light::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

.mobile-modal-header {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.text {
  font: inherit;
  margin-left: 25px;
  font-size: 12px;
  color: #828FA3;
  letter-spacing: 2.4px;
}

.board-btn-modal {
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* Space between icon and text */
  background-color: #635fc7;
  color: #fff;
  border: none;
  border-radius: 0 100px 100px 0; /* Pill shape only on right side */
  height: 48px;
  width: 293px;
  padding: 28px 12px 28px ;
  font-size: 0.9375rem;
  font-weight: bold;
  cursor: pointer;
  overflow: hidden; 
}

.mobile-mode-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 260px;
  height: 48px;
  background-color: #F4F7FD;
  border-radius: 6px;
  border-width: 0px;
  margin-left: 40px;
  margin-top: 25px;
}

.dark .mobile-mode-toggle {
  background-color: #635FC7;
}

.close-btn-mobile {
  background: none;
  border: none;
  margin-left: 140px;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  color: #ea5555;
  transition: transform 0.2s ease-in-out, font-weight 0.2s ease-in-out;
  transition-delay: 0.1s; /* Delay before scaling */
}

.close-btn-mobile:hover {
  transform: scale(1.15);
  font-weight: 600;
}

.close-btn-mobile:focus {
  outline: none;
}

/* ========================
   Responsive Styles
======================== */

/******** Tablets ********/
@media screen and (max-width: 1023px) {
  .side-bar {
    display: none; /* Hide sidebar on tablets and smaller */
  }

  .show-side-bar {
    display: none;
  }

  .side-bar.show-sidebar {
    display: flex !important;
    position: fixed; /* Overlay on top of page */
    height: auto;
  }

  #side-logo-div {
    display: none;
  }

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

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

  body {
    font-size: 0.8rem;
  }

  .board-btn {
    font-size: 0.8rem;
    padding-left: 15px;
    margin-right: 15px;
    font-weight: 700;
  }

  .container {
    padding: 0;
    width: 100%;
    align-items: center; /* Center columns on smaller screens */
  }

  .card-column-main {
    grid-template-columns: repeat(2, minmax(0, 360px));
    gap: 8px;
  }

  header {
    height: 64px;
    padding: 0 10px 0 18px;
    border: none;
  }

  #header-board-name {
    font-size: 1rem;
  }

  .task-div {
    width: 100%;
  }

  .columnHeader {
    font-size: 0.75rem;
  }

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

  .column-head-div {
    gap: 8px;
  }

  .column-div {
    width: 100%;
  }
}

/******** Mobile ********/
@media screen and (max-width: 576px) {
  .card-column-main {
    grid-template-columns: minmax(
      0,
      380px
    ); /* Stack columns in single column */
  }

  .column-div {
    padding: 24px;
  }

  .show-side-bar {
    display: none;
  }

  .header-board-name {
    display: none;
  }
  #add-task-btn span {
    display: none;
  }
  
  .dark .logo-dark-mobile {
    display: block;
  }

  #add-task-btn {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    margin-right: 18px;
  }

  #task-modal {
    width: 343px;
    height: 532px;
  }

  .dark #task-modal {
    width: 343px;
    height: 532px;
  }
  .task-btns {
    display: grid;
  }

  .save-changes-btn {
    width: 300px;
    margin-bottom: 15px;
  }

  .delete-task-btn {
    width: 300px;
  }

  #new-task-modal {
    width: 343px;
    height: 532px;
  }

  .dark #new-task-modal {
    width: 343px;
    height: 532px;
  }

  button.create-task-btn {
    width: 295px;
  }
}

/* Dark mode settings */

  body.dark {
    background-color: #20212C;
  }

  .dark #logo {
    display: none;
  }

  .dark #dark-logo {
    display: block;
    width: 100%;
  }

  .dark .sticky-header {
    background-color: #2B2C37;
  }

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

  .dark .header-board-name {
    color: #FFFFFF;
  }

  .dark .mode-toggle {
    background-color: #635FC7;
  }

  .dark .hide-sidebar {
    background-color: #635FC7;
    color: #FFFFFF;
  }

  .dark .task-div {
    background-color: #2B2C37;
    color: #FFFFFF;
  }

  .dark .side-bar {
    background-color: #2B2C37;
  }
