/*  Helios-Lidar upload UI styling. Visually echoes the Helios card
    palette (dark surface, sun-orange accents, monospaced data) so
    the two pages read as part of the same family without sharing a
    framework.                                                       */

:root
{
    /*  Palette aligned 1:1 with Helios's dark theme so the
        helios-lidar.org site reads as part of the same product
        family. Card background + text + border numbers match
        ha-card.theme-dark .dash-card in src/css/helios-card-css.ts.
        Sun-orange accent matches DEFAULT_SUN_COLOR_HEX = #f5a623.    */
    --bg:           #0b0d10;
    --surface:      #191a1b;
    --surface-2:    #21242a;
    --ink:          #e6e6e6;
    --ink-soft:     #9ba0a6;
    --accent:       #f5a623;
    --accent-soft:  #ffd180;
    --success:      #22c55e;
    --danger:       #ef4444;
    --border:       rgba(255, 255, 255, 0.20);
    --border-soft:  rgba(255, 255, 255, 0.08);
    --code-bg:      #0a0c0e;
}

*
{
    box-sizing: border-box;
}

html, body
{
    margin: 0;
    padding: 0;
}

body
{
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main
{
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 24px 24px;
}

header
{
    margin-bottom: 32px;
}

.brand-banner
{
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.brand-icon
{
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
}

/*  Full-viewport-width strip sitting just under the centred icon.
    Escapes <main>'s max-width via 100vw + the negative-margin trick
    so the strip touches both edges of the screen regardless of
    where the centred main column starts. Background uses the orange
    accent with a soft gradient toward both edges so the strip feels
    like a brand wash, not a hard banner.                            */
.brand-strip
{
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 28px;
    padding: 14px 16px;
    background:
        linear-gradient(90deg,
            rgba(245, 166, 35, 0.00) 0%,
            rgba(245, 166, 35, 0.18) 50%,
            rgba(245, 166, 35, 0.00) 100%
        ),
        var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
    color: var(--ink-soft);
    font-size: 13px;
    letter-spacing: 0.4px;
}

.brand-strip strong
{
    color: var(--accent);
    font-weight: 600;
}

h1
{
    font-size: 32px;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    color: var(--accent);
}

h2
{
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 16px;
    color: var(--ink-soft);
}

.lede
{
    margin: 0;
    color: var(--ink-soft);
    font-size: 15px;
}

a
{
    color: var(--accent);
    text-decoration: none;
}

a:hover
{
    text-decoration: underline;
}

.card
{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
}

.card.hidden
{
    display: none;
}

.card.explainer
{
    background: transparent;
    border: 1px dashed var(--border);
}

.card.explainer ol
{
    padding-left: 22px;
    margin: 0 0 12px;
}

.card.explainer li
{
    margin: 6px 0;
    color: var(--ink-soft);
}

.card.explainer .note
{
    font-style: italic;
    color: var(--ink-soft);
    margin: 0;
}

/*  Mode toggle (raster pair vs LAZ point cloud)                      */

.mode-tabs
{
    display: flex;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px;
    margin-bottom: 20px;
}

.mode-tab
{
    flex: 1;
    background: transparent;
    color: var(--ink-soft);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.mode-tab:hover
{
    color: var(--ink);
}

.mode-tab.active
{
    background: var(--accent);
    color: #1a1209;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 166, 35, 0.4);
}

.mode-panel.hidden
{
    display: none;
}

.panel-note
{
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--ink-soft);
    font-style: italic;
}

/*  Form                                                              */

form
{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-field
{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.15s;
}

.file-field:hover
{
    border-color: var(--accent);
}

.file-label
{
    font-weight: 600;
    color: var(--ink);
}

.file-hint
{
    font-size: 12px;
    color: var(--ink-soft);
}

input[type='file']
{
    margin-top: 8px;
    color: var(--ink-soft);
    font: inherit;
}

button
{
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
}

#submit-button
{
    background: var(--accent);
    color: #1a1209;
    font-size: 15px;
    padding: 12px 18px;
    align-self: flex-start;
}

#submit-button:hover
{
    background: var(--accent-soft);
}

#submit-button:disabled
{
    background: var(--surface-2);
    color: var(--ink-soft);
    cursor: not-allowed;
}

.secondary-button
{
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--border);
}

.secondary-button:hover
{
    border-color: var(--accent);
}

.copy-button
{
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 8px;
}

.copy-button:hover
{
    background: rgba(245, 166, 35, 0.1);
}

/*  Status section                                                    */

.status-row
{
    display: flex;
    gap: 16px;
    align-items: center;
}

.spinner
{
    width: 24px;
    height: 24px;
    border: 3px solid var(--surface-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin
{
    to { transform: rotate(360deg); }
}

.status-text
{
    flex: 1;
}

.status-text strong
{
    display: block;
    font-size: 15px;
    color: var(--ink);
}

#status-message
{
    color: var(--ink-soft);
    font-size: 13px;
    margin-top: 2px;
}

.job-id
{
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 6px;
    opacity: 0.6;
}

/*  Result section                                                    */

.result-block
{
    margin-bottom: 20px;
}

.result-block:last-child
{
    margin-bottom: 0;
}

.result-label
{
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.result-link
{
    display: block;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px;
    word-break: break-all;
    padding: 8px 10px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.result-meta
{
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 6px;
}

.snippet
{
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px 14px;
    margin: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/*  3D viewer (Three.js canvas + overlays)                            */

.viewer-wrap
{
    position: relative;
    width: 100%;
    height: 540px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

#viewer-canvas
{
    display: block;
    width: 100%;
    height: 100%;
}

.viewer-loading
{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    font-size: 13px;
    background: rgba(11, 13, 16, 0.75);
    pointer-events: none;
}

.viewer-stats
{
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 11px;
    color: var(--ink-soft);
    background: rgba(11, 13, 16, 0.8);
    padding: 4px 8px;
    border-radius: 3px;
    pointer-events: none;
}

.viewer-hint
{
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 6px;
    font-style: italic;
}

/*  Error section                                                     */

.error-message
{
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 4px;
    padding: 12px 14px;
    margin: 0 0 16px;
    color: var(--danger);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

/*  Footer                                                            */

footer
{
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--ink-soft);
    border-top: 1px solid var(--border);
}

footer .sep
{
    margin: 0 10px;
    color: var(--border);
}

code
{
    background: var(--code-bg);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px;
    color: var(--accent-soft);
}

@media (max-width: 540px)
{
    main { padding: 24px 16px; }
    h1 { font-size: 26px; }
    .card { padding: 16px; }
}
