/* --- Vintage styled UI --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --paper:#F5E9D7;
  --ink:#ffffff;
  --muted: rgba(255,255,255,0.85);
  --accent:#9b5f2a;
  --card: rgba(255,255,240,0.9);
}

body {
  font-family: 'Playfair Display', serif;
  background-color: var(--paper);
  background-image: url('Gemini_Generated_Image_afemx5afemx5afem.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  /* subtle sepia overlay */
  filter: none;
}

/* parchment container with subtle texture and border */
.container {
  max-width: 1100px;
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,245,0.98), rgba(250,243,232,0.95));
  padding: 42px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(46,34,25,0.25);
  border: 1px solid rgba(60,40,25,0.12);
  background-image:
    linear-gradient(transparent 0%, rgba(0,0,0,0.02) 100%),
    repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(0,0,0,0.01) 7px);
}

/* big vintage headline */
.main-title {
  font-family: 'Special Elite', monospace;
  font-size: 9rem;
  color: #ffffff;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.35), 6px 6px 28px rgba(0,0,0,0.45);
  text-align: center;
}

/* subheading with serif (default) */
h1 {
  font-size: 3.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
  text-align: center;
}

/* prominent white vintage title for "SUITCASE PACKER" */
.suitcase-packer {
  font-family: 'Special Elite', monospace;
  color: #ffffff;
  font-size: 5.2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 6px;
  text-shadow:
    0 2px 0 rgba(0,0,0,0.35),
    4px 4px 0 rgba(0,0,0,0.32),
    8px 12px 32px rgba(0,0,0,0.45);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* subtle subtitle style */
.subtitle {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 1.4rem;
  text-align: center;
}

/* inputs area shaped like an old form */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto 28px;
  max-width: 760px;
}

/* labels look like stamped text */
label {
  font-family: 'Special Elite', monospace;
  color: var(--ink);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

/* textarea mimics kraft paper card */
textarea {
  font-family: 'Playfair Display', serif;
  padding: 18px;
  border: 1px dashed rgba(60,40,25,0.12);
  border-radius: 8px;
  font-size: 1.6rem;
  line-height: 1.45;
  resize: vertical;
  background: rgba(255,250,240,0.95);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* buttons with leather-look */
.generate-btn {
  background: linear-gradient(180deg, #5b2f15, #4a2410);
  color: #ffffff;
  border: none;
  padding: 18px 40px;
  border-radius: 8px;
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s;
  align-self: flex-start;
  box-shadow: 0 8px 18px rgba(74,36,16,0.32);
  font-family: 'Special Elite', monospace;
  letter-spacing: 0.02em;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(74,36,16,0.35);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  background: #b8a090;
  cursor: not-allowed;
}

/* loading area */
.loading {
  text-align: center;
  padding: 28px 0;
}

.loading p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 1rem;
  font-family: 'Special Elite', monospace;
}

/* spinner but toned down */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(200,180,160,0.6);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

/* progress bar vintage color */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(80,60,45,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  animation: progress 10s linear forwards;
}

/* result area: image tinted slightly sepia, with film border */
.result {
  text-align: center;
  margin-top: 12px;
}

.result img {
  width: 100%;
  max-width: 920px;
  height: auto;
  border-radius: 8px;
  margin: 0 auto 30px;
  display: block;
  box-shadow: 0 10px 30px rgba(48,32,24,0.28);
  filter: sepia(0.25) contrast(1.03) saturate(0.9);
  border: 8px solid rgba(245,235,220,0.9);
}

/* phrases section styled as printed cards */
.phrases-section {
  text-align: left;
  margin-bottom: 32px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.phrases-section h2 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--ink);
  font-family: 'Special Elite', monospace;
}

.phrases-intro {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 18px;
}

/* grid of prompt cards look like vintage labels */
.phrases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.phrase-card {
  background: linear-gradient(180deg, rgba(255,250,240,0.98), rgba(250,243,232,0.98));
  padding: 14px 18px;
  border-radius: 6px;
  border-left: 4px solid rgba(155,95,42,0.12);
  box-shadow: 0 6px 12px rgba(60,40,25,0.06);
}

.phrase-card p {
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--ink);
  font-family: 'Playfair Display', serif;
}

/* regenerate button as stamp */
.regenerate-btn {
  background: transparent;
  color: var(--ink);
  border: 2px dashed rgba(60,40,25,0.18);
  padding: 12px 26px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  font-family: 'Special Elite', monospace;
}

.regenerate-btn:hover {
  background: rgba(155,95,42,0.06);
}

.hidden {
  display: none;
}

/* responsive tweaks */
@media (max-width: 640px) {
  .main-title {
    font-size: 5.2rem;
  }

  h1 {
    font-size: 2.4rem;
  }

  .suitcase-packer {
    font-size: 3.2rem;
  }

  .subtitle {
    font-size: 1.25rem;
  }

  label {
    font-size: 1.25rem;
  }

  textarea {
    font-size: 1.25rem;
  }

  .generate-btn {
    font-size: 1.2rem;
    padding: 14px 22px;
  }

  .phrase-card p {
    font-size: 1.25rem;
  }

  .container {
    padding: 18px;
  }

  .result img {
    max-width: 100%;
  }
}

/* keyframes */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}