﻿/* upload.css — Mobile-first; matches Directory/Feedback */
/* VS-friendly: no `text-wrap`; inputs >=16px to avoid iOS zoom */

:root {
    /* Brand */
    --blue-500: #1a73e8;
    --blue-600: #155cc7;
    --blue-800: #0f3a7a;
    /* Surfaces */
    --bg-900: #0b0d10;
    --bg-800: #101418;
    --bg-700: #141a20;
    /* Text */
    --silver-50: #f3f6fa;
    --silver-100: #e7edf5;
    --silver-300: #c9d3e2;
    --silver-500: #98a6bd;
    /* Misc */
    --border: rgba(255,255,255,0.08);
    --focus: #8ab4ff;
    --radius-8: 8px;
    --radius-12: 12px;
    --radius-16: 16px;
    --tap: 44px;
    --shadow-1: 0 2px 10px rgba(0,0,0,.35);
    --shadow-2: 0 8px 22px rgba(0,0,0,.45);
    /* Inline “Back to Directory” pill uses this color via inline style */
    --color-button-bg: var(--blue-600);
    /* App bar height (if present) */
    --appbar-h: 56px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-900);
    color: var(--silver-100);
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Safer wrapping without text-wrap */
h1, h2, h3, p, a, label {
    overflow-wrap: break-word;
    word-wrap: break-word
}

/* ===== App Bar (optional; add header markup if desired) ===== */
.appbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--appbar-h);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0 12px;
    background: linear-gradient(180deg, rgba(16,20,24,0.95), rgba(16,20,24,0.9));
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand__logo {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(120% 120% at 30% 30%, var(--blue-500), var(--blue-800));
    color: #fff;
    font-size: 16px;
    box-shadow: var(--shadow-1);
}

.brand__text {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .2px;
}

.brand__beta {
    font-size: 11px;
    color: var(--silver-300);
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-12);
}

.appbar__actions {
    display: flex;
    gap: 8px;
}

.btn {
    appearance: none;
    border: 1px solid rgba(138,180,255,.35);
    border-radius: var(--radius-12);
    min-height: calc(var(--tap) + 4px);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, rgba(26,115,232,.18), rgba(26,115,232,.12)), var(--blue-600);
    box-shadow: 0 8px 18px rgba(26,115,232,.18);
    transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

    .btn:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(26,115,232,.22);
    }

    .btn:active {
        transform: translateY(0);
    }

    .btn:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

.btn--ghost {
    color: var(--silver-100);
    background: rgba(255,255,255,.08);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

/* ===== Page Section ===== */
#upload-section {
    max-width: 820px;
    margin: 10px auto 0; /* space under sticky header if present */
    padding: clamp(14px, 4vw, 22px);
    display: grid;
    gap: 12px;
}

    #upload-section > h2 {
        margin: 4px 2px 10px;
        font-size: clamp(20px, 5vw, 24px);
        font-weight: 800;
        color: var(--silver-50);
    }

/* Upload Card */
.upload-card {
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-radius: var(--radius-16);
    box-shadow: var(--shadow-2);
    padding: clamp(12px, 3.6vw, 18px);
    display: grid;
    gap: 10px;
}

.card-label {
    display: block;
    font-weight: 700;
    color: var(--silver-100);
    margin: 0 0 4px;
    font-size: .98rem;
}

/* Controls */
input[type="file"],
select {
    width: 100%;
    min-height: var(--tap);
    background: var(--bg-700);
    color: var(--silver-100);
    border: 1px solid var(--border);
    border-radius: var(--radius-12);
    padding: 12px;
    font-size: 16px; /* ✅ prevent iOS zoom */
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

    select:focus, input[type="file"]:focus {
        border-color: rgba(138,180,255,.35);
        box-shadow: 0 0 0 2px rgba(138,180,255,.25);
    }

/* OR divider */
.or-divider {
    text-align: center;
    color: var(--silver-500);
    font-size: .95rem;
    margin: 4px 0;
}

/* Next button */
#next-btn {
    appearance: none;
    border: 1px solid rgba(138,180,255,.35);
    border-radius: var(--radius-12);
    min-height: calc(var(--tap) + 4px);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, rgba(26,115,232,.18), rgba(26,115,232,.12)), var(--blue-600);
    box-shadow: 0 8px 18px rgba(26,115,232,.18);
    transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

    #next-btn:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(26,115,232,.22);
    }

    #next-btn:active {
        transform: translateY(0);
    }

    #next-btn:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

/* Processed preview text */
#processed-preview {
    margin: 6px 2px 0;
    font-weight: 600;
    color: var(--silver-300);
}

/* Back to Directory */
#back-to-directory-container {
    text-align: center;
    margin-top: 1.25rem;
}

#back-to-directory-button {
    box-shadow: var(--shadow-1);
    border: 1px solid rgba(138,180,255,.30);
}

    #back-to-directory-button:hover {
        transform: translateY(-1px);
        filter: brightness(1.05);
    }

    #back-to-directory-button:active {
        transform: translateY(0);
    }

/* Light Mode */
@media (prefers-color-scheme: light) {
    :root {
        --bg-900: #ffffff;
        --bg-800: #f7f9fc;
        --bg-700: #ffffff;
        --border: rgba(0,0,0,0.08);
        --silver-50: #0b1220;
        --silver-100: #1b2436;
        --silver-300: #3b4b69;
        --silver-500: #6b7a96;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #next-btn, #back-to-directory-button, .btn {
        transition: none !important;
    }
}
