/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul {
  margin: 0;
}

/* Remove Default Padding */

ul {
  padding: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Icons */

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 200,
  'opsz' 48
}

/*** Main Styling ***/

:root {
  --border: 1px solid red;
  --light-grey: #b6b6b6;
  --super-light-grey: #f3f3f3;
  --dark-grey: #444444;
  --grey-highlight: #949494;
  --berry: #c44061;
  --high-priority: #ff5e00;
  --blue: #4b2ca8;
}

body {
  font-family: Calibri, Verdana, Geneva, Tahoma, sans-serif;
  background-color: rgb(220, 210, 255);
}

.btn {
  background: var(--light-grey);
  border-radius: .4rem;
  border: none;
}

.btn:hover {
  background: #949494;
  color: rgb(238, 238, 238);
  cursor: pointer;
}

/* Toolbar */

/* width */
::-webkit-scrollbar {
  width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
  background: var(--light-grey);
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--grey-highlight);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Header */

header nav h1 {
  text-align: center;
  margin-top: .5rem;
  font-size: 2rem;
}

/* Page Container */

.page-container {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.main-container {
  margin-top: 1rem;
}

/* Project */

.projects-container {
  width: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));  
  gap: 2rem;
}

.project {
  height: 150px;
  display: grid;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border-radius: 1rem;
  background: var(--light-grey);
  background: url('images/folder.svg') no-repeat center;
}

.project span {
  padding: 0.2rem 1rem;
  border-radius: 1rem;
  box-shadow: 3px 3px 7px rgb(80, 80, 80);
  background: white;
}

.new-project {
  background: url('images/new-folder.svg') no-repeat center;
}

/* Project Plus Button */

.button_plus {
  position: relative;
  width: 40px;
  height: 40px;
  background: #fff;
  cursor: pointer;
  border: 2px solid var(--light-grey);
}

.button_plus:after {
  content: '';
  position: absolute;
  transform: translate(-50%, -50%);
  height: 4px;
  width: 75%;
  background: var(--light-grey);
  top: 50%;
  left: 50%;
}

.button_plus:before {
  content: '';
  position: absolute; 
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--light-grey);
  height: 75%;
  width: 4px;
}

.new-project:hover .button_plus:before,
.new-project:hover .button_plus:after {
  background: #fff;
  transition: 0.2s;
}

.new-project:hover .button_plus {
  background-color: var(--dark-grey);
  border: 1px solid white;
  transition: 0.2s;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgb(55,55,55,.7);
}

.modal-main {
  max-height: 90%;
  max-width: 90%;
  min-width: 50vw;
  padding: 1rem;
  border-radius: .5rem;
  background: var(--berry);
}

@media (max-width: 900px) {
  .modal-main {
    width: 60%;
  }
}

@media (max-width: 760px) {
  .modal-main {
    width: 90%;
  }
}

.modal-main .close-btn {
  float: right;
  font-size: 1.75rem;
  cursor: pointer;
}

.modal-main form {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-main form * {
  margin-top: 1rem;
  display: block;
  text-align: center;
}

/* Form */

form * {
  font-size: 1.5rem;
}

form input[type=text] {
  padding: .2rem;
}

form input[type=text]:focus {
  box-shadow: 0 0 5px 5px rgb(80, 80, 80, 0.5);
  border: none;
  outline: none;
}

input,
select,
textarea {
  border-radius: .3rem;
  border: none;
  background-color: var(--super-light-grey);
}

/* Content Container */

.content-container {
  clear: both;
  margin-top: 2.3rem;
  margin-bottom: 1rem;
  padding: 1rem 1rem;
}

@media (max-width: 500px) {
  .content-container {
    padding: 0;
  }
}

/* New Project Content */

.new-project-content {
  padding: 2rem;
}

@media (max-width: 500px) {
  .new-project-content {
    padding: 2rem 1rem;
  }
}

/* Project Content */

.project-content {
  max-height: 100%;
}

.project-content > h1 {
  /* Project title */
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 2rem;
}

@media (max-width: 460px) {
  .project-content > h1 {
    font-size: 1.5rem;
  }
}

.project-content button {
  display: block;
  padding: .2rem 1rem;
  margin-bottom: .5rem;
  border-radius: .5rem;
  border: none;
  font-style: italic;
  cursor: pointer;
  background: var(--light-grey);
}

.project-content button:hover {
  background: var(--grey-highlight);
  color: var(--super-light-grey);
}

/* Menu */

.menu-container {
  position: relative;
  float: right;
  clear: both;
  padding-left: .3rem;
  z-index: 1;
}

.menu-container:hover .menu {
  display: block;
}

.menu-container:nth-last-child(2) .menu {
  /* Position last todo menu on overflow */
  top: -2.5rem;
}

.menu-container:first-child .menu {
  /* Position first todo menu on overlow (overides last if there's only 1) */
  top: 0;
}

.menu-toggle {
  float: right;
}

.menu-toggle::after {
  content: '\2807';
  font-size: 1.4rem;
  padding-left: .2rem;
  cursor: pointer;
}

@media (max-width: 460px) {
  .menu-toggle::after {
    /* font-size: 1.2rem; */
    font-size: 1.8rem;
  }
}

.project-menu-toggle {
  padding-top: .5rem;
}

@media (max-width: 500px) {
  .project-menu-toggle {
    padding-top: 0;
  }
}

.menu {
  display: none;
  position: absolute;
  width: 9rem;
  left: -145px;
  top: -.5rem;
  font-size: .9rem;
  box-shadow: 2px 2px 5px #646464c2;
}

.menu-item {
  padding: 0 .3rem;
  padding: .5rem;
  cursor: pointer;
  background: rgb(243, 191, 191);
}

.menu-item:hover {
  color: var(--blue);
  background: rgb(224, 168, 168);
}

.delete-item {
  position: relative;
  cursor: pointer;
  border-bottom: 1px solid var(--dark-grey);
}

.delete-item:active {
  background: red;
}

.delete-item:hover .delete-icon {
  color: #fa0e35;
}

.delete-item:active .delete-icon {
  color: var(--blue);
}

.delete-icon {
  float: right;
  margin-left: .7rem;
  color: #aa0000;
}

.complete-icon {
  float: right;
  color: green;
}

.complete-item:hover .complete-icon {
  color:rgb(0, 255, 55)
}

/* Todos */

.todos {
  min-height: 40vh;
  max-height: 55vh;
  overflow: auto;
}

.todo {
  display: flex;
  gap: 1rem;
  padding: 0 .3rem;
  align-items: center;
  border-bottom: 1px solid rgba(161, 161, 161, 0.4);
  cursor: pointer;
}

@media (max-width: 500px) {
  .todo {
    padding: 1rem .3rem;
  }
}

.todo-strikethrough {
  text-decoration: line-through;
  opacity: .5;
}

.todo :nth-child(2) {
  margin-left: auto;
  /* Pushes last 2 items in todo to the right */
}

.todo:hover {
  background: rgba(199, 199, 199, 0.3)
}

.todo h2 {
  font-size: 1.4rem;
}

@media (max-width: 460px) {
  .todo h2 {
    font-size: 1.2rem;
  }
}

.todo-priority {
  font-size: .95rem;
  padding: 0 .5rem;
  border-radius: .5rem;
  text-align: center;
  background: var(--light-grey);
}

@media (max-width: 460px) {
  .todo-priority {
    font-size: .8rem;
  }

  .todo-dueDate {
    font-size: .8rem;
  }
}

.todo .high {
  background: var(--high-priority);
}

.todo .med {
  background: rgb(252, 140, 76);
}

.todo .low {
  background: rgb(253, 196, 162);
}

/* Todo Content */

.todo-content {
  display: flex;
  gap: 1rem;
  flex-direction: column;
  align-items: center;
}

.todo-content * {
  padding: .3rem .5rem;
  text-align: center;
}

.todo-content .todo-title,
.todo-content .todo-description {
  align-self: stretch;
  border-radius: .3rem;
  border: 1px solid rgb(238, 238, 238, .2);
}

.todo-content .todo-title:hover,
.todo-content .todo-description:hover {
  border-radius: .3rem;
  background: rgb(238, 238, 238, .5);
}

.todo-description:empty:hover::after {
  content: "add a description";
  font-style: italic;
  font-size: .9rem;
  color: var(--dark-gray);
}

.todo-content .todo-description {
  max-height: 8rem;
  overflow: auto;
}

.todo-content .todo-title {
  max-height: 7rem;
  overflow: auto;
}

.todo-content .save-btn {
  padding: .5rem 1.3rem;
}

.todo-content .delete-icon {
  margin-top: 1rem;
  cursor: pointer;
  font-size: 2.5rem;
}

.todo-content .delete-icon:hover {
  color: #ca0000;
}

.todo-content .delete-icon:active {
  color: red;
}

/* Errors */

.error {
  font-size: .8rem;
  color: rgb(0, 255, 55);
  border: 1px solid rgb(0, 255, 55);
}



