/**
 * Section2-Systems Specific Styles
 * System architecture, performance metrics, database internals
 */

/* Section2 Theme Colors */
:root {
    --section2-primary: #10b981;
    --section2-secondary: #059669;
    --section2-accent: #0891b2;
}

/* Override primary colors for Systems section */
.systems-section {
    --primary: var(--section2-primary);
    --primary-light: #34d399;
    --accent-purple: var(--section2-accent);
}

/* System Architecture Diagrams */
.system-diagram {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid var(--section2-primary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

/* Performance Metrics Tables */
.perf-table th {
    background: linear-gradient(135deg, var(--section2-primary) 0%, var(--section2-secondary) 100%);
    color: white;
}

.perf-metric {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.perf-good { color: var(--section2-primary); }
.perf-warning { color: #f59e0b; }
.perf-bad { color: #ef4444; }

/* Storage Engine Visualizations */
.storage-block {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
}

.storage-block.btree {
    border-left: 4px solid #3b82f6;
}

.storage-block.lsm {
    border-left: 4px solid #8b5cf6;
}

.storage-block.hash {
    border-left: 4px solid #f59e0b;
}

/* Query Plan Visualization */
.query-plan {
    font-family: 'JetBrains Mono', monospace;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.query-plan .operation {
    color: #34d399;
    font-weight: 600;
}

.query-plan .cost {
    color: #fbbf24;
}

.query-plan .rows {
    color: #60a5fa;
}

/* Transaction States */
.transaction-state {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.transaction-state.active {
    background: #dcfce7;
    color: #166534;
}

.transaction-state.committed {
    background: #dbeafe;
    color: #1e40af;
}

.transaction-state.aborted {
    background: #fee2e2;
    color: #991b1b;
}

/* Index Type Badges */
.index-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;
}

.index-badge.btree { background: #3b82f6; color: white; }
.index-badge.hash { background: #f59e0b; color: white; }
.index-badge.gin { background: #8b5cf6; color: white; }
.index-badge.gist { background: #ec4899; color: white; }

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

.metric-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--section2-primary);
}

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

/* Code blocks for system configs */
.config-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.config-key {
    color: var(--section2-primary);
    font-weight: 600;
}

.config-value {
    color: #0891b2;
}

/* Collapsible Navigation Sections */
.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(16, 185, 129, 0.05);
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--section2-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;
}

.nav-subsection {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 0.25rem;
}

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

.nav-subsection .nav-link {
    font-size: 0.875rem;
    padding: 0.4rem 1.5rem 0.4rem 3rem;
}

/* Quiz links in subsections should have same padding as other subsection links */
.nav-subsection .nav-link.nav-quiz {
    padding-left: 3rem;  /* Same as other subsection links */
}

/* Tagline Box Styling */
.tagline-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #f0fdf4 100%);
    border: 1px solid #86efac;
    color: #14532d;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.08);
    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(16, 185, 129, 0.15);
    border-color: #4ade80;
}

.tagline-box::before {
    content: "⚙️";
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.15;
}

.tagline-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #14532d;
}

.tagline-box p {
    margin: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #166534;
}

.tagline-box .tagline-subtitle {
    font-size: 0.9rem;
    color: #15803d;
    font-style: italic;
}

.tagline-box a {
    color: #059669;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.tagline-box a:hover {
    color: #047857;
    text-decoration-thickness: 2px;
}

/* Compact version for other pages */
.tagline-box.compact {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #fafbfc 0%, #f0fdf4 100%);
}

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

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

.tagline-box.compact::before {
    font-size: 2rem;
    right: 1.5rem;
}