/* ===========================================
   UEC vs RDMA Documentation - Main Styles
   =========================================== */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #151d2e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-cyan: #22d3ee;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    --accent-pink: #ec4899;
    --border-color: #1e293b;
    --glow-cyan: rgba(34, 211, 238, 0.3);
    --glow-blue: rgba(59, 130, 246, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===========================================
   Header & Navigation
   =========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

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

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav { display: flex; gap: 1.5rem; }

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.header-nav a:hover { 
    color: var(--accent-cyan); 
    background: rgba(34, 211, 238, 0.1); 
}

/* ===========================================
   Sidebar / Table of Contents
   =========================================== */
.main-container { display: flex; margin-top: 60px; }

.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem 0;
}

.toc-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 1.25rem;
    margin-bottom: 0.75rem;
}

.toc-list { list-style: none; }

.toc-link {
    display: block;
    padding: 0.4rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.toc-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-left-color: var(--accent-cyan);
}

.toc-link.active {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.1);
    border-left-color: var(--accent-cyan);
}

.toc-link.sub { padding-left: 2rem; font-size: 0.75rem; }
.toc-link.sub2 { padding-left: 2.75rem; font-size: 0.7rem; color: var(--text-muted); }

/* ===========================================
   Main Content Area
   =========================================== */
.content {
    margin-left: 260px;
    flex: 1;
    min-height: calc(100vh - 60px);
}

/* ===========================================
   Hero Section
   =========================================== */
.hero {
    position: relative;
    padding: 5rem 4rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.hero-content { position: relative; max-width: 1000px; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-cyan);
    margin-bottom: 1.25rem;
}

.hero-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 1.5rem;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ===========================================
   Sections
   =========================================== */
.section {
    padding: 3.5rem 4rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header { margin-bottom: 2.5rem; }

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-bottom: 0.4rem;
}

.section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.section-desc {
    color: var(--text-secondary);
    max-width: 800px;
}

/* ===========================================
   Cards
   =========================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

.card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.card h4:first-child { margin-top: 0; }

.card p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* ===========================================
   Comparison Cards
   =========================================== */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.comparison-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.comparison-card.rdma { border-top: 3px solid var(--accent-orange); }
.comparison-card.uec { border-top: 3px solid var(--accent-cyan); }
.comparison-card.nvme { border-top: 3px solid var(--accent-purple); }
.comparison-card.storage { border-top: 3px solid var(--accent-green); }

.comparison-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.comparison-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comparison-title .tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.rdma .tag { background: rgba(249, 115, 22, 0.2); color: var(--accent-orange); }
.uec .tag { background: rgba(34, 211, 238, 0.2); color: var(--accent-cyan); }
.nvme .tag { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }
.storage .tag { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }

.comparison-body { padding: 1.5rem; }

/* ===========================================
   Feature Lists
   =========================================== */
.feature-list { list-style: none; }

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-item:last-child { border-bottom: none; }

.feature-icon {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.7rem;
}

.feature-icon.good { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.feature-icon.bad { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.feature-icon.neutral { background: rgba(234, 179, 8, 0.15); color: var(--accent-yellow); }

.feature-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    margin-top: 0;
}

.feature-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================================
   Diagrams
   =========================================== */
.diagram-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.diagram-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diagram-title::before {
    content: '';
    width: 10px; height: 10px;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    border-radius: 3px;
}

.diagram-svg { width: 100%; max-width: 100%; }

/* ===========================================
   Tables
   =========================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

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

.data-table th {
    background: var(--bg-tertiary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:hover td { background: var(--bg-tertiary); }
.data-table .mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }

/* ===========================================
   Badges
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge.yellow { background: rgba(234, 179, 8, 0.15); color: var(--accent-yellow); }
.badge.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge.cyan { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); }
.badge.orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.badge.purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.badge.pink { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }

/* ===========================================
   Code Blocks
   =========================================== */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    line-height: 1.6;
}

.code-comment { color: var(--text-muted); }
.code-keyword { color: var(--accent-purple); }
.code-function { color: var(--accent-cyan); }
.code-string { color: var(--accent-green); }
.code-number { color: var(--accent-orange); }

/* ===========================================
   Highlight Boxes
   =========================================== */
.highlight-box {
    padding: 1.25rem;
    border-radius: 8px;
    margin: 1.25rem 0;
}

.highlight-box.info { background: rgba(59, 130, 246, 0.1); border-left: 4px solid var(--accent-blue); }
.highlight-box.warning { background: rgba(234, 179, 8, 0.1); border-left: 4px solid var(--accent-yellow); }
.highlight-box.success { background: rgba(16, 185, 129, 0.1); border-left: 4px solid var(--accent-green); }
.highlight-box.danger { background: rgba(239, 68, 68, 0.1); border-left: 4px solid var(--accent-red); }
.highlight-box.purple { background: rgba(168, 85, 247, 0.1); border-left: 4px solid var(--accent-purple); }

.highlight-box h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    margin-top: 0;
}

.highlight-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================================
   Grid Layouts
   =========================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* ===========================================
   Metric Cards
   =========================================== */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.metric-value.cyan { color: var(--accent-cyan); }
.metric-value.orange { color: var(--accent-orange); }
.metric-value.green { color: var(--accent-green); }
.metric-value.purple { color: var(--accent-purple); }
.metric-value.pink { color: var(--accent-pink); }

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===========================================
   Animations
   =========================================== */
.animate-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 2s ease-in-out forwards;
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

.pulse-dot {
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { r: 4; opacity: 1; }
    50% { r: 6; opacity: 0.7; }
}

.flow-packet {
    animation: flowMove 3s linear infinite;
}

@keyframes flowMove {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(600px); opacity: 0; }
}

/* ===========================================
   Footer
   =========================================== */
.footer {
    padding: 3rem 4rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer .sub {
    font-size: 0.7rem;
    margin-top: 0.4rem;
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (max-width: 1400px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1200px) {
    .sidebar { display: none; }
    .content { margin-left: 0; }
    .comparison-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero { padding: 2.5rem 1.5rem; }
    .hero h1 { font-size: 1.75rem; }
    .section { padding: 2rem 1.5rem; }
    .hero-stats { flex-direction: column; gap: 1rem; }
    .grid-4 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
}
