/* Cognivue AI Report — styles.css */
:root {
  --accent: #ff4d6d; --bg: #f8f9fa; --surface: #fff;
  --border: #e0e0e0; --text: #1a1a1a; --text-muted: #666;
  --radius: 8px; --font: 'Pretendard', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--surface); border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 100; }
header h1 { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions a { color: var(--accent); font-size: .875rem; text-decoration: none; }
.header-actions a:hover { text-decoration: underline; }

/* 2-column grid */
main { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 24px; flex: 1; min-height: 0; }
.pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }

/* Upload zone */
#upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; color: var(--text-muted); font-size: .875rem; transition: border-color .2s; }
#upload-zone:hover { border-color: var(--accent); }
#pdf-viewer { width: 100%; height: 300px; border: 1px solid var(--border); border-radius: var(--radius); }

/* Patient fieldset */
fieldset#patient-info { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: center; }
fieldset#patient-info legend { font-weight: 600; font-size: .875rem; color: var(--text-muted); padding: 0 4px; }
fieldset#patient-info input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-family: var(--font); font-size: .875rem; }
fieldset#patient-info input:focus { outline: none; border-color: var(--accent); }

/* Buttons */
button { padding: 8px 18px; border: none; border-radius: 6px; font-family: var(--font); font-size: .875rem; cursor: pointer; background: var(--accent); color: #fff; font-weight: 600; transition: opacity .15s; }
button:hover:not(:disabled) { opacity: .85; }
button:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
#btn-analyze { align-self: flex-start; }

/* Stream preview & editor */
#stream-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; max-height: 300px; overflow-y: auto; font-size: .875rem; line-height: 1.6; background: var(--bg); }
#editor { flex: 1; min-height: 400px; }

/* Loading state — keeps user engaged during 20–40s LLM call */
#loading-state { padding: 32px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 1rem; font-weight: 600; }
.loading-eta { font-size: .875rem; color: var(--text-muted); }
.loading-eta strong { color: var(--accent); }
.loading-steps { list-style: none; text-align: left; padding: 0; margin: 8px 0; font-size: .8125rem; color: var(--text-muted); }
.loading-steps .step { padding: 4px 8px; border-left: 3px solid var(--border); margin-bottom: 4px; transition: all .25s; }
.loading-steps .step.active { border-left-color: var(--accent); color: var(--text); font-weight: 600; background: rgba(255,77,109,.06); }
.loading-steps .step.done { border-left-color: #2ea44f; color: #2ea44f; }
.loading-steps .step.done::before { content: "✓ "; }
.progress-bar { width: 80%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0; transition: width .4s ease-out; }

/* Footer */
footer { padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.disclaimer { font-size: .75rem; color: var(--text-muted); line-height: 1.5; }
.brand { font-size: .75rem; color: var(--text-muted); text-align: right; }
.brand a { color: var(--accent); text-decoration: none; font-weight: 600; }
.brand a:hover { text-decoration: underline; }
