/* ═══════════════════════════════════════════
   paste.marvindontpanic.com
   Clean, minimal paste service
   ═══════════════════════════════════════════ */

:root {
    --bg: #0f1117;
    --bg-surface: #181a22;
    --bg-elevated: #1e2028;
    --bg-hover: #252730;
    --border: #2a2d38;
    --border-focus: #3b82f6;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 8px;
    --radius-lg: 12px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Navbar ─────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    font-family: var(--font-mono);
}

.nav-dot {
    color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.nav-link:hover {
    color: var(--text);
}

/* ── Container ──────────────────────────── */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Buttons ────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: var(--font-sans);
}

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

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

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
}

/* ── Forms ──────────────────────────────── */

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s;
    outline: none;
}

textarea {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    resize: vertical;
    min-height: 200px;
}

input:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

input::placeholder, textarea::placeholder {
    color: var(--text-dim);
}

/* ── File Upload ────────────────────────── */

.form-group-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

input[type="file"] {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.15s;
}

.file-label:hover {
    border-color: var(--border-focus);
    color: var(--text);
}

.file-icon {
    font-size: 0.9rem;
}

.file-name {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Form Actions ───────────────────────── */

.form-actions {
    margin-top: 1.25rem;
}

.html-toggle {
    margin-top: -0.25rem;
}

.html-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.html-toggle input[type="checkbox"] {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: var(--accent);
}

.field-help {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.expiration-group {
    margin-top: 1rem;
}

.paste-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.paste-image figcaption {
    padding: 0.45rem 0.6rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paste-attachments {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.paste-attachments h2 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.paste-attachments ul {
    list-style: none;
}

.paste-attachments li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--border);
}

.paste-attachments li:first-child {
    border-top: none;
}

.paste-attachments a {
    color: #93c5fd;
    text-decoration: none;
    font-family: var(--font-mono);
    overflow-wrap: anywhere;
}

.paste-attachments span {
    color: var(--text-dim);
    white-space: nowrap;
}

/* ── Auth Container ─────────────────────── */

.auth-container {
    max-width: 360px;
    margin: 4rem auto 0;
}

.auth-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ── Create Container ───────────────────── */

.create-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

/* ── Alerts ─────────────────────────────── */

.alert {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* ── Paste Detail ───────────────────────── */

.paste-detail {
    animation: fadeIn 0.2s ease;
}

.paste-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.paste-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.paste-id {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
    font-size: 0.85rem;
}

.paste-card-header .paste-id {
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

.paste-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-text {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.badge-image {
    background: rgba(168, 85, 247, 0.12);
    color: #c4b5fd;
}

.badge-textimage {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.paste-image {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.paste-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.paste-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.btn-copy {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.btn-copy:active {
    transform: translateY(1px);
}

.btn-copy.copied {
    background: var(--success);
}

.btn-copy.copied:hover {
    background: var(--success);
}

.btn-copy.copy-failed {
    background: var(--danger);
}

.btn-copy.copy-failed:hover {
    background: var(--danger);
}

.btn-copy-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.paste-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.paste-content pre {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    color: var(--text);
    margin: 0;
}

/* ── Paste List ─────────────────────────── */

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.list-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.paste-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.paste-card {
    display: block;
    padding: 1rem 1.15rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}

.paste-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.paste-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.paste-card-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.paste-card-thumb {
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 120px;
}

.paste-card-thumb img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.paste-card-preview {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.65rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.paste-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.paste-slug {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ── Delete Buttons ─────────────────────── */

.inline-form {
    display: inline;
}

.btn-delete {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.5);
}

.paste-card-wrapper {
    position: relative;
}

.card-delete-form {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
}

.paste-card-wrapper:hover .card-delete-form {
    opacity: 1;
}

.btn-delete-card {
    background: var(--bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.btn-delete-card:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
}

/* ── Empty State ────────────────────────── */

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

/* ── Animation ──────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────── */

@media (max-width: 640px) {
    .container {
        padding: 1.25rem 1rem;
    }

    .navbar {
        padding: 0.65rem 1rem;
    }

    .paste-title {
        font-size: 1.25rem;
    }

    .paste-meta {
        flex-wrap: wrap;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
