/* Letter/Message Page - Handwritten Letter Design */

.letter-page {
  min-height: 100vh;
  background: 
    radial-gradient(circle at 20% 50%, rgba(139, 115, 85, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(101, 67, 33, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #f5f1e8 0%, #e8e0d1 50%, #f5f1e8 100%);
  padding: var(--space-xl) var(--space-md);
  font-family: 'Kalam', 'Caveat', cursive;
  position: relative;
}

.letter-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139, 115, 85, 0.03) 2px,
      rgba(139, 115, 85, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(139, 115, 85, 0.03) 2px,
      rgba(139, 115, 85, 0.03) 4px
    );
  pointer-events: none;
  z-index: 0;
}

.letter-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Envelope */
.letter-envelope {
  background: linear-gradient(135deg, #d4c5b0 0%, #c4b5a0 100%);
  border-radius: 8px;
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  border: 1px solid rgba(139, 115, 85, 0.2);
}

.letter-envelope::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.letter-envelope__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 2px dashed rgba(139, 115, 85, 0.3);
}

.letter-envelope__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.letter-envelope__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.letter-envelope__brand-text {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 600;
  color: #5a3e2b;
  text-decoration: none;
}

.letter-envelope__actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.letter-envelope__link {
  font-family: 'Kalam', cursive;
  font-size: 14px;
  color: #5a3e2b;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.letter-envelope__link:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(139, 115, 85, 0.3);
}

.letter-envelope__button {
  font-family: 'Kalam', cursive;
  font-size: 14px;
  color: #FFFFFF;
  background-color: #5a3e2b;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: 1px solid #5a3e2b;
}

.letter-envelope__button:hover {
  background-color: #4a2e1f;
  border-color: #4a2e1f;
}

.letter-envelope__button--ghost {
  background-color: transparent;
  color: #5a3e2b;
  border-color: rgba(139, 115, 85, 0.3);
}

.letter-envelope__button--ghost:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Letter Paper */
.letter-paper {
  background: #fefcf8;
  background-image: 
    linear-gradient(to right, rgba(139, 115, 85, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 115, 85, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  padding: var(--space-xxl) var(--space-xl);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 0 0 1px rgba(139, 115, 85, 0.1);
  border-radius: 4px;
  position: relative;
  margin-bottom: var(--space-xl);
  transform: rotate(-0.5deg);
  transition: transform 0.3s ease;
}

.letter-paper:hover {
  transform: rotate(0deg);
}

.letter-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 60px;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, 
    transparent 0%,
    rgba(255, 0, 0, 0.1) 5%,
    rgba(255, 0, 0, 0.1) 95%,
    transparent 100%
  );
  opacity: 0.3;
}

/* Letter Header */
.letter-header {
  margin-bottom: var(--space-xl);
  position: relative;
}

.letter-date {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: #5a3e2b;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.letter-date__day {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.letter-date__month-year {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.letter-date__month {
  font-size: 18px;
  font-weight: 500;
}

.letter-date__year {
  font-size: 14px;
  opacity: 0.7;
}

.letter-sender {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(139, 115, 85, 0.2);
}

.letter-sender__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(139, 115, 85, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.letter-sender__info {
  flex: 1;
}

.letter-sender__name {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 600;
  color: #5a3e2b;
  margin: 0 0 4px 0;
}

.letter-sender__journal {
  font-family: 'Kalam', cursive;
  font-size: 14px;
  color: #8b7355;
  margin: 0;
}

.letter-title {
  font-family: 'Caveat', cursive;
  font-size: 36px;
  font-weight: 600;
  color: #3a2e1f;
  margin: 0 0 var(--space-xl) 0;
  line-height: 1.3;
  text-align: center;
  position: relative;
  padding-bottom: var(--space-md);
}

.letter-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(to right, transparent, #8b7355, transparent);
}

/* Letter Content */
.letter-content {
  font-family: 'Kalam', cursive;
  font-size: 18px;
  line-height: 2;
  color: #3a2e1f;
  margin-bottom: var(--space-xl);
  position: relative;
}

.letter-content p {
  margin: 0 0 var(--space-lg) 0;
  text-indent: 2em;
}

.letter-content p:first-child {
  text-indent: 0;
}

.letter-content p:first-child::first-letter {
  font-size: 48px;
  font-weight: 600;
  float: left;
  line-height: 1;
  margin-right: 8px;
  margin-top: 4px;
  color: #5a3e2b;
  font-family: 'Caveat', cursive;
}

/* Letter Signature */
.letter-signature {
  margin-top: var(--space-xxl);
  padding-top: var(--space-xl);
  border-top: 1px dashed rgba(139, 115, 85, 0.3);
  text-align: right;
}

.letter-signature__name {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  font-weight: 600;
  color: #5a3e2b;
  margin-bottom: var(--space-xs);
  display: inline-block;
  transform: rotate(-2deg);
}

.letter-signature__date {
  font-family: 'Kalam', cursive;
  font-size: 14px;
  color: #8b7355;
  margin: 0;
}

/* Letter Attachments */
.letter-attachments {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px dashed rgba(139, 115, 85, 0.3);
}

.letter-attachments__title {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: #5a3e2b;
  margin-bottom: var(--space-md);
}

.letter-attachments__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.letter-attachment {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(139, 115, 85, 0.2);
  border-radius: 4px;
  padding: var(--space-sm);
  text-align: center;
  transition: all 0.2s ease;
}

.letter-attachment:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.letter-attachment__image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: var(--space-xs);
}

.letter-attachment__link {
  font-family: 'Kalam', cursive;
  font-size: 14px;
  color: #5a3e2b;
  text-decoration: none;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.letter-attachment__link:hover {
  background-color: rgba(139, 115, 85, 0.1);
}

/* Letter Footer CTA */
.letter-footer {
  background: linear-gradient(135deg, #d4c5b0 0%, #c4b5a0 100%);
  border-radius: 8px;
  padding: var(--space-xxl);
  text-align: center;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(139, 115, 85, 0.2);
  margin-top: var(--space-xl);
}

.letter-footer__title {
  font-family: 'Caveat', cursive;
  font-size: 32px;
  font-weight: 600;
  color: #5a3e2b;
  margin: 0 0 var(--space-md) 0;
}

.letter-footer__description {
  font-family: 'Kalam', cursive;
  font-size: 16px;
  color: #5a3e2b;
  margin: 0 0 var(--space-xl) 0;
  line-height: 1.6;
}

.letter-footer__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.letter-footer__button {
  font-family: 'Kalam', cursive;
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.letter-footer__button--primary {
  background-color: #5a3e2b;
  color: #FFFFFF;
  border-color: #5a3e2b;
}

.letter-footer__button--primary:hover {
  background-color: #4a2e1f;
  border-color: #4a2e1f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.letter-footer__button--ghost {
  background-color: transparent;
  color: #5a3e2b;
  border-color: #5a3e2b;
}

.letter-footer__button--ghost:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .letter-page {
    padding: var(--space-md) var(--space-sm);
  }

  .letter-envelope {
    padding: var(--space-md);
  }

  .letter-envelope__header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .letter-envelope__actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .letter-paper {
    padding: var(--space-lg) var(--space-md);
    transform: rotate(0deg);
  }

  .letter-title {
    font-size: 28px;
  }

  .letter-content {
    font-size: 16px;
  }

  .letter-content p:first-child::first-letter {
    font-size: 36px;
  }

  .letter-attachments__grid {
    grid-template-columns: 1fr;
  }

  .letter-footer {
    padding: var(--space-xl) var(--space-md);
  }

  .letter-footer__title {
    font-size: 24px;
  }

  .letter-footer__actions {
    flex-direction: column;
  }

  .letter-footer__button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .letter-paper {
    padding: var(--space-md);
  }

  .letter-title {
    font-size: 24px;
  }

  .letter-content {
    font-size: 15px;
    line-height: 1.8;
  }

  .letter-sender__name {
    font-size: 20px;
  }

  .letter-signature__name {
    font-size: 24px;
  }
}

