@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800;900&family=Outfit:wght@400;700&display=swap');

:root {
    --bg-base: #050510;
    --bg-surface: rgba(15, 17, 30, 0.65);
    --bg-surface-hover: rgba(25, 30, 50, 0.85);
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;

    --glow-blue: rgba(59, 130, 246, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding: 40px 8vw;
    overflow-x: hidden;
}

/* Glassmorphism Navigation / Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 50px;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
}

.title-section h1 {
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 0 0 20px var(--glow-blue);
}

.title-section p {
    color: var(--accent-blue);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.status-board {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.05);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.05);
}

/* Base Typography */
h2 {
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 2rem;
    margin-top: 60px;
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
}

h2::before {
    content: '';
    display: block;
    width: 12px;
    height: 30px;
    background: var(--accent-blue);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--glow-blue);
}

/* Glassmorphism Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.card, .nav-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.nav-card {
    overflow: hidden;
}

.nav-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 30px rgba(59, 130, 246, 0.15);
}

/* Card Glow Edges */
.nav-card::before, .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 16px 0 0 16px;
    transition: width 0.3s ease;
}

.nav-card:hover::before {
    width: 8px;
}

/* Card Specific Colors */
.pwr-card::before { background: var(--accent-gold); box-shadow: 0 0 15px var(--accent-gold); }
.pwr-card:hover { border-color: rgba(251, 191, 36, 0.5); }
.pwr-icon { color: var(--accent-gold); }

.md-card::before { background: var(--accent-red); box-shadow: 0 0 15px var(--accent-red); }
.md-card:hover { border-color: rgba(239, 68, 68, 0.5); }
.md-icon { color: var(--accent-red); }

.fss-card::before { background: var(--accent-purple); box-shadow: 0 0 15px var(--accent-purple); }
.fss-card:hover { border-color: rgba(139, 92, 246, 0.5); }
.fss-icon { color: var(--accent-purple); }

.gas-card::before { background: var(--accent-green); box-shadow: 0 0 15px var(--accent-green); }
.gas-card:hover { border-color: rgba(16, 185, 129, 0.5); }
.gas-icon { color: var(--accent-green); }

.sys-card::before { background: var(--accent-indigo); box-shadow: 0 0 15px var(--accent-indigo); }
.sys-card:hover { border-color: rgba(99, 102, 241, 0.5); }
.sys-icon { color: var(--accent-indigo); }

.str-card::before { background: var(--accent-cyan); box-shadow: 0 0 15px var(--accent-cyan); }
.str-card:hover { border-color: rgba(6, 182, 212, 0.5); }
.str-icon { color: var(--accent-cyan); }

.gate-card::before { background: var(--text-muted); box-shadow: 0 0 15px var(--text-muted); }
.gate-card:hover { border-color: rgba(148, 163, 184, 0.5); }
.gate-icon { color: var(--text-muted); }

/* Navigation Card Typography */
.nav-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.nav-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.nav-arrow {
    align-self: flex-end;
    margin-top: 20px;
    font-size: 1.2rem;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.nav-card:hover .nav-arrow {
    transform: translateX(5px);
}

/* Component Details Shared Styles */
.part-id { 
    color: var(--accent-blue); 
    font-family: 'Courier New', monospace; 
    font-weight: bold; 
    font-size: 1.1rem; 
}

.component-name { 
    font-size: 1.6rem; 
    font-family: 'Outfit', sans-serif;
    font-weight: 700; 
    color: #fff; 
    margin: 8px 0 15px 0; 
}

.spec-table { 
    width: 100%; 
    font-size: 0.9rem; 
    margin-top: 15px; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 15px; 
    border-collapse: collapse;
}

.spec-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.spec-table tr:last-child {
    border-bottom: none;
}

.spec-table td { 
    padding: 10px 0; 
}

.spec-label { 
    color: var(--text-muted); 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    font-size: 0.8rem;
    width: 45%; 
}

.notes {
    margin-top: 20px;
    font-size: 0.95rem;
    color: #cbd5e1;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid rgba(255,255,255,0.2);
}

.tag { 
    display: inline-block; 
    background: rgba(0,0,0,0.4); 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    border: 1px solid rgba(255,255,255,0.1); 
    margin-top: 20px; 
    font-weight: 600; 
    color: #fff;
    align-self: flex-start;
}

/* Page Navigation Link back to index */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #fff;
}

/* Mermaid Wrapper */
.mermaid-container {
    background: rgba(10, 15, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 30px rgba(59, 130, 246, 0.05);
    overflow-x: auto;
}

/* Global Tables */
.data-table-wrap { 
    overflow-x: auto; 
    background: var(--bg-surface); 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    margin: 30px 0; 
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
}

.data-table th, .data-table td { 
    padding: 18px 25px; 
    text-align: left; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}

.data-table th { 
    background: rgba(0,0,0,0.4); 
    color: var(--accent-blue); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 0.85rem; 
    font-weight: 700;
}

.data-table tr:hover { 
    background: rgba(59, 130, 246, 0.08); 
}

.critical-alert { 
    color: var(--accent-red); 
    font-weight: bold; 
    text-transform: uppercase; 
    animation: pulse 2s infinite; 
}

@keyframes pulse { 
    0% { opacity: 1; text-shadow: 0 0 5px var(--accent-red); } 
    50% { opacity: 0.5; text-shadow: none; } 
    100% { opacity: 1; text-shadow: 0 0 5px var(--accent-red); } 
}

footer { 
    margin-top: 100px; 
    padding: 40px 0; 
    border-top: 1px solid var(--border-color); 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    letter-spacing: 1px;
}
