:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --primary: #2c3e50;
    --accent: #3498db; /* Network Blue */
    --accent-host: #27ae60; /* Host Green */
    --accent-mask: #e67e22; /* Mask Orange */
    --text-main: #333;
    --text-muted: #7f8c8d;
    --border: #e0e0e0;
    --radius: 8px;
    --font-mono: 'Fira Code', monospace;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* Navbar */
.navbar {
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    margin-left: 20px;
    font-weight: 500;
}

.nav-links a.active, .nav-links a:hover {
    color: var(--accent);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

.card.full-width {
    grid-column: 1 / -1;
}

/* Typography */
h1 { color: var(--primary); }
h2 { 
    margin-top: 0; 
    font-size: 1.2rem; 
    border-bottom: 2px solid var(--bg-color); 
    padding-bottom: 0.5rem;
    color: var(--primary);
}
.desc { font-size: 0.9rem; color: var(--text-muted); }

/* Inputs */
.input-group { margin-top: 1rem; }
.input-group label { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; }
.input-group .row { display: flex; align-items: center; gap: 10px; }
input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: var(--font-mono);
}
button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
button:hover { opacity: 0.9; }
button.btn-secondary { background: var(--text-muted); }

/* IP Calculator Visuals */
.result-box {
    margin-top: 1.5rem;
    background: #fafafa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid var(--accent);
}
.hidden { display: none; }

.calc-row {
    display: grid;
    grid-template-columns: 100px 160px 1fr;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 0.95rem;
    align-items: center;
}
.label { font-weight: bold; color: var(--text-muted); cursor: help; }
.mono { font-family: var(--font-mono); color: var(--primary); }
.binary-view { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 1px; }

.bit-1 { color: var(--accent); font-weight: bold; } /* Network bits */
.bit-0 { color: var(--accent-host); } /* Host bits */
.dot-sep { color: #ccc; }

.stats-row {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 20px;
}

/* Tooltips & Legend */
.legend { font-size: 0.8rem; margin-bottom: 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot.net { background: var(--accent); }
.dot.host { background: var(--accent-host); }

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
    white-space: nowrap;
    z-index: 10;
}

/* IP Table */
.scroll-box {
    max-height: 300px;
    overflow-y: auto;
}
.iptab-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.85rem; }
.iptab-table th { text-align: left; border-bottom: 1px solid #ccc; position: sticky; top: 0; background: #fff; }
.iptab-table td { padding: 4px 0; border-bottom: 1px solid #eee; }

/* Canvas Table */
.table-responsive { overflow-x: auto; margin-bottom: 1rem; }
#conceptTable { width: 100%; border-collapse: collapse; min-width: 800px; }
#conceptTable th, #conceptTable td { 
    border: 1px solid #ddd; 
    padding: 8px; 
    text-align: left; 
    font-size: 0.9rem; 
}
#conceptTable th { background: #eee; }
.delete-btn { background: #e74c3c; padding: 4px 8px; font-size: 0.8rem; }

/* Theory Page */
.doc-container { display: flex; gap: 2rem; }
.sidebar { flex: 0 0 250px; border-right: 1px solid #eee; height: fit-content; position: sticky; top: 80px; }
.sidebar ul { list-style: none; padding: 0; }
.sidebar li { margin-bottom: 10px; }
.sidebar a { text-decoration: none; color: var(--primary); }
.sidebar a:hover { color: var(--accent); }
.content { flex: 1; }
.content section { margin-bottom: 3rem; scroll-margin-top: 100px; }
.simple-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.simple-table th, .simple-table td { border: 1px solid #ddd; padding: 8px; text-align: left; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.info-list { list-style: none; padding: 0; }
.info-list li { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #eee; }
.info-list code { background: #eee; padding: 2px 5px; border-radius: 3px; font-family: var(--font-mono); color: var(--accent); }

/* Converter & Hex */
.big-output { font-size: 1.5rem; font-family: var(--font-mono); margin-top: 10px; color: var(--primary); word-break: break-all; }
.tabs { display: flex; margin-bottom: 10px; gap: 5px; }
.tab-btn { background: #eee; color: #333; flex: 1; }
.tab-btn.active { background: var(--accent); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.hex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; font-family: var(--font-mono); font-size: 0.8rem; }
.hex-item { background: #eee; padding: 5px; text-align: center; border-radius: 3px; }

footer{
	text-align: center;
}

@media (max-width: 768px) {
    .doc-container { flex-direction: column; }
    .sidebar { display: none; } /* Simplify on mobile */
}
