/* ============================================================
   ConfigGuard Service Desk - Core Design System
   Dark theme CSS custom properties and base styles
   ============================================================ */

/* ---- Font Face ---- */
@font-face {
    font-family: 'HandelGothic';
    src: url('../fonts/handel.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================================
   CSS Custom Properties - Dark Theme
   ============================================================ */
:root {
    /* Background tiers (darkest to lightest) */
    --color-bg:          #0f1419;
    --color-bg-raised:   #1a1f2e;
    --color-bg-surface:  #232939;
    --color-bg-hover:    #2a3149;

    /* Borders */
    --color-border:       #2d3548;
    --color-border-light: #3a4560;

    /* Text hierarchy */
    --color-text:       #9ca3af;
    --color-text-muted: #6b7280;
    --color-text-faint: #4b5563;

    /* Brand colors (adjusted for dark bg) */
    --color-navy:      #4a7cc9;
    --color-navy-deep: #213969;
    --color-crimson:   #c42b1c;

    /* Semantic colors */
    --color-accent:  #58a6ff;
    --color-success: #3fb950;
    --color-warning: #d29922;
    --color-danger:  #f85149;
    --color-info:    #58a6ff;

    /* Typography */
    --font-brand: 'HandelGothic', 'Arial Black', sans-serif;
    --font-body:  Tahoma, Verdana, 'Segoe UI', sans-serif;
    --font-mono:  'SF Mono', Monaco, 'Cascadia Code', monospace;

    /* Spacing scale */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;

    /* Layout */
    --header-height: 56px;
    --sidebar-width: 240px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md:  0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.5);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* ============================================================
   Reset & Box Sizing
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

/* ============================================================
   Body
   ============================================================ */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ============================================================
   Scrollbar Styling (Webkit)
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a5568;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-light) var(--color-bg);
}

/* ============================================================
   Selection
   ============================================================ */
::selection {
    background-color: rgba(74, 124, 201, 0.35);
    color: var(--color-text);
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

h1 {
    font-size: 1.75rem;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

small {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--color-bg-surface);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
}

pre {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

pre code {
    background: none;
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-lg) 0;
}

/* ============================================================
   Links
   ============================================================ */
a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #79bfff;
    text-decoration: underline;
}

a:active {
    color: var(--color-navy);
}

/* ============================================================
   Lists
   ============================================================ */
ul, ol {
    padding-left: var(--space-xl);
    margin-bottom: var(--space-md);
}

li {
    margin-bottom: var(--space-xs);
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-muted   { color: var(--color-text-muted); }
.text-faint   { color: var(--color-text-faint); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger  { color: var(--color-danger); }
.text-crimson { color: var(--color-crimson); }
.text-navy    { color: var(--color-navy); }

.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.font-brand { font-family: var(--font-brand); }
.font-mono  { font-family: var(--font-mono); }

.mt-0  { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.ml-auto { margin-left: auto; }

.p-sm  { padding: var(--space-sm); }
.p-md  { padding: var(--space-md); }
.p-lg  { padding: var(--space-lg); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }

.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-block  { display: block; }
.d-inline { display: inline; }
.d-none   { display: none; }

.flex-column    { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.align-center   { align-items: center; }
.align-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.w-100  { width: 100%; }
.h-100  { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: 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: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
