:root {
  --primary: #41403e;
  --secondary: #0b74d5;
  --success: #86a361;
  --warning: #ddcd45;
  --danger: #a7342d;
  --muted: #868e96;
  --white: #fff;
  --main-background: #fff;
  --note-bg: rgb(230, 221, 208);
  --body-bg: rgb(210, 191, 158);
}

* {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  font-size: 20px;
  color: var(--primary);
}

body {
  margin: 0;
  padding: 2rem 0;
  background-color: var(--body-bg);
  font-family: 'Neucha', cursive;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Patrick Hand SC', cursive;
  font-weight: 400;
  display: inline;
  margin: 0;
}

h1 {
  font-size: 4rem;
}

h3 {
  font-size: 2rem;
}

p {
  line-height: 1.6;
  margin: 0.5em 0;
}

a {
  color: var(--secondary);
  text-decoration: none;
  background-image: linear-gradient(transparent, transparent 5px, var(--secondary) 5px, var(--secondary));
  background-position: bottom;
  background-size: 100% 6px;
  background-repeat: repeat-x;
}

a:hover {
  background-image: none;
}

/* Layout */
#app {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.full-rotate {
  margin: auto;
  width: 80vw;
  max-width: 40em;
  transform: rotate(-3deg);
}

.note {
  background-color: var(--note-bg);
  padding: 1em;
  margin-bottom: 3em;
}

.center {
  text-align: center;
}

/* Border styles - hand-drawn effect */
.border {
  border: 2px solid var(--primary);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

.border-primary {
  border-color: var(--primary);
}

/* Header */
#header {
  text-align: center;
  margin-bottom: 2em;
}

#header h3 {
  display: block;
  margin-top: 0.5em;
  color: var(--primary);
}

/* Message/Letter intro */
#message {
  line-height: 1.8;
}

#message p {
  margin: 1em 0;
}

/* Message display (user messages) */
#message-display {
  line-height: 1.8;
  min-height: 200px;
}

#message-display p {
  margin: 1em 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Message controls */
#message-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
}

#message-controls button {
  margin: 0.25em;
}

/* Letter/compose area */
#letter form {
  display: flex;
  flex-direction: column;
}

.textarea {
  width: 100%;
  height: 10em;
  max-height: 20em;
  resize: none;
  font-family: 'Neucha', cursive;
  font-size: 1rem;
  padding: 0.75em;
  border: 2px solid var(--primary);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  background-color: var(--white);
  outline: none;
}

.textarea:focus {
  border-color: var(--secondary);
}

.flex {
  display: flex;
}

.right {
  margin-left: auto;
}

/* Buttons */
button, .paper-btn {
  font-family: 'Neucha', cursive;
  font-size: 1rem;
  color: var(--primary);
  background-color: var(--main-background);
  border: 2px solid var(--primary);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  outline: none;
  transition: all 235ms ease-in-out;
  box-shadow: 15px 28px 25px -18px rgba(0, 0, 0, 0.2);
}

button:hover, .paper-btn:hover {
  box-shadow: 2px 8px 8px -5px rgba(0, 0, 0, 0.3);
  transform: translate3d(0, 2px, 0);
}

button:active {
  transform: translate3d(0, 4px, 0);
  box-shadow: none;
}

/* Share section */
#share p {
  margin: 0.5em 0;
}

.share-btn {
  display: inline-block;
  color: var(--white);
  border: none;
  padding: 0.3em 0.8em;
  outline: none;
  text-align: center;
  font-size: 0.9em;
  margin: 0.2em;
  text-decoration: none;
  background-image: none;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.share-btn:hover {
  opacity: 0.8;
  text-decoration: none;
  background-image: none;
}

.share-btn.facebook {
  background: #3b5998;
}

.share-btn.reddit {
  background: #ff5700;
}

.share-btn.linkedin {
  background: #4875b4;
}

.share-btn.email {
  background: #333;
}

/* Footer */
#footer {
  font-size: 0.9em;
}

#footer p {
  margin: 0.3em 0;
}

/* Read message modal */
#read-message-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#read-message-modal .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

#read-message-modal .modal-content {
  position: relative;
  z-index: 1001;
  background-color: var(--note-bg);
  padding: 2em;
  max-width: 80vw;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid var(--primary);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transform: rotate(-2deg);
}

#read-message-modal .modal-content p {
  white-space: pre-wrap;
  word-wrap: break-word;
}

#read-message-modal .modal-actions {
  margin-top: 1.5em;
  display: flex;
  justify-content: center;
  gap: 1em;
}

/* Feeling down resources */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-wrapper .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.modal-wrapper .modal-content {
  position: relative;
  z-index: 1001;
  background-color: var(--note-bg);
  padding: 2em;
  max-width: 80vw;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid var(--primary);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transform: rotate(-2deg);
}

.modal-wrapper .modal-actions {
  margin-top: 1.5em;
  display: flex;
  justify-content: center;
  gap: 1em;
}

#resources-modal .modal-content {
  max-width: 500px;
}

#resources-modal h3 {
  display: block;
  margin-bottom: 1em;
}

#resources-modal ul {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

#resources-modal li {
  margin: 0.5em 0;
  padding-left: 1em;
}

#resources-modal li::before {
  content: "- ";
  margin-left: -1em;
}

/* Animations */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.3s;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.3s;
}

/* Mobile responsive */
@media screen and (max-width: 760px) {
  h1 {
    font-size: 2em !important;
  }

  h2, h3, h4, h5 {
    font-size: 1em !important;
  }

  .full-rotate {
    width: 90vw;
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--white);
  padding: 1em 2em;
  border-radius: 8px;
  z-index: 2000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
