/* ========================
   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-btn-color: #635fc7;
  --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 */
}

/* ================
   Sidebar Layout
================ */

#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 */
}

.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: var(--primary-btn-color);
  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 */
}

/* Targets the area behind the <dialog> when opened with showModal() */
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}
/* ========================
   Light & Dark theme
======================== */
/* Sidebar Layout */
.side-bar {
  display: flex;
  flex-direction: column; /* Allows the footer to be pushed down */
  width: 300px;
  height: 100vh;
  position: fixed;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--lines);
  padding-bottom: 32px;
}


/* Push the footer to the bottom left */
.sidebar-footer {
  margin-top: auto; 
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 24px;
}

/* Theme Toggle Styling */
.theme-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  background-color: var(--bg-color); /* Usually a slightly darker grey in dark mode */
  padding: 14px;
  border-radius: 6px;
}

/* The Switch (Slider) */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

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

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

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

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

/* LIGHT MODE (Default) */
:root {
  --bg-color: #F4F7FD;
  --text-color: #000112;
  --sidebar-bg: #FFFFFF;
}

/* DARK MODE overrides */
body.dark-mode {
  --bg-color: #20212C;
  --text-color: #FFFFFF;
  --sidebar-bg: #2B2C37;
}

/* IMPORTANT: Your elements must use the variables */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* 1. DEFINE THE THEME VARIABLES */
:root {
  --bg-main: #F4F7FD;
  --bg-sidebar: #FFFFFF;
  --bg-task: #FFFFFF;      /* Light task background */
  --text-main: #000112;    /* Dark words for light mode */
  --text-secondary: #828FA3;
  --lines: #E4EBFA;
}

body.dark-mode {
  --bg-main: #20212C;
  --bg-sidebar: #2B2C37;
  --bg-task: #2B2C37;      /* Dark task background */
  --text-main: #FFFFFF;    /* White words for dark mode */
  --text-secondary: #828FA3;
  --lines: #3E3F4E;
}

/* 2. APPLY TO ALL TEXT (The "Words turn white" fix) */
body, h1, h2, h3, h4, p, span, label {
  color: var(--text-main);
  transition: color 0.3s ease;
}

/* 3. APPLY TO TASK CARDS (The "Tasks turn dark" fix) */
.task-div {
  background-color: var(--bg-task);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Specific fix for the "Launch Career" header and sidebar text */
.header-board-name, .board-btn, #headline-sidepanel {
  color: var(--text-main);
}

/* 4. APPLY TO MAIN BACKGROUNDS */
body {
  background-color: var(--bg-main);
}

.side-bar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--lines);
}

/* 1. DEFINE THE THEME VARIABLES */
:root {
  --bg-main: #F4F7FD;
  --bg-sidebar: #FFFFFF;
  --bg-task: #FFFFFF;      /* Light task background */
  --text-main: #000112;    /* Dark words for light mode */
  --text-secondary: #828FA3;
  --lines: #E4EBFA;
}

body.dark-mode {
  --bg-main: #20212C;
  --bg-sidebar: #2B2C37;
  --bg-task: #2B2C37;      /* Dark task background */
  --text-main: #FFFFFF;    /* White words for dark mode */
  --text-secondary: #828FA3;
  --lines: #3E3F4E;
}

/* 2. APPLY TO ALL TEXT (The "Words turn white" fix) */
body, h1, h2, h3, h4, p, span, label {
  color: var(--text-main);
  transition: color 0.3s ease;
}

/* 3. APPLY TO TASK CARDS (The "Tasks turn dark" fix) */
.task-div {
  background-color: var(--bg-task);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Specific fix for the "Launch Career" header and sidebar text */
.header-board-name, .board-btn, #headline-sidepanel {
  color: var(--text-main);
}

/* 4. APPLY TO MAIN BACKGROUNDS */
body {
  background-color: var(--bg-main);
}

.side-bar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--lines);
}

/* ===============
   STRETCH GOALS
================ */

/* Update these in your styles.css */

.task-card-header {
  display: flex;
  justify-content: space-between; /* This pushes the dot to the far right */
  align-items: center;           /* Keeps them vertically centered */
  width: 100%;
  margin-bottom: 8px;
}

.task-title {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: var(--text-main);
  /* Ensures long titles don't squash the dot */
  padding-right: 12px; 
}

.priority-dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  flex-shrink: 0; /* Prevents the dot from getting squeezed */
}

/* Priority Colors */
.dot-low { background-color: #4CAF50; }
.dot-medium { background-color: #FF9800; }
.dot-high { background-color: #F44336; }
/* Priority Dot Base Styling */
.priority-dot {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-low { background-color: #4CAF50; }
.dot-medium { background-color: #FF9800; }
.dot-high { background-color: #F44336; }

/* Task Card Header Layout */
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
}

/* Modal Styling for Priority Select */
.priority-select {
  cursor: pointer;
  border: 1px solid var(--input-border);
  background-color: var(--bg-input);
  color: var(--text-main);
}
/* ===============
   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(--bg-sidebar);
  color: var(--text-main);
  height: 96px;
  padding: 0 35px 0 30px;
  border-bottom: 1px solid var(--lines);
  width: 100%;
  font-size: 1.875rem;
  font-weight: 600;
}

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

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

/* ===============
   Sidebar Button Feature
================ */

/* Sidebar default state */
.side-bar {
  width: 300px;
  position: fixed;
  left: 0;
  height: 100vh;
  transition: transform 0.3s ease; /* Smooth sliding */
  z-index: 10;
}

/* Main Layout default state */
#layout {
  margin-left: 300px;
  transition: margin-left 0.3s ease;
}

/* ===============================
   Sidebar Hidden / Shown States
================================ */

/* Slide sidebar off-screen when hidden */
.sidebar-hidden .side-bar {
  transform: translateX(-100%);
}

/* Expand main content to fill full width when sidebar is gone */
.sidebar-hidden #layout {
  margin-left: 0;
}

/* ===============================
   Show Sidebar Eye Button
================================ */

/* Hidden by default — only appears when .sidebar-hidden is on <body> */
.show-sidebar-btn {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 0;
  z-index: 999;
  background-color: #635fc7;
  border: none;
  border-radius: 0 100px 100px 0;
  padding: 14px 20px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, padding-right 0.2s ease;
}

.show-sidebar-btn:hover {
  background-color: #a8a4ff;
  padding-right: 28px;
}

/* Reveal when sidebar is hidden */
.sidebar-hidden .show-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===============================
   Hide Sidebar Button (in nav)
================================ */

.hide-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 15px;
  background: none;
  border: none;
  color: #828fa3;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  padding: 15px 25px;
  transition: color 0.2s ease;
}

.hide-sidebar-btn:hover {
  color: #635fc7;
}

/* ===============
   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(--bg-sidebar);
  color: var(--text-main);
  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 */
dialog {
  position: fixed;

  border: none;
  padding: 0;
  margin: 0;
  background: none;
}

/* Style the modal box */


#task-modal {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -40%);
  border-radius: 8px;
  width: 90%;
  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;*/
}

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

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

.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;
}

/* Form elements */
form label {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  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;
}

#add-new-task-btn {
  background-color: var(--primary-btn-color);
  color: white;
  border-radius: 30px;
  border: 0;
  font-size: 16px;
  padding: 18px;
  padding-left: 35px;
  padding-right: 35px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 20px;
}

/* New Task Modal Window */

.modal-window {
  /* border: 5px solid red; */
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
  background-color: var(--primary-color);
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;

  z-index: 3;
  transition: all 0.3s ease-in;
}

.submit-btn {
  background-color: var(--primary-btn-color);
  color: white;
  border-radius: 30px;
  border: 0;
  font-size: 16px;
  padding: 14px;
  padding-left: 35px;
  padding-right: 35px;
  font-weight: 600;
  cursor: pointer;
  flex-grow: 1;
  margin: 5px 0;
}

/* Edit modal button group */
.edit-button-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Save Changes button — matches Create Task purple */
.edit-button-group .primary-btn {
  flex: 1;
  background-color: var(--primary-btn-color);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 14px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.edit-button-group .primary-btn:hover {
  background-color: #a8a4ff;
}

/* Delete Task button — red */
.delete-btn {
  flex: 1;
  background-color: #ea5555;
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 14px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.delete-btn:hover {
  background-color: #ff9898;
}

textarea {
  font-size: 16px;
  color: black;
  height: 90px;
  padding: 10px;
  border-radius: 4px;
  resize: vertical;
}

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

/******** Tablets ********/
@media screen and (max-width: 1023px) {
  #layout {
    margin-left: 0 !important; /* Reset sidebar push on smaller screens */
  }

  .side-bar {
    display: none; /* Hide sidebar on tablets and smaller */
  }

  .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;
  }

  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;
  }

  #add-new-task-btn {
    font-size: 0;
    padding: 12px;
  }

  #add-new-task-btn::before {
    content: "+";
    font-size: 18px;
    font-weight: 800;
    padding-left: 14px;
    padding-right: 14px;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Stack edit modal buttons vertically, full width */
  .edit-button-group {
    flex-direction: column;
    gap: 10px;
  }

  .edit-button-group .primary-btn,
  .delete-btn {
    width: 100%;
    text-align: center;
  }
}