/* ============================
   Bright Professional Theme
   ============================ */
:root {
  /* Surface colors */
  --bg: #f6f9fc;               /* clean light background */
  --card: #ffffff;              /* white cards */
  --panel: #ffffffc9;           /* translucent white panels */

  /* Text */
  --text: #1e293b;              /* dark slate text */
  --muted: #64748b;             /* neutral gray */
  
  /* Brand accents (bright but balanced) */
  --accent: #0ea5e9;            /* vivid sky blue */
  --accent-2: #22c55e;          /* emerald green */
  --accent-3: #3b82f6;          /* fallback vivid blue */

  /* UI tokens */
  --border: #e2e8f0;
  --input: #f1f5f9;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --ring: rgba(14, 165, 233, 0.3);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card: rgba(17, 24, 39, 0.95);
    --panel: rgba(30, 41, 59, 0.85);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --border: rgba(255, 255, 255, 0.1);
    --input: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --ring: rgba(14, 165, 233, 0.5);
  }
}

/* ============================
   Base and Layout
   ============================ */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, #e0f2fe 100%);
  color: var(--text);
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 880px;
  margin: 4rem auto;
  padding: clamp(24px, 4vw, 40px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

/* Typography */
h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 1.3rem + 1.2vw, 2.5rem);
  line-height: 1.3;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* ============================
   Form Elements
   ============================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

label {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

select,
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
  outline: none;
}

select:hover,
input[type="text"]:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  background: #ffffff;
}

/* Help text */
.help {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================
   Details Section
   ============================ */
.details {
  margin-top: 24px;
  padding: clamp(20px, 3vw, 30px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease both;
}

.hidden {
  display: none;
}

.details-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

/* Grid layout for 5 textboxes */
#detailsForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

#detailsForm .field {
  margin: 0;
}

/* ======= Output Section (Generated Text) ======= */
.output {
  margin-top: 24px;
  padding: clamp(20px, 3vw, 30px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease both;
}

.output-title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

#outputText {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
  transition: all 0.2s ease;
}

#outputText:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  background: #ffffff;
}

@media (max-width: 720px) {
  #detailsForm {
    grid-template-columns: 1fr;
  }
}

/* ============================
   Buttons
   ============================ */
.actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn.copied {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}


/* ============================
   Animation
   ============================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
   Print Cleanup
   ============================ */
@media print {
  .container {
    box-shadow: none;
    border: none;
  }
  .actions {
    display: none;
  }
}
