/* ==========================================================================
   PasteVault — design tokens
   ========================================================================== */
:root {
    /* Base slate scale (kept from original theme) */
    --bg-base: #0b1120;
    --bg-elevated: #0f172a;
    --surface: #1e293b;
    --surface-glass: rgba(30, 41, 59, 0.66);
    --border: #334155;
    --border-strong: #475569;
    --border-hairline: rgba(148, 163, 184, 0.12);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;

    /* Single accent identity: sky -> indigo aurora, used sparingly */
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --accent-alt: #818cf8;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);

    --danger: #ef4444;
    --danger-strong: #dc2626;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.12), 0 12px 32px -12px rgba(2, 6, 23, 0.65);
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 8px 24px -8px rgba(56, 189, 248, 0.35);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Reset & base
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-base);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    padding: 3rem 1.25rem;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   Signature element: ambient aurora glow (quiet, fixed, non-interactive)
   ========================================================================== */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    width: 46vw;
    height: 46vw;
    max-width: 620px;
    max-height: 620px;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.16;
    will-change: transform;
}

.aurora-blob-a {
    top: -14%;
    left: -8%;
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
    animation: drift-a 26s ease-in-out infinite;
}

.aurora-blob-b {
    bottom: -18%;
    right: -10%;
    background: radial-gradient(circle, #818cf8 0%, transparent 70%);
    animation: drift-b 30s ease-in-out infinite;
}

@keyframes drift-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(3%, 4%) scale(1.06); }
}

@keyframes drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-3%, -3%) scale(1.05); }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: 680px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-mark {
    color: initial;
    -webkit-text-fill-color: initial;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.45));
}

header p {
    margin-top: 0.4rem;
    color: var(--text-faint);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

/* ==========================================================================
   Card / glass surface
   ========================================================================== */
.card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Form controls
   ========================================================================== */
textarea {
    width: 100%;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

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

textarea:focus,
input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.controls label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.label-muted {
    color: var(--text-faint);
    font-weight: 400;
}

select,
input[type="text"],
input[type="password"] {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.1rem;
}

.password-row {
    margin-top: 0.9rem;
}

.password-row input[type="password"] {
    flex: 1;
    min-width: 0;
}

.hint {
    margin-top: 0.65rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-faint);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
button {
    font-family: var(--font-ui);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    box-shadow: var(--shadow-btn);
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease), opacity 0.15s var(--ease);
}

button:active {
    transform: translateY(1px);
}

button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
}

.primary-btn,
#create-btn {
    background: var(--accent-gradient);
    color: #f8fafc;
    box-shadow: var(--shadow-glow);
}

.primary-btn:hover,
#create-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 10px 28px -8px rgba(56, 189, 248, 0.45);
}

.ghost-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.ghost-btn:hover {
    background-color: rgba(148, 163, 184, 0.08);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.small-btn {
    padding: 0.32rem 0.7rem;
    font-size: 0.78rem;
}

.secondary-btn {
    background-color: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.danger-btn {
    background-color: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-top: 1.1rem;
}

.danger-btn:hover {
    background-color: var(--danger);
    border-color: var(--danger-strong);
    color: #fff;
}

/* Copy button success state */
.ghost-btn.copied {
    background-color: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}

/* ==========================================================================
   Result / meta blocks
   ========================================================================== */
.result-box {
    margin-top: 1.1rem;
    padding: 1.1rem;
    background-color: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-hairline);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.share-url {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.share-url input {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.paste-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-faint);
    margin-bottom: 0.85rem;
    font-variant-numeric: tabular-nums;
}

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

/* ==========================================================================
   Decrypt box
   ========================================================================== */
#decrypt-box p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

#decrypt-box .controls input[type="password"] {
    flex: 1;
    min-width: 0;
}

.error-text {
    color: #fca5a5;
    font-size: 0.82rem;
    margin-top: 0.65rem;
    font-weight: 500;
}

/* ==========================================================================
   Code toolbar + Prism container
   ========================================================================== */
.code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.code-toolbar-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-mono);
    color: #e2e8f0;
}

.hidden {
    display: none;
}

/* Prism.js overrides for clean, custom-scrollbar container integration */
pre[class*="language-"] {
    background-color: var(--bg-elevated) !important;
    border-radius: var(--radius-md);
    padding: 1.1rem;
    margin: 0.25rem 0;
    border: 1px solid var(--border-hairline);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    overflow-x: auto;
    max-height: 60vh;
}

code[class*="language-"] {
    font-family: var(--font-mono);
    font-size: 0.87rem;
    line-height: 1.6;
    text-shadow: none !important;
}

/* Custom scrollbar (WebKit) */
pre[class*="language-"]::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

pre[class*="language-"]::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: transparent;
}

pre[class*="language-"]::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

pre[class*="language-"]::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-strong);
    background-clip: padding-box;
}

/* Firefox scrollbar */
pre[class*="language-"],
textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ==========================================================================
   Burn-after-reading warning banner
   ========================================================================== */
.burn-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.burn-banner.hidden {
    display: none !important;
}

.burn-banner strong {
    color: #fca5a5;
}

/* ==========================================================================
   Toast notification (top-center, slide-down)
   ========================================================================== */
.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    z-index: 100;
    width: min(92vw, 460px);

    display: flex;
    align-items: flex-start;
    gap: 0.75rem;

    background: var(--surface-glass);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 24px 48px -16px rgba(2, 6, 23, 0.75), var(--shadow-glow);

    transform: translate(-50%, -140%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
}

.toast.toast-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

/* Kept for compatibility: `.hidden` fully removes it from flow while closed,
   `.toast-visible` (toggled by JS) drives the actual slide animation. */
.toast.hidden {
    display: none;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.toast-url-row {
    display: flex;
    gap: 0.5rem;
}

.toast-url-row input {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background-color: var(--bg-elevated);
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-faint);
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
    box-shadow: none;
}

.toast-close:hover {
    color: var(--text-primary);
    background-color: rgba(148, 163, 184, 0.1);
    border-radius: var(--radius-sm);
}

@media (max-width: 520px) {
    .toast {
        top: 1rem;
    }

    .toast-url-row {
        flex-direction: column;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 520px) {
    body {
        padding: 2rem 1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls label {
        margin-bottom: -0.35rem;
    }

    header h1 {
        font-size: 1.6rem;
    }
}