:root {
    --bg-color: #0b0e14;
    --sidebar-bg: rgba(17, 21, 28, 0.95);
    --text-color: #d1d5db;
    --accent-color: #4ade80;
    --accent-glow: rgba(74, 222, 128, 0.2);
    --code-bg: #1a1f26;
    --border-color: #2d3748;
    --header-bg: rgba(17, 21, 28, 0.8);
    --link-color: #60a5fa;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --purple-color: #8b5cf6;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Background Tinted Glass Effect - Fixed & Proportional */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('logo-echo-full.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 14, 20, 0.70); /* 70% Opacity Tint */
    z-index: -1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 1rem;
    z-index: 100;
}

.sidebar .logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.sidebar .logo-container img {
    max-width: 140px;
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

.sidebar h2 {
    color: var(--accent-color);
    font-size: 1rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

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

.sidebar nav ul li {
    margin-bottom: 0.5rem;
}

.sidebar nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

table a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
}

.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
    background-color: var(--accent-glow);
    color: var(--accent-color);
    border-color: rgba(74, 222, 128, 0.3);
    padding-left: 1.4rem;
}

/* Content Area */
main {
    flex: 1;
    margin-left: 310px;
    margin-right: 30px;
    padding: 3rem;
    max-width: 1200px;
    background: rgba(17, 21, 28, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

h1 {
    font-size: 2.8rem;
    color: #fff;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin: 3rem 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 2px;
}

h3 {
    font-size: 1.4rem;
    color: #fff;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

p {
    margin-bottom: 1.5rem;
    color: #cbd5e0;
    font-size: 1.05rem;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: #cbd5e0;
}

li {
    margin-bottom: 0.5rem;
}

/* Code Blocks */
pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

code {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.code-header {
    background: var(--border-color);
    color: #cbd5e0;
    padding: 0.4rem 1.2rem;
    font-size: 0.8rem;
    border-radius: 10px 10px 0 0;
    margin-bottom: -1.5rem;
    position: relative;
    z-index: 1;
    display: inline-block;
    font-weight: 600;
}

/* Audit & Info Blocks */
.audit-note {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.15), transparent);
    border-left: 5px solid var(--link-color);
    padding: 1.5rem;
    margin: 2.5rem 0;
    border-radius: 0 12px 12px 0;
}

.audit-note h4 {
    color: var(--link-color);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-note h4::before { content: "🔍"; }

.info-block {
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.1), transparent);
    border-left: 5px solid var(--accent-color);
    padding: 1.5rem;
    margin: 2.5rem 0;
    border-radius: 0 12px 12px 0;
}

.info-block h4 {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

th, td {
    text-align: left;
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--sidebar-bg);
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Diagrams 2.0 */
.diagram-container {
    background: rgba(26, 31, 38, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 2.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.diagram-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 2rem;
    position: relative;
}

.diagram-node {
    background: #11151c;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    min-width: 160px;
    max-width: 220px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    z-index: 5;
    transition: transform 0.2s;
}

.diagram-node:hover {
    transform: translateY(-5px);
}

.diagram-node h5 {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.diagram-node p {
    font-size: 0.8rem;
    margin-bottom: 0;
    color: #a0aec0;
    line-height: 1.3;
}

.diagram-arrow-v {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent-color), var(--accent-color));
    position: relative;
}

.diagram-arrow-v::after {
    content: "▼";
    position: absolute;
    bottom: -8px;
    left: -5.5px;
    font-size: 12px;
    color: var(--accent-color);
}

.diagram-arrow-h {
    height: 2px;
    flex: 1;
    max-width: 60px;
    background: var(--accent-color);
    position: relative;
}

.diagram-arrow-h.left::after {
    content: "◀";
    position: absolute;
    left: -8px;
    top: -6px;
    font-size: 12px;
    color: var(--accent-color);
}

.diagram-arrow-h.right::after {
    content: "▶";
    position: absolute;
    right: -8px;
    top: -6px;
    font-size: 12px;
    color: var(--accent-color);
}

.diagram-label {
    font-size: 0.7rem;
    color: var(--accent-color);
    position: absolute;
    top: -15px;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}

/* Thematic Node Styles */
.node-vault { border-color: var(--warning-color); }
.node-vault h5 { color: var(--warning-color); }
.node-vault .diagram-label { color: var(--warning-color); }

.node-filter { border-color: var(--link-color); }
.node-filter h5 { color: var(--link-color); }

.node-pipe { border-color: var(--purple-color); }
.node-pipe h5 { color: var(--purple-color); }

.node-danger { border-color: var(--danger-color); }
.node-danger h5 { color: var(--danger-color); }

/* HUD Demo */
.hud-demo {
    border: 1px solid #444;
    border-radius: 12px;
    background: #1a1a1a;
    overflow: hidden;
    margin: 2.5rem 0;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.hud-header {
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.hud-title {
    color: var(--accent-color);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}

footer {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    color: #718096;
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 240px; }
    main { margin-left: 270px; padding: 2rem; }
}

@media (max-width: 768px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    main { margin-left: 10px; margin-right: 10px; padding: 1.5rem; }
}

/* Grid and Cards for Hub Pages */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: rgba(30, 36, 48, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-color: var(--accent-color);
}

.card h3 {
    margin-top: 0;
    border-bottom: none;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.95rem;
    flex: 1;
}

.card .btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    font-weight: 500;
}

.card .btn:hover {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}
