/**
 * Shared Components Styles
 * Unified styling for codebase components using CSS variables for theming
 */

/* Standard Theme Variables defining defaults, which can be overridden by section classes */
:root {
    --primary: #3b82f6;        /* Default blue */
    --primary-light: #60a5fa;
    --accent-purple: #8b5cf6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
}

/* System overrides */
.systems-section {
    --primary: #10b981;
    --primary-light: #34d399;
    --accent-purple: #0891b2;
}

/* Transactions overrides */
.transactions-section {
    --primary: #8b5cf6;
    --primary-light: #a855f7;
    --accent-purple: #7c3aed;
}

/* Distributed overrides */
.distributed-section {
    --primary: #0284c7;
    --primary-light: #38bdf8;
    --accent-purple: #0ea5e9;
}

/* Tagline Box - Prominent callout for key concepts */
.tagline-box {
    background: linear-gradient(135deg, rgba(240, 249, 255, 0.5) 0%, rgba(224, 242, 254, 0.8) 50%, rgba(240, 249, 255, 0.5) 100%);
    border: 1px solid var(--primary-light);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tagline-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}



.tagline-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.tagline-box p {
    margin: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Compact version for inline callouts */
.tagline-box.compact {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}

.tagline-box.compact h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.tagline-box.compact p {
    font-size: 0.9rem;
    margin: 0.25rem 0;
}




/* Navigation Subsection Styling */
.nav-subsection {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 0rem;
}

.nav-subsection h4 {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0.3rem 0 0.15rem 0;
    padding-left: 2rem;
}

.nav-subsection .nav-link {
    font-size: 0.875rem;
    padding: 0.25rem 1.5rem 0.25rem 3rem;
    line-height: 1.3;
}


/* SQL Code Blocks - Dark theme */
pre {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    color: #e6edf3;
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    margin: 1.5rem auto;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    max-width: 850px;
    position: relative;
    transition: all 0.3s ease;
}

pre:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15),
        0 0 60px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: var(--primary-light);
}

/* Data blocks label */
pre::before {
    content: 'CODE';
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 10px;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Disable generic CODE label globally if we prefer specific ones, for now lets leave it as CODE or default depending on what was there */


/* Inline Code */
code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
}

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


/* Slides mode overrides */
body.slides-mode pre {
    font-size: 20px;
    padding: 2rem 2.5rem;
    max-width: 90%;
    margin: 2rem auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(0, 0, 0, 0.15);
}

/* SQL Syntax Highlighting - High contrast dark theme */
.sql-keyword { color: #79c0ff; font-weight: 600; }
.sql-string { color: #a5d6ff; }
.sql-number { color: #ff7b72; }
.sql-operator { color: #c9d1d9; }
.sql-comment {
    color: #f0ad4e;
    font-weight: normal;
    background: rgba(240, 173, 78, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    text-shadow: 0 0 1px rgba(240, 173, 78, 0.2);
}
.sql-function { color: #d2a8ff; font-weight: 500; }
.sql-table { color: #7ee787; font-weight: 600; }

/* Visual Components (from Systems and Transactions) */

/* Stat Grids */
.stat-grid, .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card, .metric-card {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover, .metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-value, .metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label, .metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* Collapsible Navigation Headers */
.nav-section-header.collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
    padding: 0.5rem 1.5rem;
    margin: 0 -1.5rem;
}

.nav-section-header.collapsible:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--primary);
}

.nav-section-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.nav-subsections {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.nav-subsections.collapsed {
    max-height: 0;
    opacity: 0;
}


/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--primary);
    color: white;
}


/* Image Utility Classes */
.expandable-image-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.zoomable-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoomable-image.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 2000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}


/* Side-by-Side Layout Utilities */
.side-by-side-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    align-items: start;
}

.side-by-side-wrapper.ratio-1-2 {
    grid-template-columns: 1fr 2fr;
}

.side-by-side-wrapper.ratio-2-1 {
    grid-template-columns: 2fr 1fr;
}

@media (max-width: 768px) {
    .side-by-side-wrapper, .side-by-side-wrapper.ratio-1-2, .side-by-side-wrapper.ratio-2-1 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* =====================================================
   IMAGE MODAL / LIGHTBOX
   ===================================================== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 95%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10001;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #f1f1f1;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
}
