/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #1a1b1e;
    --surface:   #25262b;
    --border:    #373a40;
    --text:      #c1c2c5;
    --text-dim:  #5c5f66;
    --accent:    #4dabf7;
    --accent-h:  #339af0;
    --danger:    #ff6b6b;
    --success:   #51cf66;
    --radius:    6px;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
    --font-ui:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
}

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

/* ── Header ── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--accent);
    text-decoration: none;
}

.paste-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn-primary, .btn-secondary, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.btn-primary, button[type="submit"] {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover, button[type="submit"]:hover {
    background: var(--accent-h);
    text-decoration: none;
    color: #fff;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
    text-decoration: none;
}
.btn-secondary:hover {
    background: #474a52;
    text-decoration: none;
    color: var(--text);
}

button[type="submit"] {
    padding: 8px 20px;
    font-size: 14px;
}
button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Main ── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── Create form ── */
#paste-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.select-group label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}
select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

textarea {
    width: 100%;
    min-height: 65vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    padding: 16px;
    resize: vertical;
    tab-size: 4;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea::placeholder { color: var(--text-dim); }

/* ── View paste ── */
#paste-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
}

#paste-container pre {
    margin: 0;
    padding: 0;
}

/* Override highlight.js container background to match our surface */
#paste-container pre code.hljs {
    background: var(--surface);
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.7;
    border-radius: var(--radius);
    display: block;
    overflow-x: auto;
}

/* Plain text (no hljs) */
#paste-container pre code {
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.7;
    display: block;
    padding: 20px;
    white-space: pre;
    overflow-x: auto;
}

/* ── Meta / status ── */
#paste-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.status-msg {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 0;
    font-size: 1rem;
}

.error-box {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 16px;
    font-size: 0.95rem;
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    padding: 4px 0;
}

/* ── Upload progress bar ── */
#upload-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.25s ease, background 0.2s ease;
}

.progress-bar-fill.progress-active     { background: var(--accent); }
.progress-bar-fill.progress-processing {
    background: var(--accent);
    animation: pulse-bar 0.9s ease-in-out infinite alternate;
}
.progress-bar-fill.progress-done       { background: var(--success); }
.progress-bar-fill.progress-error      { background: var(--danger); }

@keyframes pulse-bar {
    from { opacity: 1; }
    to   { opacity: 0.5; }
}

.progress-label {
    font-size: 12px;
    color: var(--text-dim);
}

/* ── Paste size counter ── */
.paste-size {
    font-size: 12px;
    color: var(--text-dim);
    text-align: right;
    user-select: none;
}

.paste-size.size-warn   { color: #fcc419; }
.paste-size.size-danger { color: var(--danger); font-weight: 600; }

/* ── Success panel ── */
.success-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.success-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--success);
}

.success-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: -4px;
}

.link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.url-input {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 7px 10px;
    cursor: text;
}
.url-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    width: fit-content;
    transition: color 0.15s;
}
.btn-ghost:hover { color: var(--text); }

/* ── Copy feedback ── */
.copy-ok { color: var(--success) !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
    header { padding: 0 14px; }
    main { padding: 16px 10px; }

    .form-controls {
        flex-direction: column;
        align-items: stretch;
    }
    select { min-width: unset; width: 100%; }
    button[type="submit"] { width: 100%; }

    .paste-nav { gap: 6px; }
    #paste-meta { width: 100%; order: -1; }

    .link-row { flex-direction: column; align-items: stretch; }
    .url-input { width: 100%; }
    .success-panel { padding: 20px 14px; }
}
