/* Blue-Purple Theme — Protocol/Network (HTTP, TCP/IP, WebSocket, DNS, gRPC) */
/* Copy this file into the tutorial project as "theme.css" */

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

body {
    background: linear-gradient(135deg, #eef2ff 0%, #dce4f8 100%);
    font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    padding: 20px;
}

/* === Layout === */
.double-border {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #818cf8;
    border-radius: 24px;
    box-shadow: 0 20px 30px -15px rgba(0,0,0,0.2), inset 0 1px 0 0 #eef2ff;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
}

/* === Sidebar === */
.sidebar {
    background: #f8faff;
    border-right: 2px solid #c7d2fe;
    padding: 24px 16px;
}

.sidebar h3 {
    font-size: 1.4rem;
    color: #4338ca;
    border-left: 5px solid #6366f1;
    padding-left: 15px;
    margin-bottom: 25px;
}

.chapter-list { list-style: none; }
.chapter-list li { margin-bottom: 6px; }

.chapter-list a {
    display: block; padding: 8px 12px; text-decoration: none;
    color: #334155; border-radius: 12px; transition: all 0.2s;
    font-weight: 500; font-size: 0.92rem;
}

.chapter-list a:hover {
    background: #e0e7ff;
    transform: translateX(3px);
}

.chapter-list .active {
    background: #6366f1;
    color: white;
    box-shadow: 0 2px 5px rgba(99,102,241,0.3);
}

/* === Main Content === */
.main-content { padding: 30px 35px; background: white; }

/* === Typography === */
h2 {
    color: #312e81;
    border-left: 6px solid #818cf8;
    padding-left: 15px;
    margin: 20px 0 15px;
    font-size: 1.5rem;
}

h3 {
    color: #3730a3;
    margin: 20px 0 10px;
    font-size: 1.2rem;
}

h4 {
    color: #4338ca;
    margin: 15px 0 8px;
    font-size: 1.05rem;
}

p { line-height: 1.85; margin: 10px 0; color: #1e293b; }
ul, ol { margin: 10px 0 10px 20px; line-height: 1.8; }
li { color: #1e293b; margin-bottom: 4px; }
strong { color: #1e1b4b; }

/* === Code === */
pre {
    background: #1e1b4b; color: #e8e8f0; padding: 15px; border-radius: 12px;
    overflow-x: auto; font-family: 'JetBrains Mono', 'Fira Code', monospace;
    margin: 15px 0; font-size: 0.9rem; line-height: 1.5;
}

code {
    background: #eef2ff; padding: 2px 6px; border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.85em;
}

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

/* === Tables === */
table {
    width: 100%; border-collapse: collapse; margin: 15px 0; background: #fafafe;
}

th, td {
    border: 1px solid #c7d2fe; padding: 10px; text-align: left;
}

th {
    background: #eef2ff; color: #3730a3; font-weight: 600;
}

/* === Callout Boxes === */
.tip {
    padding: 12px 18px; border-radius: 16px; margin: 15px 0; line-height: 1.7;
    background: #e0f2fe; border-left: 6px solid #0ea5e9;
}

.warning {
    padding: 12px 18px; border-radius: 16px; margin: 15px 0; line-height: 1.7;
    background: #fee2e2; border-left: 6px solid #ef4444;
}

.highlight {
    padding: 12px 18px; border-radius: 16px; margin: 15px 0; line-height: 1.7;
    background: #fef9c3; border: 1px solid #facc15;
}

/* === Footer Navigation === */
.footer-nav {
    margin-top: 45px; padding-top: 20px;
    border-top: 2px solid #e0e7ff;
    display: flex; justify-content: space-between;
}

.footer-nav a {
    padding: 8px 24px; background: #f1f5f9; text-decoration: none;
    color: #3730a3; border-radius: 40px; font-weight: 500; transition: 0.2s;
}

.footer-nav a:hover {
    background: #e0e7ff; transform: translateY(-2px);
}

/* === Responsive === */
@media (max-width: 768px) {
    .container { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 2px solid #c7d2fe; }
    body { padding: 10px; }
    .main-content { padding: 20px; }
}
