/* Tokyo Night inspired theme */
:root {
    --bg: #1a1b26;
    --bg-light: #24283b;
    --bg-lighter: #2f3349;
    --text: #c0caf5;
    --text-dim: #565f89;
    --accent: #7aa2f7;
    --accent-hover: #89b4fa;
    --green: #9ece6a;
    --red: #f7768e;
    --orange: #ff9e64;
    --purple: #bb9af7;
    --border: #3b4261;
    --radius: 8px;
}

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

html { overflow-x: hidden; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Nav */
nav {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav .brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav .brand:hover { color: var(--accent); text-decoration: none; }

nav .nav-links { display: flex; gap: 1rem; align-items: center; }

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Form elements */
textarea, input[type="text"], input[type="password"] {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.2s;
}

textarea:focus, input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 400px;
    resize: vertical;
    tab-size: 4;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group { flex: 1; margin-bottom: 0; }
.options-row { margin-bottom: 1.25rem; }
.encryption-group {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.1rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    color: var(--text);
    font-weight: 400;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--bg); }

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-danger {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: var(--bg); }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Paste view */
.paste-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.paste-slug {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--accent);
}

.paste-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.paste-content {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
}

/* Markdown rendered content */
.paste-content h1, .paste-content h2, .paste-content h3,
.paste-content h4, .paste-content h5, .paste-content h6 {
    color: var(--text);
    margin: 1.25rem 0 0.5rem;
    line-height: 1.3;
}

.paste-content h1 { font-size: 1.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.paste-content h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.paste-content h3 { font-size: 1.2rem; }

.paste-content p { margin: 0.75rem 0; }

.paste-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    background: var(--bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.paste-content pre {
    background: var(--bg) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.paste-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.paste-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-dim);
}

.paste-content ul, .paste-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.paste-content li { margin: 0.25rem 0; }

.paste-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.paste-content th, .paste-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.paste-content th { background: var(--bg); }

.paste-content img { max-width: 100%; border-radius: var(--radius); }

.paste-content a { color: var(--accent); }

.paste-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Encrypted notice */
.encrypted-notice {
    text-align: center;
    padding: 3rem 1rem;
}

.encrypted-notice .icon { font-size: 3rem; margin-bottom: 1rem; }
.encrypted-notice h2 { margin-bottom: 0.5rem; }
.encrypted-notice p { color: var(--text-dim); margin-bottom: 1.5rem; }

.key-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.key-input-group input { flex: 1; }

/* Curl helper */
.curl-help {
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(122, 162, 247, 0.08), rgba(36, 40, 59, 0.95));
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.curl-help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.curl-help h2 {
    font-size: 1.05rem;
    line-height: 1.2;
    color: var(--text);
}

.eyebrow {
    margin: 0 0 0.2rem;
    color: var(--purple);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.limit-pill {
    flex: 0 0 auto;
    background: rgba(158, 206, 106, 0.12);
    border: 1px solid rgba(158, 206, 106, 0.35);
    border-radius: 999px;
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.42rem 0.58rem;
    white-space: nowrap;
}

.curl-help p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.curl-help-copy {
    margin-bottom: 0.85rem;
}

.command-list {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.command-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    background: rgba(26, 27, 38, 0.82);
    border: 1px solid rgba(59, 66, 97, 0.9);
    border-radius: var(--radius);
    padding: 0.72rem 0.78rem;
}

.command-label {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.7;
}

.command-card code {
    min-width: 0;
    color: var(--green);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.curl-help .help-note {
    margin-bottom: 0;
}

.curl-help .help-note code {
    background: rgba(26, 27, 38, 0.9);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--green);
    padding: 0.08rem 0.3rem;
    white-space: nowrap;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-lighter);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* Error messages */
.error-msg {
    background: rgba(247, 118, 142, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
    nav {
        padding: 0.7rem 0.9rem;
        gap: 0.75rem;
    }
    nav .brand {
        min-width: 0;
        font-size: 0.98rem;
        overflow-wrap: anywhere;
    }
    nav .nav-links { flex: 0 0 auto; }
    nav .btn { padding: 0.48rem 0.7rem; }

    .container { padding: 0.9rem; }
    textarea {
        min-height: 260px;
        font-size: 0.82rem;
    }
    label { font-size: 0.84rem; }
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    .form-row .form-group,
    .encryption-group {
        width: 100%;
        flex: none;
        margin-bottom: 0;
    }
    .encryption-group {
        align-items: flex-start;
        padding-bottom: 0;
    }
    .checkbox-group {
        width: 100%;
        padding: 0.72rem;
        background: var(--bg-light);
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }
    .btn-group .btn,
    button.btn-primary {
        width: 100%;
        justify-content: center;
    }

    .curl-help {
        margin-top: 1.5rem;
        padding: 0.85rem;
        border-radius: var(--radius);
    }
    .curl-help-header {
        align-items: stretch;
        flex-direction: column;
        gap: 0.45rem;
    }
    .limit-pill {
        align-self: flex-start;
        font-size: 0.7rem;
    }
    .curl-help h2 { font-size: 1rem; }
    .curl-help-copy,
    .curl-help .help-note { font-size: 0.82rem; }
    .command-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
        padding: 0.65rem;
    }
    .command-label {
        font-size: 0.68rem;
        line-height: 1.2;
    }
    .command-card code {
        font-size: 0.72rem;
        line-height: 1.45;
    }

    .paste-header { flex-direction: column; align-items: flex-start; }
    .paste-slug { overflow-wrap: anywhere; }
    .key-input-group { flex-direction: column; }
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}
