/* ==========================================================================
   Sentinel Unity GRC - Design System
   Foundational tokens, typography, utilities, and accessibility
   ========================================================================== */

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

:root {
    /* Primary Brand Colors */
    --color-navy-primary: #1F3A5F;
    --color-navy-light: #2C4F7C;
    --color-blue-accent: #2563EB;
    --color-blue-hover: #1D4ED8;
    --color-blue-active: #1E40AF;
    --color-blue-50: #EFF6FF;
    --color-blue-100: #DBEAFE;
    --color-blue-300: #93C5FD;

    /* Neutral Grays */
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-900: #111827;

    /* Status Colors - Risk Severity */
    --color-red-critical: #DC2626;
    --color-red-50: #FEE2E2;
    --color-red-100: #FEE2E2;
    --color-amber-high: #F59E0B;
    --color-amber-50: #FFFBEB;
    --color-amber-100: #FEF3C7;
    --color-amber-600: #D97706;
    --color-blue-medium: #3B82F6;
    --color-gray-low: #6B7280;

    /* Status Colors - Operational */
    --color-green-success: #10B981;
    --color-green-50: #D1FAE5;
    --color-green-100: #D1FAE5;
    --color-green-600: #059669;
    --color-orange-warning: #F59E0B;
    --color-orange-600: #EA580C;

    /* Typography Scale */
    --font-family-heading: 'Poppins', sans-serif;
    --font-family-body: 'Inter', sans-serif;

    --font-size-page-title: 2.5rem;
    --font-size-section-heading: 1.75rem;
    --font-size-subsection: 1.25rem;
    --font-size-body: 1rem;
    --font-size-small: 0.875rem;
    --font-size-micro: 0.75rem;

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    /* Spacing Scale */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    --spacing-3xl: 3rem;
    --spacing-4xl: 4rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;

    /* Shadows */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-blue-glow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    --shadow-red-glow: 0 0 0 3px rgba(220, 38, 38, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-out;
    --transition-base: 200ms ease-out;
    --transition-slow: 300ms cubic-bezier(0.4, 0.0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* --------------------------------------------------------------------------
   Base Reset & Typography
   -------------------------------------------------------------------------- */

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

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

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: 1.6;
    color: var(--color-gray-900);
    background: var(--color-gray-50);
}

/* --------------------------------------------------------------------------
   Headings
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
    color: var(--color-navy-primary);
}

.page-title {
    font-size: var(--font-size-page-title);
    font-weight: var(--font-weight-semibold);
    color: var(--color-navy-primary);
    margin-bottom: var(--spacing-2xl);
}

.section-heading {
    font-size: var(--font-size-section-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--color-navy-primary);
    margin-bottom: var(--spacing-xl);
}

.subsection-heading {
    font-size: var(--font-size-subsection);
    font-weight: var(--font-weight-medium);
    color: var(--color-navy-primary);
    margin-bottom: var(--spacing-lg);
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

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

a:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--color-blue-300);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Focus States for Interactive Elements
   -------------------------------------------------------------------------- */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-blue-300);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* --------------------------------------------------------------------------
   Design-System Utility Classes
   Prefixed with `ds-` to avoid collisions with existing base.css utilities.
   -------------------------------------------------------------------------- */

.ds-text-primary { color: var(--color-navy-primary); }
.ds-text-blue { color: var(--color-blue-accent); }
.ds-text-gray-500 { color: var(--color-gray-500); }
.ds-text-gray-700 { color: var(--color-gray-700); }
.ds-text-gray-900 { color: var(--color-gray-900); }
.ds-text-red { color: var(--color-red-critical); }
.ds-text-green { color: var(--color-green-success); }
.ds-text-amber { color: var(--color-amber-high); }

.ds-bg-white { background-color: #FFFFFF; }
.ds-bg-gray-50 { background-color: var(--color-gray-50); }
.ds-bg-gray-100 { background-color: var(--color-gray-100); }
.ds-bg-blue-50 { background-color: var(--color-blue-50); }

.ds-font-medium { font-weight: var(--font-weight-medium); }
.ds-font-semibold { font-weight: var(--font-weight-semibold); }

.ds-shadow-subtle { box-shadow: var(--shadow-subtle); }
.ds-shadow-medium { box-shadow: var(--shadow-medium); }
.ds-shadow-strong { box-shadow: var(--shadow-strong); }

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

.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;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--color-blue-accent);
    color: white;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
}

.skip-link:focus {
    top: 8px;
    outline: 2px solid white;
    outline-offset: 2px;
    color: white;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Transitions
   -------------------------------------------------------------------------- */

.transition-base {
    transition: all var(--transition-base);
}

.transition-fast {
    transition: all var(--transition-fast);
}

/* --------------------------------------------------------------------------
   Scrollbar Styling (WebKit)
   -------------------------------------------------------------------------- */

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

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

::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* --------------------------------------------------------------------------
   Reduced Motion (Accessibility)
   -------------------------------------------------------------------------- */

@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;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    body {
        background: white;
        color: black;
    }

    .no-print,
    .sidebar,
    .topbar,
    button,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
}
