/* pasted.ir — design tokens & global UI */

:root {
    --color-primary: #1e293b;
    --color-on-primary: #ffffff;
    --color-secondary: #334155;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-accent-muted: #dbeafe;
    --color-background: #f8fafc;
    --color-foreground: #0f172a;
    --color-muted: #f1f5f9;
    --color-border: #e2e8f0;
    --color-destructive: #ef4444;
    --color-ring: #2563eb;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent-primary: var(--color-accent);
    --accent-primary-hover: var(--color-accent-hover);
    --header-bg: rgba(255, 255, 255, 0.88);
    --shadow-color: rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -6px rgba(15, 23, 42, 0.06);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

.dark {
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-accent-muted: rgba(59, 130, 246, 0.15);
    --color-background: #0f172a;
    --color-foreground: #f8fafc;
    --color-muted: #1e293b;
    --color-border: #334155;

    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-primary: var(--color-accent);
    --accent-primary-hover: var(--color-accent-hover);
    --header-bg: rgba(15, 23, 42, 0.92);
    --shadow-color: rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 4px 10px -6px rgba(0, 0, 0, 0.2);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* subtle page backdrop */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--accent-primary) 8%, transparent), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, color-mix(in srgb, var(--color-primary) 5%, transparent), transparent);
}

/* theme utilities */
.bg-theme-primary { background-color: var(--bg-primary); }
.bg-theme-secondary { background-color: var(--bg-secondary); }
.bg-theme-tertiary { background-color: var(--bg-tertiary); }
.text-theme-primary { color: var(--text-primary); }
.text-theme-secondary { color: var(--text-secondary); }
.text-theme-accent { color: var(--accent-primary); }
.border-theme { border-color: var(--border-color); }

/* buttons */
.btn-primary,
.main-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--accent-primary);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
}
.btn-primary:hover,
.main-cta-btn:hover {
    background-color: var(--accent-primary-hover);
}
.btn-primary:focus-visible,
.main-cta-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
.btn-primary:active,
.main-cta-btn:active {
    transform: scale(0.98);
}

.btn-secondary,
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.btn-secondary:hover,
.nav-btn:hover {
    background-color: color-mix(in srgb, var(--bg-tertiary) 70%, var(--accent-primary));
    border-color: color-mix(in srgb, var(--border-color) 60%, var(--accent-primary));
}

/* shared inset panels (settings tiles, editor shell) */
.surface-panel {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-tertiary) 35%, var(--bg-primary));
    box-shadow: var(--shadow-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.surface-panel:hover {
    border-color: color-mix(in srgb, var(--border-color) 50%, var(--accent-primary));
}

/* cards */
.card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
    border-color: color-mix(in srgb, var(--border-color) 50%, var(--accent-primary));
}

/* badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.4;
}
.badge--muted {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}
.badge--accent {
    background-color: var(--color-accent-muted);
    color: var(--accent-primary);
}
.badge--warn {
    background-color: #fef3c7;
    color: #92400e;
}
.dark .badge--warn {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}
.badge--info {
    background-color: #e0f2fe;
    color: #0369a1;
}
.dark .badge--info {
    background-color: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}
.badge svg {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
}

/* feature icon circles */
.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: var(--color-accent-muted);
    color: var(--accent-primary);
    margin-inline: auto;
    margin-bottom: 1rem;
}
.feature-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* header & footer */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.logo-accent {
    color: var(--accent-primary);
}

/* nav active state */
.nav-link--active {
    background-color: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-tertiary)) !important;
    color: var(--accent-primary) !important;
    border: 1px solid color-mix(in srgb, var(--accent-primary) 25%, var(--border-color));
}

/* transitions */
a, button, input, textarea, select, .theme-toggle, .card {
    transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}

a { cursor: pointer; }

/* forms */
.hljs { background: transparent !important; }
pre {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}
input, textarea, select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 35%, transparent);
    border-color: var(--accent-primary);
}

/* theme toggle */
.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    border: none;
    padding: 0;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
.dark .theme-toggle {
    background-color: var(--bg-tertiary);
}

.theme-toggle-slider {
    position: absolute;
    top: 50%;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%);
}
.dark .theme-toggle-slider {
    transform: translateY(-50%) translateX(24px);
}

.theme-toggle-icon {
    width: 14px;
    height: 14px;
    color: #f59e0b;
}
html:not(.dark) .theme-toggle-icon--moon { display: none; }
html.dark .theme-toggle-icon--sun { display: none; }

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .theme-toggle {
        width: 58px;
        height: 30px;
    }
    .theme-toggle-slider {
        width: 26px;
        height: 26px;
    }
    .theme-toggle-icon {
        width: 16px;
        height: 16px;
    }
    .dark .theme-toggle-slider {
        transform: translateY(-50%) translateX(28px);
    }
}

/* terminal block */
.terminal-block {
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.terminal-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #171717;
    border-bottom: 1px solid #333;
}
.terminal-block__dots {
    display: flex;
    gap: 0.5rem;
    width: 4rem;
}
.terminal-block__dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}
.terminal-block__dot--red { background-color: #ff5f57; }
.terminal-block__dot--yellow { background-color: #ffbd2e; }
.terminal-block__dot--green { background-color: #28c840; }
.terminal-block__label {
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #a3a3a3;
}
.terminal-block__copy {
    color: #a3a3a3;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.terminal-block__copy:hover {
    color: #e5e5e5;
    background-color: rgba(255, 255, 255, 0.08);
}
.terminal-block__copy:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
.terminal-block__body {
    padding: 1.5rem;
    overflow-x: auto;
}
.terminal-block__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    color: #e5e5e5;
    white-space: nowrap;
}
.terminal-block__prompt {
    color: #737373;
    margin-right: 0.5rem;
}

/* hero CTA */
.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--accent-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-primary) 40%, transparent);
    cursor: pointer;
    transition: background-color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
}
.hero-cta:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent-primary) 45%, transparent);
}
.hero-cta:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}
.hero-cta:active {
    transform: translateY(0);
}

/* paste list items */
.paste-list-item {
    display: block;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color var(--transition-base), border-color var(--transition-base);
}
.paste-list-item:hover {
    background-color: var(--bg-tertiary);
    border-color: color-mix(in srgb, var(--border-color) 50%, var(--accent-primary));
}
.paste-list-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* history page rows */
.history-list-item {
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}
.history-list-item:hover {
    background-color: var(--bg-tertiary);
    border-color: color-mix(in srgb, var(--border-color) 50%, var(--accent-primary));
}

/* fullscreen textarea */
textarea.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    border-radius: 0;
    border-width: 0;
}
.exit-fullscreen-icon {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border: none;
}
textarea.fullscreen-mode + .exit-fullscreen-icon { display: flex; }

#mobileMenu.hidden { display: none; }

#app-outlet.is-loading {
    pointer-events: none;
}

/* skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    background: var(--accent-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
}
.skip-link:focus {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    overflow: visible;
}

/* SPA skeleton */
.spa-skeleton {
    padding: 1.5rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.spa-skeleton__bar {
    height: 1rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, color-mix(in srgb, var(--bg-tertiary) 60%, var(--border-color)) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    margin-bottom: 0.75rem;
}
.spa-skeleton__bar--title { width: 40%; height: 1.5rem; }
.spa-skeleton__bar--short { width: 55%; }
.spa-skeleton__block {
    height: 12rem;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    margin-top: 1rem;
}
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
    .spa-skeleton { animation: none; }
}

/* toasts */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}
.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}
.toast--visible {
    opacity: 1;
    transform: translateY(0);
}
.toast--success { border-color: #16a34a; background: color-mix(in srgb, #16a34a 12%, var(--bg-primary)); }
.toast--error { border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, var(--bg-primary)); }
.toast--info { border-color: var(--accent-primary); }

/* shortcuts modal */
.shortcuts-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}
.shortcuts-modal.hidden { display: none; }
.shortcuts-modal__panel {
    width: 100%;
    max-width: 28rem;
    padding: 1.5rem;
}
.shortcuts-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.shortcuts-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}
.shortcuts-modal__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.shortcuts-modal__list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}
.shortcuts-modal__list kbd {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    white-space: nowrap;
}

.shortcuts-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
}
.shortcuts-list dt { margin: 0; }
.shortcuts-list dd { margin: 0; color: var(--text-secondary); }
.shortcuts-list kbd {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-panel { width: 100%; max-height: 90vh; overflow-y: auto; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
