:root {
  --primary-color: #5b7a9d;
  --secondary-color: #a3c1e0;
  --accent-color: #e0a87d;
  --light-color: #f8f5f2;
  --dark-color: #2c3e50;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  color: var(--dark-color);
  background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

header {
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 30px 20px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 1px;
}

.navbar {
  display: flex;
  justify-content: center;
  background-color: var(--primary-color);
  padding: 10px 0;
  box-shadow: var(--shadow);
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border-radius: 8px;
  margin: 0 10px;
}

.navbar a:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.navbar a.active {
  background-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.content {
  padding: 30px;
}

h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
  position: relative;
}

h2:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40%;
  height: 2px;
  background-color: var(--accent-color);
}

.section {
  margin-bottom: 25px;
  padding: 0 10px;
}

.section-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.section-title:before {
  content: "•";
  margin-right: 8px;
  color: var(--accent-color);
  font-size: 1.5rem;
}

.card {
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 25px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--accent-color);
  position: relative;
}

.card:before {
  content: "✦";
  position: absolute;
  top: -15px;
  left: 20px;
  background: var(--accent-color);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.mantra-container {
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  margin: 30px 0;
  padding: 5px;
  border-radius: var(--border-radius);
}

.mantra {
  background-color: white;
  border-radius: calc(var(--border-radius) - 2px);
  padding: 25px;
  font-style: italic;
  color: var(--dark-color);
  font-weight: 400;
  text-align: center;
  font-size: 1.2rem;
  position: relative;
  line-height: 1.8;
}

.mantra:before,
.mantra:after {
  content: "";
  font-size: 4rem;
  position: absolute;
  opacity: 0.1;
  font-family: Georgia, serif;
}

.mantra:before {
  top: -20px;
  left: 10px;
}

.mantra:after {
  content: "";
  bottom: -45px;
  right: 10px;
}

button {
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 50px;
  display: block;
  margin: 30px auto;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

button:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  opacity: 0.2;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

button:hover:after {
  transform: scaleX(1);
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--primary-color);
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Notepad Specific Styles */
.notepad-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.notepad-form input[type="text"],
.notepad-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--secondary-color);
  border-radius: var(--border-radius);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.notepad-form input[type="text"] {
  height: 50px;
}

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

.notepad-form input[type="text"]:focus,
.notepad-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(91, 122, 157, 0.2);
}

.notepad-form button {
  margin: 0 auto;
  width: fit-content;
}

#notes-list {
  display: grid;
  gap: 20px;
}

/* Modern Note Card with Smooth Expansion */
.note-card {
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--accent-color);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.note-card .note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  transition: margin-bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.note-card.expanded .note-header {
  margin-bottom: 15px;
}

.note-card .note-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
  word-wrap: break-word;
  flex-grow: 1;
  margin-right: 10px;
  user-select: none;
  transition: color 0.3s ease;
}

.note-card.expanded .note-title {
  color: var(--dark-color);
}

.note-card .toggle-icon {
  font-size: 1.2rem;
  color: var(--primary-color);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  line-height: 1;
  opacity: 0.7;
}

.note-card:hover .toggle-icon {
  opacity: 1;
}

.note-card.expanded .toggle-icon {
  transform: rotate(180deg);
  color: var(--accent-color);
}

/* Modern expansion with scale and fade */
.note-card .note-content {
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  transform-origin: top;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

.note-card.expanded .note-content {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  height: auto;
  overflow: visible;
}

.note-card .note-text {
  font-size: 1.05rem;
  margin-bottom: 15px;
  color: var(--dark-color);
  white-space: pre-wrap;
  line-height: 1.6;
}

.note-card .note-date {
  font-size: 0.85rem;
  color: var(--primary-color);
  opacity: 0.8;
  text-align: right;
  margin-top: 10px;
  font-weight: 500;
}

.note-card .delete-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  position: absolute;
  top: 20px;
  right: 15px;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.note-card:hover .delete-btn {
  opacity: 1;
  transform: scale(1);
}

.note-card .delete-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.no-notes-message {
  text-align: center;
  color: var(--dark-color);
  font-style: italic;
  opacity: 0.7;
  padding: 30px 0;
}

/* Confirmation Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.7) translateY(-50px);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal h3 {
  color: var(--dark-color);
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 600;
}

.modal p {
  color: var(--dark-color);
  margin-bottom: 25px;
  opacity: 0.8;
  line-height: 1.5;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.modal-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 0;
  display: inline-block;
  min-width: 100px;
}

.modal-btn.cancel {
  background-color: #f8f9fa;
  color: var(--dark-color);
  border: 2px solid var(--secondary-color);
}

.modal-btn.cancel:hover {
  background-color: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
}

.modal-btn.confirm {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.modal-btn.confirm:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.save-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-color);
  color: white;
  padding: 12px 25px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  z-index: 1000;
  font-size: 1rem;
  font-weight: 500;
}

.save-notification.show {
  opacity: 1;
  visibility: visible;
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--primary-color);
  font-size: 0.9rem;
  opacity: 0.8;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
  /* make it bold */
  font-weight: 900;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  .content {
    padding: 20px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .notepad-form button {
    width: 100%;
  }

  /* Improved mobile delete button */
  .note-card .delete-btn {
    position: static;
    margin-top: 15px;
    margin-left: auto;
    display: block;
    opacity: 1;
    transform: scale(1);
    width: auto;
    min-width: 80px;
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 20px;
  }

  /* Mobile note card adjustments */
  .note-card {
    padding: 15px;
  }

  .note-card .note-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .note-card .note-title {
    margin-right: 0;
    width: 100%;
  }

  .note-card .toggle-icon {
    align-self: flex-end;
    margin-top: -30px;
  }

  .save-notification {
    width: calc(100% - 40px);
    text-align: center;
    bottom: 10px;
  }
}

@media (max-width: 400px) {
  .note-card .delete-btn {
    width: 100%;
    margin-top: 15px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .modal-btn {
    width: 100%;
  }
}
