/**
 * Main CSS - MichelTools.com
 * Global styles, variables, and base configurations
 */

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
    /* Primary Colors */
    --color-primary: #2563eb;          /* Primary Blue */
    --color-primary-light: #3b82f6;    /* Lighter Blue */
    --color-primary-dark: #1d4ed8;     /* Darker Blue */
    
    /* Secondary Colors */
    --color-secondary: #0d9488;        /* Secondary Teal */
    --color-secondary-light: #14b8a6;  /* Lighter Teal */
    --color-secondary-dark: #0f766e;   /* Darker Teal */
    
    /* Accent Colors */
    --color-accent: #f97316;           /* Accent Orange */
    --color-accent-light: #fb923c;     /* Lighter Orange */
    --color-accent-dark: #ea580c;      /* Darker Orange */
    
    /* Neutral Colors */
    --bg-white: #ffffff;               /* White Background */
    --bg-light: #f8fafc;              /* Light Gray Background */
    --bg-dark: #0f172a;               /* Dark Background */
    
    --text-primary: #1e293b;          /* Primary Text */
    --text-secondary: #64748b;        /* Secondary Text */
    --text-muted: #94a3b8;            /* Muted Text */
    --text-white: #ffffff;            /* White Text */
    
    --border-light: #e2e8f0;          /* Light Border */
    --border-medium: #cbd5e1;         /* Medium Border */
    --border-dark: #94a3b8;           /* Dark Border */
    
    /* Spacing System (Base unit: 4px) */
    --space-xs: 0.5rem;      /* 8px */
    --space-sm: 1rem;        /* 16px */
    --space-md: 1.5rem;      /* 24px */
    --space-lg: 2rem;        /* 32px */
    --space-xl: 3rem;        /* 48px */
    --space-2xl: 4rem;       /* 64px */
    --space-3xl: 6rem;       /* 96px */
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

/* ===== CSS Reset & Base Styles ===== */
*,
*::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-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* ===== Layout Utilities ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-wide {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ===== Section Styling ===== */
section {
    padding: var(--space-xl) 0;
}

section > .container {
    padding-top: 0;
    padding-bottom: 0;
}

section.light {
    background-color: var(--bg-white);
}

section.gray {
    background-color: var(--bg-light);
}

section.dark {
    background-color: var(--bg-dark);
    color: var(--text-white);
}

section.dark .text-primary {
    color: var(--text-white);
}

section.dark .text-secondary {
    color: var(--text-muted);
}

/* ===== Horizontal Rule ===== */
hr {
    border: none;
    height: 1px;
    background-color: var(--border-light);
    margin: var(--space-xl) 0;
}

 hr.section-divider {
    max-width: 200px;
    margin: var(--space-lg) auto;
    background: linear-gradient(
        90deg,
        transparent,
        var(--color-primary),
        transparent
    );
}

/* ===== Focus Styles for Accessibility ===== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== Selection Colors ===== */
::selection {
    background-color: var(--color-primary);
    color: var(--text-white);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--text-white);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== Skip Link for Accessibility ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: var(--text-white);
    padding: var(--space-sm);
    z-index: var(--z-modal);
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.skip-link:focus {
    top: 0;
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: var(--bg-white);
        color: var(--text-primary);
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .no-print {
        display: none !important;
    }
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

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

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}