/* style.css */
body {
  margin: 0;
  padding: 0;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background-color: #fff0f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  text-align: center;
}

h1 {
  color: #ff1493;
  margin-bottom: 12px;
}

.form {
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.form label {
  font-size: 14px;
  color: #4b0082;
  margin-right: 5px;
}

.form input[type="text"] {
  padding: 8px;
  margin: 5px;
  font-size: 14px;
  border: 2px solid #ff69b4;
  border-radius: 5px;
  min-width: 140px;
}

.uploadLabel {
  padding: 8px 12px;
  background: #ffd6ea;
  border: 1px dashed #ff69b4;
  border-radius: 6px;
  color: #4b0082;
  cursor: pointer;
  font-size: 14px;
}

/* Buttons */
.form button {
  padding: 9px 14px;
  background-color: #ff69b4;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

#shareCard {
  margin-left: 4px;
  background-color: #ff1493;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

#shareCard:hover {
  background-color: #e0127f;
}

.form button:hover {
  background-color: #ff1493;
}

/* Share selector row (replaces multiple buttons) */
.shareRow {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}
.shareSelect {
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg,#fff,#ffeef7);
  border: 1px solid #ff69b4;
  color: #4b0082;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Small decorative "postcard" enhancements */
#card {
  position: relative;
  width: 600px;
  height: 450px;
  border: 3px solid #d86b88;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff0f5 0%, #fffafc 40%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  animation: fadeIn 0.5s ease-in-out;
  display: block;
  padding: 18px;
  box-sizing: border-box;
  background-image:
    radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.015));
  background-size: 10px 10px, 100% 100%;
}

/* subtle paper texture and edge */
#card:before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

/* add a stamp in the top-left corner */
#card:after {
  content: "LOVE";
  position: absolute;
  left: 18px;
  top: 14px;
  width: 72px;
  height: 58px;
  border-radius: 8px;
  background: linear-gradient(45deg,#ff749a,#ffb0d2);
  color: white;
  font-weight: 700;
  display:flex;
  align-items:center;
  justify-content:center;
  transform: rotate(-6deg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  font-size: 12px;
  letter-spacing: 1px;
}

/* give the message area a more postcard layout */
.contentArea {
  position: absolute;
  top: 12%;
  left: 8%;
  right: 8%;
  bottom: 12%;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 10px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}

/* Card container */
#cardContainer {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

#card {
  position: relative;
  width: 600px;
  height: 450px;
  border: 2px solid #ff69b4;
  border-radius: 10px;
  overflow: hidden;
  background: #ffc0cb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  animation: fadeIn 0.5s ease-in-out;
  display: block;
  padding: 14px;
  box-sizing: border-box;
}

/* Content area styling - ensure message never overlaps image */
.contentArea {
  position: absolute;
  top: 12%;
  left: 6%;
  right: 6%;
  bottom: 12%;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 6px;
  box-sizing: border-box;
}

/* Left / right image orientation */
.contentArea.image-right {
  flex-direction: row;
}

.contentArea.image-left {
  flex-direction: row-reverse;
}

/* Image sizing: fixed max so text area can wrap safely */
.valentineImage {
  max-width: 280px;
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #ff69b4;
  flex: 0 0 auto;
}

/* Message Area Styling: allow wrapping and prevent overlap */
.messageArea {
  flex: 1 1 220px;
  padding: 6px 10px;
  min-width: 160px;
  max-width: calc(100% - 120px);
  box-sizing: border-box;
}

.message {
  margin: 0;
  font-size: 18px;
  color: #4b0082;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Signature styling */
.signature {
  position: absolute;
  bottom: 10px;
  font-size: 14px;
  color: #4b0082;
  line-height: 1.2;
  background: rgba(255,255,255,0.0);
  padding: 2px 6px;
  border-radius: 4px;
}

.signature.left {
  left: 10px;
  text-align: left;
}

.signature.right {
  right: 10px;
  text-align: right;
}

/* Decoration styling */
.decorations {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0.85;
  pointer-events: none;
}

.heart {
  animation: beat 1s infinite;
}

/* Keyframe animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* Small responsive tweaks */
@media (max-width: 720px) {
  #card { width: 92vw; height: 70vh; }
  .valentineImage { max-width: 40%; max-height: 60%; }
  .message { font-size: 16px; }
  .form { gap: 6px; }
}