:root {
  --background-primary: #f4f6f8;
  --background-note: #ffffff;
  --text-header: #007aff;
  --text-main: #1d1d1f;
  --text-sub: #636366;
  /* --accent-color: #8fc5ff; */
  --accent-color: #b5d9ff;
  --border-color: #d1d1d6;
  --border-active-color: #007aff;

  --dark-background-primary: #121212;
  --dark-background-note: #1e1e1e;
  --dark-text-header: #0a84ff;
  --dark-text-main: #ededed;
  --dark-text-sub: #8a8a8e;
  --dark-accent-color: #0464c4;
  --dark-border-color: #3a3a3c;
  --dark-border-active-color: #0754a1;

  --warn-color: #ff3b30;

  /* NEUE LIQUID GLASS VARS */
  --glass-blur: 20px; /* Stärke der Unschärfe für Sidebar */
  --glass-header-blur: 10px; /* Leichtere Unschärfe für sticky Header */
  --glass-bg-opacity-light: 0.8; /* Deckkraft des Glass-Hintergrunds Light Mode */
  --glass-bg-opacity-dark: 0.2; /* Deckkraft des Glass-Hintergrunds Dark Mode */
  --glass-border-color: rgba(255, 255, 255, 0.1);

  scroll-behavior: smooth;
  font-family: Roboto, Arial, Tahoma;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--background-primary);
  color: var(--text-main);
}

main {
  display: flex;
}

.left-side {
  width: 400px;
  height: 100lvh;
  padding: 1rem;
  overflow: auto;

  background-color: rgba(244, 246, 248, var(--glass-bg-opacity-light));
  border-right: 1px solid var(--glass-border-color); /* Subtile Glas-Linie */
  backdrop-filter: blur(var(--glass-blur));
}

.side-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 0 1rem 0;

  background-color: rgba(244, 246, 248, 0.9);
  backdrop-filter: blur(var(--glass-header-blur));
}

.new-note-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  color: white;
  font-size: 1rem;

  background: linear-gradient(145deg, var(--accent-color) 0%, #0060c0 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

  padding: 1rem;
  margin: 0.5rem 0rem;
}

.new-note-button:hover {
  /* filter: brightness(0.8); */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.new-note-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

svg {
  width: 24px;
  height: 24px;
  padding: 0.3rem;
}

.new-note-button svg {
  width: 30px;
  height: 30px;
  padding: 0 0.5rem 0 0;
}

.side-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: var(--background-note);
  border: 0.5px solid var(--glass-border-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  padding: 0.75rem;
  margin: 0.5rem 0rem;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.side-card:hover {
  filter: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.side-card:not(.side-card-active) {
  cursor: pointer;
}

.side-card-active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--dark-background-primary);
  cursor: default;
  box-shadow: 0 0 15px rgba(0, 122, 255, 0.5);
}

.side-card-active:hover {
  filter: none;
  transform: none;
  box-shadow: 0 0 15px rgba(0, 122, 255, 0.5);
}

.side-card-active p,
.side-card-active .time {
  color: var(--dark-background-primary);
}

.side-card h2 {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.side-card p {
  color: var(--text-sub);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.time {
  display: flex;
  justify-content: right;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-sub);
  text-align: right;
  font-style: italic;
}

.right-side {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 1rem;
  gap: 1rem;
}

.note-header {
  display: flex;
  width: 100%;
  gap: 0.5rem;
}

#input-note-header {
  font-size: 3rem;
  font-weight: 700;
  width: 100%;
  border: none;
  color: var(--text-header);
  background-color: var(--background-primary);
}

#input-note-header:focus {
  outline: none;
}

.button-option {
  border: none;
  background-color: var(--background-primary);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.button-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
  filter: brightness(1.1);
}

.button-option svg {
  height: 40px;
  width: 40px;
  padding: 0.3rem;
}

.button-option:hover svg {
  stroke: var(--accent-color);
  fill: var(--accent-color);
  transition: all 0.25s ease-in-out;
}

.button-option svg:hover {
  filter: brightness(0.8);
}

.button-mini {
  display: inline-block;
  background-color: transparent;
  border: none;
  vertical-align: bottom;
}

.button-mini svg {
  height: 24px;
  width: 24px;
  display: inline-block;
  background-color: transparent;
  border: none;
  vertical-align: bottom;
}

.delete-all-notes:hover svg {
  stroke: var(--warn-color);
  filter: brightness(1.2);
}

.note-body {
  width: 100%;
  height: 80lvh;
}

#input-note-body {
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
  border: none;
  background-color: var(--background-primary);
  color: var(--text-main);
}

#input-note-header::placeholder,
#input-note-body::placeholder {
  color: var(--text-sub);
}

#input-note-body:focus {
  outline: none;
}

textarea {
  resize: none;
}

#bottom {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.mode-toggle {
  border: none;
  padding: 4px;
  width: 72px;
  border-radius: 20px;
  cursor: pointer;
  position: relative;
}

body[data-theme="light"] .mode-toggle {
  /* background: linear-gradient(90deg, #ff9500 0%, #ffc700 100%); */
  background: linear-gradient(90deg, #ffd60a 0%, #ff9f0a 100%);
}

body[data-theme="dark"] .mode-toggle {
  /* background: linear-gradient(90deg, #1c305e 0%, #475b8b 100%); */
  background: linear-gradient(90deg, #0a7eff 0%, #47afff 100%);
}

.mode-toggle > span {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 100%;
  background-color: #0b2342;
  box-shadow: 0px 1px 1px rgba(3, 7, 18, 0.06), 0px 2px 5px rgba(3, 7, 18, 0.12),
    0px 5px 12px rgba(3, 7, 18, 0.18), 0px 10px 20px rgba(3, 7, 18, 0.24),
    0px 15px 32px rgba(3, 7, 18, 0.3);
  left: 0;
  transition: all 300ms ease-in-out;
}

body[data-theme="light"] .mode-toggle > span {
  background-color: white;
  left: 100%;
  transform: translateX(-100%);
}

.mode-toggle > span > svg {
  height: 24px;
  width: 24px;
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 0;
  transition: all 300ms ease-in-out;
}

body[data-theme="dark"] .mode-toggle > span > .sun-icon {
  opacity: 0;
}

body[data-theme="dark"] .mode-toggle > span > .moon-icon {
  opacity: 1;
}

body[data-theme="light"] .mode-toggle > span > .sun-icon {
  opacity: 1;
  transform: rotate(60deg);
}

body[data-theme="light"] .mode-toggle > span > .moon-icon {
  opacity: 0;
  transform: rotate(60deg);
}

body[data-theme="dark"] {
  background-color: var(--dark-background-primary);
  color: var(--dark-text-main);

  --background-primary: var(--dark-background-primary);
  --background-note: var(--dark-background-note);
  --text-header: var(--dark-text-header);
  --text-main: var(--dark-text-main);
  --text-sub: var(--dark-text-sub);
  --accent-color: var(--dark-accent-color);
  --border-color: var(--dark-border-color);

  --glass-border-color: rgba(60, 60, 60, 0.5);
}

body[data-theme="dark"] .left-side {
  background-color: rgba(18, 18, 18, var(--glass-bg-opacity-dark));
}

body[data-theme="dark"] .side-header {
  background-color: rgba(18, 18, 18, 0.4);
}

@media (max-width: 900px) {
  .new-note-button svg {
    width: 20px;
    height: 20px;
    padding: 0 0.2rem 0 0;
  }

  .button-option svg {
    height: 32px;
    width: 32px;
  }

  .left-side {
    width: 300px;
    height: 100lvh;
    padding: 0.3rem;
  }

  .new-note-button {
    font-size: 1rem;
    padding: 0.3rem;
  }

  .side-card {
    font-size: 0.7rem;
    padding: 0.3rem;
    margin: 0.3rem 0rem;
    gap: 0.3rem;
  }

  .time {
    font-size: 0.7rem;
  }

  .right-side {
    padding: 0.3rem;
    gap: 0.3rem;
  }

  .note-header {
    gap: 0.3rem;
  }

  #input-note-header {
    font-size: 1.25rem;
    font-weight: 600;
  }

  #input-note-body {
    font-size: 0.9rem;
  }
}
