:root {
  --bg: #fcfcfc;
  --text-color: #333;
  --primary-yellow: #e2ac2e;
  --primary-cyan: #60e9c4;
  --primary-blue: #073b4c;
  --icon-color: #333;
  --shadow-color: #dfd8d8;
  --border: rgb(190, 169, 169);
}

html[data-theme='dark'] {
  --bg: rgb(26, 24, 24);
  --text-color: #fcfcfc;
  --icon-color: #fcfcfc;
  --shadow-color: #222121;
  --border: #685d5d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  transition: color, border-color, background-color 0.2s ease-in;
}

body {
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text-color);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  padding: 0.6em 0;
  background-color: var(--bg);
  box-shadow: 0 0 10px 0 var(--shadow-color);
}

.flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

header h1 {
  font-weight: 400;
}

.search {
  display: flex;
  margin: 1em 0;
  padding: 0.5em;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.search .icon {
  color: var(--border);
}

input {
  margin-left: 0.5em;
  width: 100%;
  border: none;
  background-color: transparent;
  outline: none;
  color: var(--text-color);
  font-size: 1em;
}

.note {
  background-color: var(--primary-yellow);
  padding: 1em;
  min-height: 180px;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  border-radius: 4px;
  white-space: pre-wrap;
}

.note-footer {
  margin-top: 1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notes-list {
  margin: 1em auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 1em;
}

textarea {
  flex-grow: 1;
  background-color: var(--primary-cyan);
  border: none;
  outline: none;
  resize: vertical;
  font-size: 1em;
}

.add-note {
  background-color: var(--primary-cyan);
  font-size: 1em;
}

.icon {
  font-size: 1.5em;
}

.delete-icon {
  cursor: pointer;
}

.theme-icon {
  color: var(--icon-color);
  font-size: 1.5em;
}

.delete-icon:hover {
  color: rgb(245, 32, 32);
  transform: scale(1.2);
}

button {
  background-color: transparent;
  border: none;
  padding: 0.5em;
  cursor: pointer;
}

.btn {
  background-color: var(--primary-blue);
  color: #fff;
  padding: 0.5em 1em;
  border: none;
  outline: none;
  line-height: 1;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

.loader {
  margin: 1em 0;
  border: 5px solid #fff; /* Light grey */
  border-top: 5px solid #1c1c1d; /* Blue */
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.5s linear infinite;
}

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

@media screen and (min-width: 480px) {
  .notes-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 768px) {
  .notes-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (min-width: 1080px) {
  .notes-list {
    grid-template-columns: repeat(4, 1fr);
  }
}
