/* Custom CSS for EIGRP.guru */

:root {
    --primary-color: #198754;
    --secondary-color: #6c757d;
    --success-color: #20c997;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Sidebar Styling */
.sidebar {
    height: calc(100vh - 56px);
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar .accordion-button {
    font-weight: 500;
    color: #495057;
    background-color: #f8f9fa;
    border: none;
    padding: 0.75rem 1rem;
}

.sidebar .accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .accordion-button:focus {
    box-shadow: none;
}

.sidebar .nav-link {
    color: #495057;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: #e9ecef;
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: #d1e7dd;
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Main Content Styling */
main {
    min-height: calc(100vh - 56px);
    padding-bottom: 2rem;
}

.content-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.content-section h1 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.content-section h2 {
    color: var(--dark-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section h3 {
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Code blocks and syntax highlighting */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Packet capture styling */
.packet-capture {
    background-color: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    overflow-x: auto;
}

.packet-hex {
    background-color: #2d3748;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    overflow-x: auto;
    line-height: 1.4;
}

.packet-hex .address {
    color: #ffd700;
}

.packet-hex .hex {
    color: #87ceeb;
}

.packet-hex .ascii {
    color: #98fb98;
}

/* Configuration examples */
.config-block {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
}

.config-block h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cisco-config {
    border-left-color: #1ba1e2;
}

.cisco-config pre code {
    color: #333;
}

.juniper-config {
    border-left-color: #84bd00;
}

/* Tables */
.table-responsive {
    margin: 1rem 0;
}

.table th {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.table td {
    vertical-align: middle;
}

/* Alerts and callouts */
.alert {
    border-radius: 5px;
    margin: 1rem 0;
}

.alert-tip {
    background-color: #d1e7dd;
    border-color: var(--success-color);
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #664d03;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

/* Interactive elements */
.interactive-tool {
    background-color: #f8f9fa;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.tool-input {
    margin-bottom: 1rem;
}

.tool-output {
    background-color: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    padding: 1rem;
    border-radius: 5px;
    min-height: 200px;
    overflow-y: auto;
}

/* Network diagram container */
.network-diagram {
    background-color: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    min-height: 400px;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #157347;
    border-color: #146c43;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #1aa179;
    border-color: #199473;
}

/* Right sidebar for ads */
aside {
    min-height: calc(100vh - 56px);
    padding: 1rem;
}

.ad-container {
    position: sticky;
    top: 1rem;
}

.ad-placeholder {
    text-align: center;
    margin-bottom: 2rem;
}

.ad-space {
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
    border-radius: 5px;
}

/* Progress bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #f8f9fa;
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        height: auto;
        position: static;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    .packet-capture,
    .packet-hex {
        font-size: 0.7rem;
    }
}

/* Bit field visualization */
.bit-field {
    display: flex;
    border: 2px solid #333;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.bit-field .field {
    border-right: 1px solid #333;
    padding: 0.5rem;
    text-align: center;
    background-color: #f8f9fa;
    min-width: 40px;
}

.bit-field .field:last-child {
    border-right: none;
}

.bit-field .field.reserved {
    background-color: #e9ecef;
    color: #6c757d;
}

.bit-field .field.important {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* EIGRP-specific badges */
.route-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.2rem;
}

.route-internal { background-color: #d1e7dd; color: #0f5132; }
.route-external { background-color: #f8d7da; color: #721c24; }
.route-summary { background-color: #fff3cd; color: #856404; }

/* Metric component visualization */
.metric-components {
    display: flex;
    justify-content: space-around;
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.metric-component {
    text-align: center;
    padding: 1rem;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
    margin: 0 0.5rem;
}

.metric-component h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Router state diagram */
.state-diagram {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.state {
    padding: 1rem;
    border-radius: 50%;
    background-color: white;
    border: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.state.active {
    background-color: var(--primary-color);
    color: white;
}

.state-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* DUAL algorithm visualization */
.dual-diagram {
    background-color: #f8f9fa;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.dual-step {
    display: inline-block;
    margin: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 150px;
}

.dual-step h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .sidebar,
    aside,
    .navbar,
    .progress-container {
        display: none !important;
    }
    
    main {
        width: 100% !important;
        max-width: none !important;
    }
    
    .content-section {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* EIGRP-specific styles */
.feasibility-condition {
    background-color: #d1e7dd;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.feasibility-condition h4 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.topology-table {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.topology-table h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.nav-buttons .btn {
    margin: 0 0.5rem;
}

@media (max-width: 768px) {
    .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }
}