/* light theme colourscheme */
:root {
  --background: #f8f9fa;
  --foreground: #212529;
  --cursor: #0d6efd;
  --cursor-text-color: #ffffff;
  --selection-background: #e9ecef;
  --selection-foreground: #495057;
  --black: #000000;
  --dark-grey: #6c757d;
  --red: #dc3545;
  --dark-red: #a71e2a;
  --green: #28a745;
  --dark-green: #1e7e34;
  --yellow: #ffc107;
  --dark-yellow: #d39e00;
  --blue: #0d6efd;
  --dark-blue: #0056b3;
  --magenta: #6f42c1;
  --dark-magenta: #5a32a3;
  --cyan: #17a2b8;
  --dark-cyan: #117a8b;
  --white: #ffffff;
  --dark-white: #f8f9fa;
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4cc9f0;
  --light-bg: #f9f9f9;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* light theme colourscheme */
:root.dark-mode {
  --background: #121212;
  --foreground: #e9ecef;
  --selection-background: #495057;
  --selection-foreground: #f8f9fa;
  --cursor: #0d6efd;
  --cursor-text-color: #000000;
  --black: #212529;
  --dark-grey: #495057;
  --red: #ea4343;
  --dark-red: #c82333;
  --green: #28a745;
  --dark-green: #1e7e34;
  --yellow: #ffc107;
  --dark-yellow: #d39e00;
  --blue: #6ea8fe;
  --dark-blue: #3d73c5;
  --magenta: #b19cd9;
  --dark-magenta: #9e7fcc;
  --cyan: #6edff6;
  --dark-cyan: #4bb5d7;
  --white: #1e1e1e;
  --dark-white: #2d2d2d;
  --primary: #4895ef;
  --secondary: #4361ee;
  --accent: #4cc9f0;
  --light-bg: #1e1e1e;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* styling for the all the properties */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
}

/* style the whole HTML tag ==> make everything in the middle */
html {
  max-width: 100%;
  margin: auto;
  scroll-behavior: smooth;
}

/* style the body tag */
body {
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  padding: 10px;
  min-height: 100vh;
}

/* style the all the section elements */
section {
  padding: 2rem 1.5rem;
}

/* style the header section */
header {
  text-align: center;
  padding: 0.2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 0.7rem;
  color: white;
}

/* style all the heading found on the page */
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  color: var(--foreground);
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

/* style the input and button element ( responsible for handling insertion of TODO items ) */
input:not([type="checkbox"]),
button {
  appearance: none;
  border: none;
  outline: none;
  background: none;
  cursor: initial;
  border-radius: var(--border-radius);
  font-size: 1.5rem;
  color: var(--foreground);
}

/* style the 'Material' icons provided by Google */
.material-icons,
.material-symbols-outlined {
  vertical-align: middle;
  font-size: 1.2rem;
  color: inherit;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 300,
    "GRAD" 0,
    "opsz" 24;
}

/* style our navigation bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.7rem;
  background-color: var(--white);
  border-bottom: 1px solid var(--selection-background);
}

/* create a custom 'hue' property */
@property --hue {
  /* user defined 'HSL' angle / degree */
  syntax: "<angle>";
  /* each element needs to have the 'hue' property added to it */
  inherits: false;
  /* if user does not provide a angle ==> default to '0' */
  initial-value: 0deg;
}

/* define a custom animation called `rgb-cycle` */
@keyframes rgb-cycle {
  /* initial state */
  from {
    --hue: 0deg;
  }
  /* final state */
  to {
    --hue: 360deg;
  }
}

/* styling for the main logo's heading */
.main-heading {
  /* define the intial colour of the text logo */
  color: var(--foreground);
  /* add a little "linear" animation to the 'color' property only */
  transition: color 1.5s ease-out;
}

/* when the cursor / pointer hovers above the text logo */
.main-heading:hover,
.main-heading:focus-visible {
  /* define the intial colour of the text logo */
  color: hsl(var(--hue), 100%, 75%);
  /* the actual animation that will cycle infinitely */
  animation: rgb-cycle 2s linear infinite;
  /* remove all the transition animation to smoothly display cycling */
  transition: none;
}

/* when the cursor is not hovering on the text logo */
.main-heading:hover:not(:active) {
  /* stop the animation even when not hovering */
  animation-play-state: running;
}

/* style of elements found inside the navigation bar */
.text-logo,
.theme-toggle-button {
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}

/* styling for the 'Toggle Theme' button */
.theme-toggle-button {
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  border: none;
  margin-right: 10px;
  font-size: 0.9rem;
}

.theme-toggle-button:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* add an infinite, always on RGB cycle to the user's name */
#username {
  /* define the intial colour of the text logo */
  color: hsl(var(--hue), 100%, 75%);
  /* the actual animation that will cycle infinitely */
  animation: rgb-cycle 2s linear infinite;
  /* change the font weight to be a little more bold */
  font-weight: 700;
}

/* style the section for the creation of the TODO */
.create-todo-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem;
  background-color: var(--white);
  border-radius: var(--border-radius);
  margin: 1.5rem;
  box-shadow: var(--card-shadow);
}

/* style the input element for the creation of TODO */
.create-todo-section input[type="text"] {
  display: block;
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: var(--border-radius);
  background-color: var(--light-bg);
  color: var(--foreground);
  border: 2px solid var(--selection-background);
  font-size: 1.1rem;
  transition: var(--transition);
}

.create-todo-section input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* style the categories / select element */
.create-todo-section .category-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

/* style the actual select element */
.create-todo-section select {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: var(--border-radius);
  background-color: var(--light-bg);
  color: var(--foreground);
  border: 2px solid var(--selection-background);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.create-todo-section select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* style the button responsible for adding TODO items */
.form-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  align-self: flex-start;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
  margin-top: 10px;
}

.form-submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.form-submit-button:active {
  transform: translateY(0);
}

.form-submit-button i {
  font-size: 1.1rem;
}

/* style the "custom" checkboxes */
input[type="checkbox"] {
  display: none;
}

/* style the actual custom circle checkbox */
.bubble-business {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--foreground);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  position: relative;
}

.bubble-business::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--green);
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
}

input:checked ~ .bubble-business {
  background-color: var(--green);
  border-color: var(--green);
}

input:checked ~ .bubble-business::after {
  opacity: 1;
}

/* style the whole container that displays the TODO items */
.todo-form-section #todo-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
}

/* custom animation called `fadeIn` */
@keyframes fadeIn {
  /* element starts out with '0' opacity */
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  /* then gradually shows itself */
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* style the individual items of the list */
.todo-form-section .list {
  display: flex;
  /* align-items: center; */
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  background-color: var(--white);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  animation: fadeIn 0.3s ease-out;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.todo-form-section .list:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

/* the actual invididual item for the label */
.todo-item label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex: 1;
}

/* styling the contents found inside the TODO item */
.todo-form-section .todo-content {
  flex: 1;
  min-width: 0;
  flex-basis: 75%;
  margin-bottom: 0.5rem;
}

/* style the "editing" part of the TODO item */
.todo-form-section .todo-content input {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  color: var(--foreground);
  font-size: 1.1rem;
  border: none;
  outline: none;
}

/* style each of the category display in TODO item */
.todo-category {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  background-color: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.todo-form-section .todo-action {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  flex-basis: 100%;
  justify-content: flex-end;
  margin: 0;
}

/* style the button inside the TODO items */
.todo-form-section .todo-action button {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* style the 'Edit' button specifically */
.todo-form-section .todo-action .todo-edit-button {
  background-color: var(--primary);
  color: white;
}

.todo-form-section .todo-action .todo-edit-button:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
}

/* style the 'Delete' button specifically */
.todo-form-section .todo-action .todo-delete-button {
  background-color: var(--red);
  color: white;
}

.todo-form-section .todo-action .todo-delete-button:hover {
  background-color: var(--dark-red);
  transform: translateY(-2px);
}

/* style the button when the TODO item has been checked off */
.todo-item input[type="checkbox"]:checked ~ .todo-content input {
  color: var(--dark-grey);
  text-decoration: line-through;
  opacity: 0.8;
}

.list.done {
  opacity: 0.85;
  background-color: var(--selection-background);
}

/* ------------- */
/* Mobile Phones */
/* ------------- */

/* ------------- */
/* Mobile Phones */
/* ------------- */

@media (max-width: 767px) {
  .todo-form-section .list {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
  }

  .todo-form-section .todo-content {
    flex-basis: 100%;
    margin-bottom: 0.5rem;
  }

  .todo-form-section .todo-action {
    flex-basis: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

/* ---------------- */
/* Desktop Monitors */

/* ------------- */
/* Mobile Phones */
/* ------------- */

@media (max-width: 767px) {
  .todo-form-section .list {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
  }

  .todo-form-section .todo-content {
    flex-basis: 100%;
    margin-bottom: 0.5rem;
  }

  .todo-form-section .todo-action {
    flex-basis: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

/* ---------------- */

/* change the width of the `html` page and padding of the `body` element */
@media (min-width: 768px) {
  html {
    max-width: 50%;
  }
  body {
    padding: 20px;
  }
}
