/* Base palette for a modern aesthetic */
:root {
  --color-primary: #4a90e2;
  --color-primary-dark: #357abd;
  --color-secondary: #00b894;
  --color-secondary-dark: #008c6d;
  --color-background: #f1f5f9;
  --color-surface: #ffffff;
  --color-border: #e0e0e0;
  --color-text: #333333;
  --color-muted: #666666;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-text);
}

header {
  background: linear-gradient(60deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  padding: 30px 20px;
  text-align: center;
  border-radius: 0 0 12px 12px;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

main {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  margin-bottom: 30px;
  padding: 20px;
  background-color: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.step h2 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--color-primary);
}

textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
}

button {
  padding: 10px 24px;
  margin-top: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: var(--color-primary-dark);
}

#downloadLink {
  display: inline-block;
  padding: 10px 24px;
  margin-top: 10px;
  margin-left: 10px;
  background-color: var(--color-secondary);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

/* Style for the WhatsApp share button */
#whatsappBtn {
  padding: 10px 24px;
  margin-top: 10px;
  margin-left: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #25D366; /* WhatsApp green */
  color: #fff;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

#whatsappBtn:hover {
  background-color: #1DA851;
}

#downloadLink:hover {
  background-color: var(--color-secondary-dark);
}

.result-buttons button {
  margin-right: 10px;
}

.prompt-actions {
  margin-top: 10px;
}

.note {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 10px;
}

/* Multi-image previews and prompts */
.preview-container {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-container img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

#promptList {
  margin-top: 15px;
}

.prompt-item {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: #fafafa;
}

.prompt-item h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.prompt-item textarea {
  width: 100%;
  height: 90px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  resize: vertical;
  overflow: auto;
  font-size: 0.9rem;
}

.aspect-ratio-select {
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.aspect-ratio-select label {
  font-weight: 600;
  color: var(--color-primary-dark);
}

.aspect-ratio-select select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background-color: #fff;
  font-size: 0.9rem;
}

/* The prompt preview area displays the combined prompt and allows the user to edit
   the text before generating the poster. It shares styling with other inputs. */
.prompt-preview {
  border: 1px solid var(--color-border);
  padding: 12px;
  border-radius: 8px;
  background-color: #fdfdfd;
  margin-top: 15px;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.9rem;
  width: 100%;
  resize: vertical;
}

/* New styles for image thumbnail wrapper and remove button */
.thumb-wrapper {
  position: relative;
  display: inline-block;
}

.thumb-wrapper .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff4d4f;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.thumb-wrapper .remove-btn:hover {
  background: #d9363e;
}

#posterCanvas {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}