/* =========================
   Global
========================= */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at top, #1e1e2e, #0f0f17);
  color: #eaeaf0;
}

/* =========================
   Top (Clock / Date)
========================= */
.top {
  padding: 32px;
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.large {
  font-size: 2rem;
  font-weight: 500;
}

.clock {
  font-weight: 700;
}

/* =========================
   Center Search
========================= */
.centered {
  display: flex;
  justify-content: center;
  margin-top: 10vh;
}

#searchbar {
  width: 420px;
  max-width: 80%;
  padding: 14px 18px;
  font-size: 18px;
  border-radius: 14px;
  border: none;
  outline: none;
  background: #1b1b2b;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#searchbar::placeholder {
  color: #888;
}

#searchbar:focus {
  box-shadow: 0 0 0 2px #6c6cff55, 0 10px 30px rgba(0,0,0,0.5);
}

/* =========================
   Speed Dial (Center)
========================= */
.undercentered {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.speeddial {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.speeddialbutton {
  width: 72px;
  height: 72px;
  background: #1b1b2b;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}

.speeddialbutton:hover {
  transform: translateY(-4px);
  background: #24243a;
}

.speeddialbutton img {
  width: 32px;
  height: 32px;
}

.speeddialbutton p {
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.8;
  text-align: center;
}

/* Add button */
.speeddialbutton.add {
  background: transparent;
  border: 2px dashed #3a3a5a;
}

.speeddialbutton.add:hover {
  background: #24243a;
  border-style: solid;
}

/* Speed dial delete */
.speeddialbutton .delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
}

.speeddialbutton:hover .delete {
  opacity: 1;
}

/* =========================
   Notes (Aside)
========================= */
aside {
  position: fixed;
  left: 24px;
  top: 120px;
  width: 260px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 6px;

  scrollbar-width: thin;
  scrollbar-color: #3a3a5a transparent;
}

aside::-webkit-scrollbar {
  width: 6px;
}

aside::-webkit-scrollbar-thumb {
  background: #3a3a5a;
  border-radius: 10px;
}

.notebox {
  width: 100%;
  height: 180px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  resize: none;
  outline: none;
  background: #1b1b2b;
  color: #fff;
}

.notebox::placeholder {
  color: #777;
}

.notebox:focus {
  box-shadow: 0 0 0 2px #6c6cff33;
}

/* Note actions */
.note-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.note-actions button {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: #2a2a40;
  color: #fff;
}

.note-actions button:hover {
  background: #343456;
}

.note-actions.danger button {
  background: #402a2a;
}

.note-actions.danger button:hover {
  background: #5a3434;
}

/* Notes list */
#notesContainer {
  margin-top: 16px;
}

.note {
  background: #1b1b2b;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.note p {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
}

/* Note delete button */
.note .delete-note {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  margin: 0;

  border-radius: 50%;
  border: none;
  background: #2a2a40;
  color: #fff;

  font-size: 18px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;

  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.note:hover .delete-note {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.note .delete-note:hover {
  background: #5a3434;
}

/* =========================
   Right Aside
========================= */
.rightaside {
  position: fixed;
  right: 24px;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================
   Global Button Safety
========================= */
button {
  font-family: inherit;
}

/* =========================
   Small Screens
========================= */
@media (max-width: 800px) {
  aside,
  .rightaside {
    display: none;
  }

  #searchbar {
    width: 90%;
  }
}
