@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

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

:root {
    --brand-color: #8b90ff;
    --base-color: #f2f4f8;
    --surface-color: #fff;
    --text-color: #191b23;
    --secondary-text-color: #3c404f;
    --base-transparent-70: rgba(240, 240, 240, 0.7);
    --base-transparent-100: rgba(240, 240, 240, 1);
}

.dark-theme {
  --brand-color: #8b90ff;
  --base-color: #1e1f26;
  --surface-color: #2c2f38;
  --text-color: #f0f0f0;
  --secondary-text-color: #b0b3c0;
  --base-transparent-70: rgba(30, 31, 38, 0.7);
  --base-transparent-100: rgba(30, 31, 38, 1);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 2rem;
    background: var(--base-color);
    color: var(--text-color);
}

button, input, textarea {
    font: inherit;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    margin: 0 0 1rem 0;
}

.add-note-btn {
    background-color: var(--brand-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 5px;
}

.add-note-btn:hover {
    background-color: #7a7dfc;
}

.add-note-btn:active {
    background-color: #6a6dfc;
}

.theme-toggle-btn {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--surface-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--secondary-text-color);
    transition: all 0.2s ease;
    margin-left: 1rem;
    box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 5px;
}

.theme-toggle-btn:hover {
    background: var(--brand-color);
    color: white;
    border-color: transparent;
}

.theme-toggle-btn:active {
    background: #6a6dfc;
    color: white;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.note-card {
    background: var(--surface-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--surface-color);
    transition: all 0.2s ease;
    position: relative;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px;
}

.note-card:hover {
    transform: scale(1.02);
    box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 20px;
}

.note-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.note-content {
    line-height: 1.6;
    color: var(--secondary-text-color);
    margin-bottom: 1rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.note-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    visibility: hidden;
    transition: all 0.2s ease;
}   

.note-card:hover .note-actions {
    opacity: 1;
    visibility: visible;
}

.edit-btn, .delete-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  background: var(--base-transparent-70);
  color: var(--text-color);
  border: 1px solid var(--surface-color);
}

.edit-btn:hover {
    background: var(--base-transparent-100);
    transform: scale(1.05);
}

.delete-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

dialog {
  margin: auto;
  inset: 0;
  border: none;
  border-radius: 1rem;
  padding: 0;
  background: var(--surface-color);
  color: var(--text-color);
  max-width: 500px;
  width: 90vw;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

.dialog-content {
  padding: 2rem;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dialog-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background 0.2s ease;
}

.close-btn svg {
  width: 24px;
  height: 24px;
  display: block;
  stroke-width: 2;
  fill: var(--text-color); 
}

.close-btn:hover {
  background: var(--base-transparent-70);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--surface-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  background: var(--base-color);
  color: var(--text-color);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-color);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.dialog-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cancel-btn, .save-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: var(--base-color);
  color: var(--text-color);
}

.save-btn {
  background: var(--brand-color);
  color: white;
}

.save-btn:hover {
  background: #7a7fff;
}

.save-btn:active {
  background: #6a6aff;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--secondary-text-color);
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

