/* Global Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: 'Lora', serif;
  background: #f8f5f2;
  color: #3d3d3d;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  background: #f0e6e0;
  color: #433e3c;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

h1, h2, h3, button {
  font-family: 'Poppins', sans-serif;
}

/* Header Section */
.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.logo {
  margin-right: 0.75rem;
}

.feather-icon {
  color: #9c7a65;
}

header h1 {
  margin: 0;
  font-weight: 600;
  color: #5e4e47;
  font-size: 1.8rem;
}

/* Intro Section */
.intro {
  font-size: 1.1rem;
  margin: 0.75rem auto;
  max-width: 600px;
  color: #5e4e47;
  line-height: 1.6;
}

#write-message-btn {
  background-color: #9c7a65;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(156, 122, 101, 0.3);
  margin-top: 0.75rem;
}

#write-message-btn:hover {
  background-color: #826659;
  transform: translateY(-2px);
}

/* Form Styling */
form {
  width: 90%;
  max-width: 600px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: all 0.4s ease;
  position: relative;
}

form.collapsed {
  display: none;
}

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

.form-header h2 {
  margin: 0;
  color: #5e4e47;
  font-size: 1.5rem;
}

#close-form {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9c7a65;
  padding: 0;
  line-height: 1;
}

form input, form textarea {
  font-family: 'Lora', serif;
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid #e0d9d2;
  border-radius: 8px;
  width: 100%;
  background-color: #fcfaf7;
  color: #3d3d3d;
}

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

form input:focus, form textarea:focus {
  outline: none;
  border-color: #9c7a65;
  box-shadow: 0 0 0 2px rgba(156, 122, 101, 0.2);
}

form button[type="submit"] {
  background-color: #9c7a65;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
}

form button[type="submit"]:hover {
  background-color: #826659;
}

#success-message {
  text-align: center;
  color: #658c6d;
  margin: 1rem;
  font-size: 1.2rem;
  padding: 1rem;
  background-color: rgba(101, 140, 109, 0.1);
  border-radius: 8px;
  display: none;
}

/* Message Cards */
.message-card {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
  background: #ffffff;
  border: 1px solid #e0d9d2;
  border-radius: 10px;
  padding: 1.8rem;
  margin: 1.5rem auto;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.message-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.message-card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #9c7a65;
  font-weight: 500;
}

.message-card .name {
  color: #3d3d3d;
  font-style: italic;
}

.message-card p {
  font-size: 1.05rem;
  color: #433e3c;
  line-height: 1.8;
}

/* Skeleton Cards */
.skeleton-card {
  background: #f0e6e0;
  border-radius: 10px;
  margin: 1rem auto;
  width: 90%;
  max-width: 600px;
  height: 150px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { background-color: #f0e6e0; }
  50% { background-color: #e5ddd8; }
  100% { background-color: #f0e6e0; }
}

/* Loading Spinner */
#loading {
  display: none;
  text-align: center;
  margin: 2rem;
  font-size: 1.2rem;
  color: #9c7a65;
}

#loading::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  border: 3px solid #9c7a65;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Back To Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: none;
  background: #9c7a65;
  color: white;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
}

#back-to-top:hover {
  background: #826659;
}

/* Responsive Mobile Tweaks */
@media (max-width: 600px) {
  header {
    padding: 1.5rem 1rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .logo svg {
    width: 30px;
    height: 30px;
  }

  .intro {
    font-size: 0.95rem;
    padding: 0 0.5rem;
    margin: 0.5rem auto;
  }

  form, .message-card {
    padding: 1.5rem;
  }

  #write-message-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }

  form input, form textarea, form button {
    font-size: 1.1rem;
  }
}

.message-card.highlighted {
  outline: 3px solid #ff4081;
  background-color: #fff0f5;
  transition: outline 0.3s ease, background-color 0.3s ease;
}

a {
  color: #9c7a65; /* your signature warm gold */
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: #826659; /* a slightly darker, richer gold for hover */
  text-decoration: underline;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff; /* Match your site's background color */
  padding: 2px 0;
  text-align: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Optional: adds a subtle shadow */
  z-index: 100; /* Ensures footer stays on top of other content */
}

/* Add padding to the bottom of the main content 
   to prevent the footer from covering content */
body {
  padding-bottom: 20px; /* Adjust this value based on your footer's height */
}