/* ============================================
   PASTEBIN - common.css
   Reset, design tokens (CSS variables), and
   cross-context utility classes.
   Load order (AI.md PART 16): common -> components -> public
   ============================================ */

/* ============================================
   PASTEBIN - Professional UI Design System
   Modern, Clean, Professional Design
   ============================================ */

/* CSS Custom Properties - Design Tokens */
:root {
    /* Canonical palette (PART 16) — rendered server-side from
       src/common/theme/colors.go (theme.ThemePaletteDark), the single
       source of truth for color values shared across Web CSS, TUI,
       Swagger, and GraphQL (AI.md:24320). */
    --bg: #1a1b26;
    --fg: #c0caf5;
    --accent: #7aa2f7;

    /* Colors - Dark Theme (Default) */
    --color-bg-primary: #1a1b26;
    --color-bg-secondary: #1f2335;
    --color-bg-tertiary: #1a1b26;
    --color-bg-elevated: #24283b;
    --color-bg-hover: #414868;

    --color-text-primary: #c0caf5;
    --color-text-secondary: #c0caf5;
    --color-text-muted: #565f89;
    --color-text-inverse: #1a1b26;

    --color-accent-primary: #7aa2f7;
    --color-accent-secondary: #bb9af7;
    --color-accent-gradient: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
    --color-accent-hover: #7aa2f7;
    --color-accent-glow: rgba(137, 180, 250, 0.4);

    --color-success: #9ece6a;
    --color-warning: #e0af68;
    --color-error: #f7768e;
    --color-info: #7dcfff;

    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    --color-border-focus: var(--color-accent-primary);

    /* Text color rendered on top of accent / status fills */
    --color-on-accent: #ffffff;

    /* Translucent surface overlay used behind the sticky header */
    --color-surface-blur: rgba(30, 30, 46, 0.85);

    /* Tinted status / accent backgrounds (subtle fills) */
    --color-accent-tint: rgba(137, 180, 250, 0.1);
    --color-accent-tint-strong: rgba(137, 180, 250, 0.15);
    --color-success-tint: rgba(16, 185, 129, 0.15);
    --color-success-tint-soft: rgba(16, 185, 129, 0.1);
    --color-success-tint-12: rgba(16, 185, 129, 0.12);
    --color-info-tint: rgba(59, 130, 246, 0.15);
    --color-warning-tint: rgba(245, 158, 11, 0.15);
    --color-warning-tint-12: rgba(245, 158, 11, 0.12);
    --color-error-tint: rgba(239, 68, 68, 0.15);
    --color-error-tint-soft: rgba(239, 68, 68, 0.1);
    --color-error-tint-12: rgba(239, 68, 68, 0.12);
    --color-error-strong: #dc2626;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--color-accent-glow);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.5rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Auto Theme (PART 16, AI.md 23298): pure CSS — when the server renders
   html.theme-auto and the OS prefers light, override the dark-default tokens */
@media (prefers-color-scheme: light) {
    html.theme-auto {
        --bg: #ffffff;
        --fg: #1a1b26;
        --accent: #2e7de9;

        --color-bg-primary: #ffffff;
        --color-bg-secondary: #e9e9ec;
        --color-bg-tertiary: #ffffff;
        --color-bg-elevated: #f5f5f5;
        --color-bg-hover: #c0caf5;

        --color-text-primary: #1a1b26;
        --color-text-secondary: #1a1b26;
        --color-text-muted: #6172b0;
        --color-text-inverse: #ffffff;

        --color-accent-primary: #2e7de9;
        --color-accent-secondary: #7847bd;
        --color-accent-gradient: linear-gradient(135deg, #2e7de9 0%, #7847bd 100%);
        --color-accent-hover: #2e7de9;

        --color-success: #587539;
        --color-warning: #8c6c3e;
        --color-error: #c64343;
        --color-info: #007197;

        --color-border: rgba(0, 0, 0, 0.08);
        --color-border-hover: rgba(0, 0, 0, 0.15);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

        --color-surface-blur: rgba(255, 255, 255, 0.9);
    }
}

/* Light Theme (PART 16, AI.md 23277) — server renders class="theme-light" on <html> */
html.theme-light {
    --bg: #ffffff;
    --fg: #1a1b26;
    --accent: #2e7de9;

    --color-bg-primary: #ffffff;
    --color-bg-secondary: #e9e9ec;
    --color-bg-tertiary: #ffffff;
    --color-bg-elevated: #f5f5f5;
    --color-bg-hover: #c0caf5;

    --color-text-primary: #1a1b26;
    --color-text-secondary: #1a1b26;
    --color-text-muted: #6172b0;
    --color-text-inverse: #ffffff;

    --color-accent-primary: #2e7de9;
    --color-accent-secondary: #7847bd;
    --color-accent-gradient: linear-gradient(135deg, #2e7de9 0%, #7847bd 100%);
    --color-accent-hover: #2e7de9;

    --color-success: #587539;
    --color-warning: #8c6c3e;
    --color-error: #c64343;
    --color-info: #007197;

    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-hover: rgba(0, 0, 0, 0.15);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --color-surface-blur: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Base & Reset
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
}

a {
    color: var(--color-accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
}


/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Stagger animations */
.results-grid > * {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.results-grid > *:nth-child(1) { animation-delay: 0.05s; }
.results-grid > *:nth-child(2) { animation-delay: 0.1s; }
.results-grid > *:nth-child(3) { animation-delay: 0.15s; }
.results-grid > *:nth-child(4) { animation-delay: 0.2s; }
.results-grid > *:nth-child(5) { animation-delay: 0.25s; }
.results-grid > *:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }

/* ============================================
   Long String Utilities (PART 16)
   Required for IPv6, .onion, tokens, hashes, UUIDs, Base64
   ============================================ */
.long-string,
.ip-address,
.onion-address,
.api-token,
.hash,
.uuid,
.monospace-data {
    word-break: break-all;
    overflow-wrap: break-word;
    font-family: monospace;
}


/* ============================================
   Spacing Utilities
   ============================================ */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.d-block { display: block; }

/* ============================================
   Text Color Utilities
   ============================================ */
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }


/* ============================================
   Skip Link (WCAG 2.1 AA — PART 16)
   ============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 20000;
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent-primary);
    color: var(--color-on-accent);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}


/* ============================================
   Reduced Motion (WCAG 2.1 AA — PART 16)
   ============================================ */
@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;
    }
}

