/* LO AI Workspace — Design System
   Matches the training guide: Outfit headings, Jakarta Sans body, #287d7b teal accent.
   WCAG 2.2 AA compliant. */

/* ------------------------------------------------------------------ */
/* Self-hosted fonts (no external requests to Google)                   */
/* ------------------------------------------------------------------ */

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('/static/fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('/static/fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/static/fonts/jakarta-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/static/fonts/jakarta-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------ */
/* Reset & base                                                        */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --teal:       #287d7b;
    --teal-dark:  #1e5f5d;
    --teal-light: #e8f4f3;
    --orange:     #e56f1c;
    --text:       #1a1a1a;
    --text-muted: #555;
    --bg:         #fafafa;
    --white:      #fff;
    --border:     #ddd;
    --error:      #c0392b;
    --error-bg:   #fdf0ef;
    --warning:    #b8860b;
    --warning-bg: #fef9e7;
    --info-bg:    #eaf6f6;
    --success:    #1e8449;
    --radius:     8px;
    --shadow:     0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --max-width:  900px;
}

html { font-size: 16px; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: 'Outfit', system-ui, sans-serif;
    line-height: 1.3;
}

a { color: var(--teal); }
a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 2px; }

code {
    background: var(--teal-light);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--teal);
    text-decoration: none;
}

.nav-links { display: flex; gap: 1.5rem; }

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover, .nav-link.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}

/* ------------------------------------------------------------------ */
/* Main content                                                        */
/* ------------------------------------------------------------------ */

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    flex: 1;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.site-footer {
    text-align: centre;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    text-align: center;
}
.site-footer a { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}
.hero h1 {
    font-size: 2rem;
    color: var(--teal);
    margin-bottom: 0.5rem;
}
.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Workflow cards (landing page)                                        */
/* ------------------------------------------------------------------ */

.workflow-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}
a.card:hover, a.card:focus-visible {
    box-shadow: var(--shadow-hover);
    border-color: var(--teal);
}
.card h2 {
    font-size: 1.15rem;
    margin: 0.75rem 0 0.5rem;
}
.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
}
.card-icon { color: var(--teal); }
.card-coming-soon { opacity: 0.55; cursor: default; }

.card-cta {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--teal);
}
.card-cta-muted { color: var(--text-muted); }

.chat-link { margin-bottom: 1rem; }
.card-chat {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}
.card-chat h2 { margin-top: 0; }

/* ------------------------------------------------------------------ */
/* Workflow header                                                     */
/* ------------------------------------------------------------------ */

.workflow-header {
    margin-bottom: 1.5rem;
}
.workflow-header h1 {
    font-size: 1.6rem;
    color: var(--teal);
    margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-error   { background: var(--error-bg);   border-left: 4px solid var(--error); }
.alert-warning { background: var(--warning-bg); border-left: 4px solid var(--warning); }
.alert-info    { background: var(--info-bg);    border-left: 4px solid var(--teal); }

.text-error { color: var(--error); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Upload form                                                         */
/* ------------------------------------------------------------------ */

.upload-form { margin-bottom: 2rem; }

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    margin-bottom: 1.25rem;
}
.dropzone:hover, .dropzone-active {
    border-color: var(--teal);
    background: var(--teal-light);
}

.dropzone-icon { color: var(--text-muted); margin-bottom: 0.5rem; }
.dropzone-text { font-size: 1rem; margin-bottom: 0.25rem; }
.dropzone-hint { font-size: 0.8rem; color: var(--text-muted); }

.link-button {
    background: none;
    border: none;
    color: var(--teal);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.file-list {
    list-style: none;
    text-align: left;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.file-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}
.file-size { color: var(--text-muted); font-size: 0.8rem; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ------------------------------------------------------------------ */
/* Options / fieldset                                                   */
/* ------------------------------------------------------------------ */

.options-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.options-group legend {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--teal);
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
    display: inline-block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.btn-primary {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
}
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn-secondary {
    background: var(--white);
    color: var(--teal);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--teal); }

.btn-small {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    background: var(--white);
    color: var(--teal);
    border: 1px solid var(--border);
}
.btn-small:hover { border-color: var(--teal); }

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ------------------------------------------------------------------ */
/* CSV column picker                                                   */
/* ------------------------------------------------------------------ */

.csv-picker {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.csv-picker h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.picker-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.column-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.column-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.column-item:hover { background: var(--teal-light); }
.column-suggested { background: #f0faf9; }

.column-item input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--teal);
    flex-shrink: 0;
}

.column-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.column-header {
    font-weight: 600;
    font-size: 0.9rem;
}
.column-sample {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.badge-suggested {
    background: var(--teal-light);
    color: var(--teal-dark);
}

/* ------------------------------------------------------------------ */
/* Results                                                             */
/* ------------------------------------------------------------------ */

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    border-left: 4px solid var(--success);
}
.result-error  { border-left-color: var(--error); }
.result-review { border-left-color: var(--warning); }

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.result-header h2 { font-size: 1rem; }

.result-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--warning-bg);
    color: var(--warning);
}
.result-icon-ok    { background: #eafaf1; color: var(--success); }
.result-icon-error { background: var(--error-bg); color: var(--error); }

.result-error-msg {
    color: var(--error);
    font-size: 0.9rem;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    margin-bottom: 0.75rem;
}
.stat { display: flex; flex-direction: column; }
.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stat-value { font-size: 0.9rem; }

/* ------------------------------------------------------------------ */
/* Review section (expandable)                                         */
/* ------------------------------------------------------------------ */

.review-section {
    margin: 0.75rem 0;
    border: 1px solid var(--warning);
    border-radius: 6px;
    overflow: hidden;
}
.review-toggle {
    padding: 0.5rem 0.75rem;
    background: var(--warning-bg);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warning);
    cursor: pointer;
}
.review-items { padding: 0.75rem; }
.review-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.review-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.review-item:last-child { border-bottom: none; }
.review-type {
    font-weight: 600;
    color: var(--warning);
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}
.review-text {
    background: var(--warning-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}
.review-context {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    word-break: break-word;
}

/* ------------------------------------------------------------------ */
/* Results actions                                                     */
/* ------------------------------------------------------------------ */

.results-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

/* ------------------------------------------------------------------ */
/* Info box                                                            */
/* ------------------------------------------------------------------ */

.info-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}
.info-box h2 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    margin-top: 1rem;
}
.info-box h2:first-child { margin-top: 0; }
.info-box ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
.info-box li { margin-bottom: 0.25rem; }
.info-box p { margin-bottom: 0.4rem; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
    .hero h1 { font-size: 1.5rem; }
    .workflow-cards { grid-template-columns: 1fr; }
    .nav-container { flex-direction: column; gap: 0.5rem; }
    .results-actions { flex-direction: column; }
    .form-actions { flex-direction: column; }
}
