/**
 * StockEase Enterprise Documentation Stylesheet
 * =============================================
 * 
 * Purpose:
 *   Provides professional, responsive styling for the StockEase architecture documentation
 *   website. Implements a modern, accessible design with proper typography, navigation,
 *   and diagram rendering support.
 * 
 * Design System:
 *   - Color Palette: Custom CSS variables for consistent theming (--primary, --secondary, etc.)
 *   - Typography: System font stack for cross-platform consistency
 *   - Layout: CSS Grid for responsive two-column layout (sidebar + content)
 *   - Accessibility: WCAG 2.1 AA compliant color contrasts and semantic HTML support
 * 
 * Key Features:
 *   - Responsive design (desktop, tablet, mobile)
 *   - Professional header with gradient background
 *   - Sidebar navigation with active state indicators
 *   - Content area with proper spacing and readability
 *   - Mermaid diagram styling for architecture visualizations
 *   - Print-friendly styles
 *   - Code syntax highlighting support
 * 
 * Dependencies:
 *   - Mermaid.js v10 (for diagram rendering)
 *   - Modern CSS3 features (Grid, Variables, Gradients)
 * 
 * Last Updated: 2025-11-04
 * Generated by: CSS Refactoring (extract from enterprise-docs.html)
 */

/* ============================================================================
   CSS VARIABLES & ROOT STYLING
   ========================================================================= */

:root {
    /* Primary brand colors */
    --primary: #0066cc;
    --primary-dark: #004a99;
    --primary-light: #e6f0ff;
    
    /* Semantic colors */
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Text & backgrounds */
    --text: #212529;
    --text-light: #6c757d;
    --border: #dee2e6;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
}

/* ============================================================================
   GLOBAL STYLES & RESET
   ========================================================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    color: var(--text);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* ============================================================================
   HEADER & NAVIGATION
   ========================================================================= */
/* Sticky header with primary brand gradient, contains logo and breadcrumb */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

.nav-breadcrumb {
    font-size: 0.9rem;
    opacity: 0.9;
}

.nav-breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-breadcrumb a:hover {
    opacity: 0.8;
}

/* Main Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

/* Sidebar Navigation */
aside {
    padding: 2rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.nav-section ul {
    list-style: none;
}

.nav-section li {
    margin: 0.25rem 0;
}

.nav-section a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-section a:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.nav-section a.active {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.content {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Typography */
h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

h4, h5, h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Code */
code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: var(--danger);
}

pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

table thead {
    background-color: var(--primary);
    color: white;
}

table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

table tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

table tbody tr:hover {
    background-color: #f0f6ff;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-style: italic;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Alerts / Boxes */
.info-box, .warning-box, .success-box, .danger-box {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.info-box {
    background-color: #e7f3ff;
    border-color: var(--info);
    color: #004a87;
}

.warning-box {
    background-color: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.success-box {
    background-color: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.danger-box {
    background-color: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

/* TOC */
nav.toc {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

nav.toc ul {
    list-style: none;
    margin-left: 0;
}

nav.toc li {
    margin: 0.25rem 0;
}

nav.toc a {
    font-size: 0.95rem;
}

nav.toc > ul > li > a {
    font-weight: 600;
    color: var(--primary);
}

/* Footer */
footer {
    background-color: var(--text);
    color: white;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Syntax Highlighting (basic) */
.hljs-keyword { color: #569cd6; }
.hljs-string { color: #ce9178; }
.hljs-number { color: #b5cea8; }
.hljs-attr { color: #9cdcfe; }
.hljs-comment { color: #6a9955; font-style: italic; }

/* ===== MERMAID DIAGRAM STYLING ===== */
/* This is the critical section for mermaid rendering */

/* Main mermaid container styling */
.mermaid {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    background-color: var(--bg-white);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Pandoc generates language-mermaid class - convert to mermaid via JavaScript */
code.language-mermaid {
    display: block;
    background: transparent;
    padding: 0;
    margin: 2rem 0;
    border: none;
}

pre code.language-mermaid {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
}

pre.mermaid-block {
    background: transparent;
    border: none;
    padding: 0;
    margin: 2rem 0;
}

/* Mermaid SVG rendering */
.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    aside {
        order: 2;
    }

    main {
        order: 1;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-breadcrumb {
        font-size: 0.8rem;
    }

    .mermaid {
        margin: 1rem 0;
        padding: 0.5rem;
    }
}

/* Print Styles */
@media print {
    header, aside, footer {
        display: none;
    }

    .content {
        box-shadow: none;
        background: white;
    }

    .mermaid {
        page-break-inside: avoid;
    }
}
