/* Page-specific styles for templates/index.html (Design 3 layout) */

:root {
  --bg: #f4efff; --surface: #ffffff; --text: #1f2937; --muted: #6b7280;
  --primary: #2f5dff; --primary-600: #2346d4; --accent: #f4a261; --cyan: #59dce5; --lemon: #fff3b0;
  --radius: 20px; --spacing: 18px;
}

html, body { background: var(--bg); color: var(--text); font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }

header { padding: 64px 24px; text-align:center; background:
  radial-gradient(900px 280px at 50% -10%, var(--cyan), transparent 60%),
  linear-gradient(180deg, var(--bg), transparent 70%);
  border-bottom: 1px solid #e9e0ff;
}
header h1 { margin:0; font-size: 44px; letter-spacing: .3px; }
header h3 { margin:.6rem 0 0; color: var(--muted); font-weight: 600; }

/* Top navigation */
.topnav { display:flex; gap: 18px; justify-content:flex-end; align-items:center; margin-bottom: 10px; flex-wrap: wrap; max-width: 1100px; margin-left:auto; margin-right:auto; padding: 0 24px; }
.topnav a { text-decoration: none; font-weight: 700; padding: 8px 4px; color: var(--text); border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a:focus { border-bottom-color: var(--primary); }

main { max-width: 1100px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 1fr; gap: 24px; }
section { background: var(--surface); padding: var(--spacing); border: 1px solid #f3e7c7; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(239,71,111,.1); }
h2 { margin: 0 0 10px; font-size: 22px; }
.help-text { color: var(--muted); }

.button-group { display:flex; gap:14px; flex-wrap: wrap; margin-top: 14px; }
.btn, .btn-primary, .btn-secondary, .btn-danger, button { appearance:none; border:0; cursor:pointer; border-radius: 14px; padding: 12px 18px; font-weight:700; }
.btn-primary, button.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(47,93,255,.35); }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary { background: #eef2ff; color: var(--text); border: 1px solid #e5e7eb; }
.btn-danger { background: #ef4444; color: #fff; }

.progress { height: 12px; background: #eef2ff; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }

/* Larger text areas and spacing */
#note { min-height: 320px !important; }
#summaryEditable { min-height: 280px !important; }
.text-limitations { margin-bottom: 12px; }
.text-limitations textarea { margin-bottom: 8px; }

textarea, input[type="file"] { width: 100%; background: #ffffff; color: var(--text); border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px; }
.char-counter { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.limit-badge { display: inline-block; background: var(--lemon); color: #111827; padding: 4px 8px; border-radius: 999px; border: 1px solid #fcd34d; margin-right: 6px; margin-bottom: 6px; }
#wordcloud-container { min-height: 220px; background: #fafafa; border: 1px dashed #e5e7eb; border-radius: 14px; display:flex; align-items:center; justify-content:center; }

/* Rows */
.row { display: grid; gap: 24px; }
.row.inputs { }
@media (min-width: 960px) { .row.inputs { grid-template-columns: 1fr 1fr; } }

footer { text-align:center; color: var(--muted); padding: 32px 24px; }

/* Product tour popover anchored near target */
.tour-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 9999; }
.tour-popover { position: fixed; width: min(560px, 92vw); background: #ffffff; color: #111827; border-radius: 16px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 1px solid #e5e7eb; }
.tour-popover h3 { margin: 0 0 8px; font-size: 20px; }
.tour-actions { display:flex; justify-content: space-between; margin-top: 12px; }
.tour-actions button { border-radius: 10px; padding: 8px 14px; border: 0; cursor: pointer; }
.outline-target { box-shadow: 0 0 0 3px rgba(47,93,255,.45); transition: box-shadow .2s ease; }

/* Responsive tweaks */
@media (max-width: 767px) {
  header h1 { font-size: 32px; }
  header { padding: 40px 16px; }
  .btn, .btn-primary, .btn-secondary { padding: 10px 14px; }
  #note { min-height: 220px; }
  #summaryEditable { min-height: 200px; }
}

/* Dark mode overrides (toggle via document.documentElement.setAttribute('data-theme','dark')) */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #60a5fa;
  --primary-600: #3b82f6;
  --accent: #f59e0b;
  --lemon: #374151; /* use neutral pill in dark */
}
[data-theme="dark"] header {
  background:
    radial-gradient(900px 280px at 50% -10%, #0ea5e9, transparent 60%),
    linear-gradient(180deg, #0b1220, transparent 70%);
  border-bottom: 1px solid #1f2a44;
}
[data-theme="dark"] .help-text { color: var(--muted); }
[data-theme="dark"] .topnav a { color: var(--text); }
[data-theme="dark"] section { border-color: #1f2a44; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
[data-theme="dark"] textarea, [data-theme="dark"] input[type="file"] { background:#0b1220; color: var(--text); border-color:#1f2a44; }
[data-theme="dark"] textarea::placeholder { color: #9ca3af; }
[data-theme="dark"] .progress { background:#1f2937; border-color:#1f2a44; }
[data-theme="dark"] .progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); }
[data-theme="dark"] .btn-primary, [data-theme="dark"] button.btn-primary { color: #fff !important; }
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn,
[data-theme="dark"] button { background:#1f2937 !important; border-color:#374151 !important; color: var(--text) !important; }
[data-theme="dark"] .btn-secondary:hover, [data-theme="dark"] .topnav a:hover { border-bottom-color: var(--primary); }
[data-theme="dark"] .limit-badge { background:#1f2937; color:#e5e7eb; border-color:#374151; }
[data-theme="dark"] #wordcloud-container { background:#0b1220; border-color:#1f2a44; }
[data-theme="dark"] .outline-target { box-shadow: 0 0 0 3px rgba(96,165,250,.45); }

