body {
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 15px;
    background: #0a0a0a;
    color: #00ff00;
    min-height: 100vh;
    font-size: 13px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: #000;
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ffff;
    font-size: 24px;
}

.network-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.sender-stack, .receiver-stack {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    background: #111;
}

.sender-stack { border-color: #ff6b6b; }
.receiver-stack { border-color: #4ecdc4; }

.layer {
    background: #1a1a1a;
    border: 1px solid #333;
    margin: 8px 0;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.layer-header {
    background: #333;
    padding: 8px 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* cursor: pointer; */ /* Can be enabled if content is collapsible */
}

.layer-content {
    padding: 10px;
    max-height: 250px; /* Increased for more content */
    overflow-y: auto;
}
/* Scrollbar styling */
.layer-content::-webkit-scrollbar { width: 8px; }
.layer-content::-webkit-scrollbar-track { background: #222; }
.layer-content::-webkit-scrollbar-thumb { background: #555; border-radius: 4px;}
.layer-content::-webkit-scrollbar-thumb:hover { background: #777; }


.layer.active {
    border-color: #ffff00;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
}

.layer.active .layer-header {
    background: #ffff00;
    color: #000;
}

.application { border-left: 4px solid #e74c3c; }
.transport { border-left: 4px solid #f39c12; }
.network { border-left: 4px solid #3498db; }
.datalink { border-left: 4px solid #2ecc71; }
.physical { border-left: 4px solid #9b59b6; }

.bit-display {
    font-family: 'Courier New', monospace;
    background: #050505; /* Darker black for bit displays */
    border: 1px solid #333;
    padding: 8px;
    margin: 5px 0;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-all; /* Break long hex/binary strings */
}

.hex-display { color: #ffff00; }
.binary-display { color: #00ff00; }
.ascii-display { color: #ff6b6b; }

.header-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* auto-fill for responsiveness */
    gap: 5px;
    margin: 8px 0;
}

.header-field {
    background: #222;
    border: 1px solid #444;
    padding: 6px;
    border-radius: 3px;
    text-align: center;
    font-size: 10px;
    /* cursor: pointer; */ /* Add if tooltips or more info on click is desired */
    transition: all 0.2s;
    word-wrap: break-word; /* Break long values */
}

.header-field:hover {
    background: #333;
    border-color: #666;
}

.header-field .field-name {
    color: #00ffff;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}

.header-field .field-value {
    color: #ffffff;
    font-size: 9px;
}

.controls {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    background: #333;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    transition: all 0.2s;
}

button:hover {
    background: #00ff00;
    color: #000;
}

button:disabled {
    background: #222;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
}

.transmission-path {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(90deg, #ff6b6b 0%, #4ecdc4 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden; /* Ensure moving packet doesn't overflow */
}

.packet-visualization {
    position: relative;
    height: 60px;
    margin: 10px 0;
}

.moving-packet {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #ffff00;
    border-radius: 50%;
    top: 10px;
    left: 10px; /* Start position more visible */
    transition: left 1.8s ease-in-out; /* Slightly faster animation */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 10px #ffff00;
}

.status-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    font-size: 12px;
}

.log-display {
    background: #050505; /* Darker black */
    border: 1px solid #333;
    height: 180px; /* Slightly more height */
    overflow-y: auto;
    padding: 8px;
    font-size: 11px;
    margin: 10px 0;
    border-radius: 3px;
}
/* Scrollbar styling for log */
.log-display::-webkit-scrollbar { width: 8px; }
.log-display::-webkit-scrollbar-track { background: #111; }
.log-display::-webkit-scrollbar-thumb { background: #444; border-radius: 4px;}
.log-display::-webkit-scrollbar-thumb:hover { background: #666; }


.log-entry {
    margin: 1px 0;
    padding: 2px 4px;
    border-radius: 2px;
    line-height: 1.4;
}
.log-entry .timestamp { color: #aaa; margin-right: 5px; }

.log-app { background: rgba(231, 76, 60, 0.1); border-left: 2px solid #e74c3c;}
.log-tcp { background: rgba(243, 156, 18, 0.1); border-left: 2px solid #f39c12;}
.log-ip { background: rgba(52, 152, 219, 0.1); border-left: 2px solid #3498db;}
.log-eth { background: rgba(46, 204, 113, 0.1); border-left: 2px solid #2ecc71;}
.log-phy { background: rgba(155, 89, 182, 0.1); border-left: 2px solid #9b59b6;}
.log-sys { background: rgba(100, 100, 100, 0.1); border-left: 2px solid #888;}
.log-error { background: rgba(255, 0, 0, 0.2); border-left: 2px solid #ff0000; color: #ffaaaa;}


.protocol-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted minmax */
    gap: 15px;
    margin: 20px 0;
}

.detail-panel {
    background: #111;
    border: 1px solid #333;
    padding: 12px;
    border-radius: 5px;
}
.detail-panel h4 { margin-top: 0; margin-bottom: 8px; }


.checksum-calc {
    font-size: 10px;
    color: #888;
    margin: 5px 0;
}

.sequence-diagram { /* This is now our Log Display */
    /* background: #0a0a0a; */
    /* border: 2px solid #333; */
    /* padding: 15px; */
    margin: 15px 0;
    /* border-radius: 5px; */
    text-align: left;
}
.sequence-diagram h4 { text-align: center; }


.error-highlight {
    background: #ff4757 !important;
    color: #000 !important;
    animation: error-blink 0.5s infinite;
}

@keyframes error-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.7; }
}

.bandwidth-monitor {
    display: flex;
    justify-content: space-around; /* Space out items */
    background: #222;
    padding: 8px;
    border-radius: 3px;
    margin: 5px 0;
    font-size: 10px; /* Smaller font */
}

.congestion-window {
    background: #2c3e50;
    border: 1px solid #34495e;
    padding: 8px;
    border-radius: 3px;
    margin: 5px 0;
    font-size: 10px; /* Smaller font */
} 