/* Base Styles */
body {
    font-family: Arial, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

label {
    min-width: 100px;
}

input, button, select {
    padding: 8px;
}

tbody {
    font-size: 13px;
}

input[type="text"] {
    flex-grow: 1;
}

button {
    cursor: pointer;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
}

.hidden { 
    display: none; 
}

/* Button Styles */
.btn-start {
    background-color: #4CAF50;
    color: white;
}

.btn-stop {
    background-color: #F44336;
    color: white;
}

.btn-clear {
    background-color: #2196F3;
    color: white;
}

button:hover {
    background-color: #FFA07A;
}

/* Output Styles */
#parsedOutput, #logOutput {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 300px;
    background-color: #f9f9f9;
    white-space: pre-wrap;
    overflow-y: auto;
    font-family: monospace;
    font-size: 11px;
}

/* Status Styles */
.status-row {
    margin-top: 10px;
}

.connection-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    margin-right: 5px;
}

.connected {
    background-color: #4CAF50;
}

.connecting {
    background-color: #FFC107;
}

.disconnected {
    background-color: #ccc;
}

.error {
    background-color: #F44336;
}

/* Tab Styles */
.tab-container {
    display: flex;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
}

.tab.active {
    background-color: white;
    border-bottom-color: white;
    position: relative;
    top: 1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Controls Card */
.controls-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
}

/* Flex Container */
.flex-container {
    display: flex;
    gap: 20px;
}

.flex-column {
    flex: 1;
}

/* Message Table */
.message-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.message-table th, .message-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.message-table th {
    background-color: #f2f2f2;
}

.message-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Button Row */
.button-row {
    display: flex;
    gap: 10px;
}

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
}

#bytesReceived, #messagesReceived {
    font-weight: bold;
}

/* Hex View */
.hex-view {
    font-family: monospace;
    white-space: pre;
    overflow-x: auto;
}

/* Map Overlay */
.map-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

#map-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 70%;
    max-height: 500px;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#map-header {
    padding: 10px 15px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#map-title {
    font-weight: bold;
    font-size: 16px;
}

#map-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

#map {
    flex-grow: 1;
    width: 100%;
}

.map-controls {
    padding: 10px 15px;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
