@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-subtle: #1a1a1a;
    --border: #262626;
    --border-subtle: #1f1f1f;
    --text: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 8px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    color-scheme: dark;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

.container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

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

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 2.5rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--text);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon svg {
    width: 18px;
    height: 18px;
    color: var(--bg);
}

.brand h1 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand a {
    text-decoration: none;
    color: inherit;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: -1.75rem;
    margin-bottom: 2rem;
    margin-left: 42px;
}

/* Header bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 14px;
    height: 14px;
}

.btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

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

.btn-large {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* Editor */
.name-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.15s;
}

.name-input:focus {
    outline: none;
    border-color: var(--text-muted);
}

.name-input::placeholder {
    color: var(--text-muted);
}

.editor {
    width: 100%;
    min-height: 320px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    padding: 1rem;
    resize: vertical;
    transition: border-color 0.15s;
    tab-size: 4;
}

.editor:focus {
    outline: none;
    border-color: var(--text-muted);
}

.editor::placeholder {
    color: var(--text-muted);
}

/* Editor toolbar */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    gap: 0.75rem;
}

.editor-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.kbd {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kbd kbd {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
}

.paste-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

/* Cooldown timer */
.cooldown-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.cooldown-timer svg {
    width: 14px;
    height: 14px;
}

/* Paste meta */
.paste-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.paste-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.paste-meta-item svg {
    width: 14px;
    height: 14px;
}

.paste-meta-item code {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Paste content */
.paste-content-wrapper {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.paste-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.paste-content-header span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.paste-content {
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    counter-reset: line;
    tab-size: 4;
}

.paste-content .line {
    display: block;
}

.paste-content .line::before {
    counter-increment: line;
    content: counter(line);
    display: inline-block;
    width: 2em;
    margin-right: 1em;
    text-align: right;
    color: var(--text-muted);
    opacity: 0.4;
    user-select: none;
    font-size: 11px;
}

/* Result card */
.result-card {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: none;
    animation: slideUp 0.2s ease-out;
}

.result-card.visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.result-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    word-break: break-all;
}

.result-link:hover {
    color: var(--accent);
}

.result-link svg {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

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

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--text);
    color: var(--bg);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    animation: toastIn 0.2s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.toast.toast-out {
    animation: toastOut 0.15s ease-in forwards;
}

.toast svg {
    width: 14px;
    height: 14px;
}

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

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

/* Loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.5;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 2rem 1rem;
    }

    .subtitle {
        margin-left: 0;
        margin-top: -1.5rem;
    }

    .editor {
        min-height: 240px;
    }

    .header-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .paste-content .line::before {
        width: 1.5em;
        margin-right: 0.75em;
    }

    .kbd {
        display: none;
    }

    .editor-stats {
        font-size: 0.6875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

::selection {
    background: var(--accent);
    color: white;
}
