/* =====================================================
   TESTIPHAI DESIGN SYSTEM
   Shared tokens, accessibility, and global fixes

   Include BEFORE page-specific <style> blocks:
   <link rel="stylesheet" href="components/design-system.css">
   ===================================================== */

/* =====================================================
   DESIGN TOKENS
   Extends existing :root variables — does NOT override
   per-page :root vars (void, abyss, deep, surface, etc.)
   ===================================================== */
:root {
    /* ---- Borders (standardized 3-tier system) ---- */
    --border-subtle: rgba(255,255,255,0.08);
    --border-normal: rgba(255,255,255,0.12);
    --border-active: rgba(255,255,255,0.2);

    /* ---- Elevated backgrounds ---- */
    --elevated: #1a2332;
    --glass-bg: rgba(255,255,255,0.03);
    --glass-bg-hover: rgba(255,255,255,0.06);
    --card-bg: rgba(255,255,255,0.08);

    /* ---- Stat / status colors ---- */
    --stat-green: #22c55e;
    --stat-red: #ef4444;
    --stat-yellow: #eab308;
    --stat-blue: #3b82f6;

    /* ---- Persona accent colors (canonical) ---- */
    --persona-riley: #ef4444;
    --persona-chris: #f97316;
    --persona-alex: #f97316;
    --persona-casey: #ec4899;
    --persona-morgan: #22c55e;
    --persona-jordan: #ef4444;
    --persona-judge: #eab308;
    --persona-eleanor: #a855f7;
    --persona-langley: #d4af37;

    /* ---- Button padding scale ---- */
    --btn-pad-sm: 10px 14px;
    --btn-pad-md: 14px 18px;
    --btn-pad-lg: 16px 20px;

    /* ---- Spacing scale ---- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 40px;

    /* ---- Border radius ---- */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* ---- Transitions ---- */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* ---- Shadow scale ---- */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}


/* =====================================================
   ACCESSIBILITY — Focus Visible
   ===================================================== */
*:focus-visible {
    outline: 2px solid var(--teal, #2dd4c0);
    outline-offset: 2px;
}

/* Remove outline for mouse clicks (still visible for keyboard) */
*:focus:not(:focus-visible) {
    outline: none;
}


/* =====================================================
   ACCESSIBILITY — Reduced Motion
   ===================================================== */
@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;
    }
}


/* =====================================================
   SCROLLBAR — Unified dark theme
   ===================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}


/* =====================================================
   RESPONSIVE BREAKPOINTS — Utility classes
   Hide elements at specific breakpoints without
   page-specific media queries
   ===================================================== */

/* Hide on tablet and below */
@media (max-width: 1024px) {
    .hide-tablet { display: none !important; }
}

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

/* Show only on mobile */
@media (min-width: 769px) {
    .show-mobile-only { display: none !important; }
}


/* =====================================================
   CASE DOCS PANEL — Responsive override
   Shared across all session + coach pages
   ===================================================== */
@media (max-width: 1024px) {
    .case-docs-panel {
        width: min(400px, calc(100vw - 48px)) !important;
    }
}

@media (max-width: 480px) {
    .case-docs-panel {
        width: 100vw !important;
        border-left: none !important;
    }
}
