body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  color: #333;
}

header {
  background: #4CAF50;
  color: white;
  text-align: center;
  padding: 1.2rem;
}

h1, h2, h3 {
  margin: 0.6rem 0;
}

header h1 {
  font-size: 1.4rem;  /* reduce from default ~2rem */
  line-height: 1.5;
}

main {
  padding: 1rem;
}

/* ===== Gallery on Index Page ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* desktop: 6 per row */
  gap: 1rem;
  padding: 1rem;
}

.image-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s;
}

.image-card:hover {
  transform: scale(1.05);
}

.image-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ===== Message Page Layout ===== */
.message-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.form-section, .preview-section {
  flex: 1 1 400px;
  max-width: 500px;
}

textarea, input, button {
  padding: 0.6rem;
  margin: 0.4rem 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  font-size: 1rem;
}

textarea {
  resize: none;
  height: 150px;
}

#charCount {
  text-align: right;
  font-size: 0.9rem;
  color: #666;
}

button {
  background: #4CAF50;
  color: white;
  cursor: pointer;
}

button:hover {
  background: #45a049;
}

.preview-section {
  text-align: center;
}

canvas {
  border: 1px solid #ccc;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr); /* mobile: 2 per row → 2×3 grid */
  }

  .message-container {
    flex-direction: column;
    align-items: center;
  }

  .form-section, .preview-section {
    max-width: 100%;
  }
}


.success-banner {
  margin-top: 1rem;
  padding: 0.8rem;
  background: #e8f5e9;
  border: 1px solid #4caf50;
  border-radius: 6px;
  color: #2e7d32;
  font-size: 0.95rem;
  text-align: left;
}

.image-card {
  position: relative;
  display: inline-block;
}

.image-card img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

/* Caption overlay */
.card-caption {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.image-card:hover .card-caption {
  opacity: 1;
}


/* WhatsApp button disabled state */
#whatsappBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}