body {
    font-family: sans-serif;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

h1,
h2,
h3 {
    /* Added h3 */
    color: #0056b3;
    margin-bottom: 0.5em;
}

h2 {
    margin-top: 1.5em;
}

h3 {
    margin-top: 0.5em;
    font-size: 1.1em;
}


#controls button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    color: white;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

#scanButton {
    background-color: #28a745;
}

#scanButton:hover {
    background-color: #218838;
}

#websocketControlButton {
    background-color: #28a745;
}

#websocketControlButton:hover {
    background-color: #218838;
}

#disconnectButton {
    background-color: #dc3545;
}

#disconnectButton:hover {
    background-color: #c82333;
}

#controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#status {
    margin-top: 15px;
    font-style: italic;
    color: #555;
}

#deviceInfo {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

#deviceInfo strong {
    color: #007bff;
}

/* Status Bar Styles */
#statusBar {
    display: flex;
    /* Arrange items side-by-side */
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    gap: 20px;
    /* Space between items */
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.status-item {
    display: flex;
    flex-direction: column;
    /* Stack label and value */
    align-items: center;
    min-width: 100px;
    /* Give items some minimum width */
}

.status-item .label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.status-item .value {
    font-size: 1.2em;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #e9ecef;
    /* Default background */
    color: #333;
    /* Default text color */
    min-width: 60px;
    /* Ensure space for value */
    text-align: center;
}

/* Capacity specific styling */
.capacity-indicator {
    color: white;
    /* Text color for colored background */
    transition: background-color 0.5s ease;
    /* Smooth color transition */
}

/* Stream Container Styles */
.stream-container {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px 15px 15px 15px;
    /* top right bottom left */
    margin-bottom: 15px;
    border-radius: 4px;
}

.stream-box {
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 250px;
    /* Slightly smaller */
    min-height: 60px;
    overflow-y: auto;
    background-color: #e9ecef;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-top: 5px;
    /* Space below h3 */
}

/* Map Container Style */
#map {
    height: 400px;
    /* Or desired height */
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* App Settings Styles */
#appSettings {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.settings-item {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.settings-item:last-child {
    margin-bottom: 0;
}

#clearCacheButton {
    padding: 8px 15px;
    font-size: 0.9em;
    cursor: pointer;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

#clearCacheButton:hover {
    background-color: #0056b3;
}

.cache-status {
    margin-left: 10px;
    font-style: italic;
    color: #555;
}

/* Version display */
#appVersion {
    font-weight: bold;
    color: #555;
}

/* User Authentication */
#auth-status {
    position: absolute;
    top: 20px;
    right: 20px;
}

#user-avatar {
    cursor: pointer;
}

#user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #007bff;
    transition: box-shadow 0.3s ease;
}

#user-avatar img:hover {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.dropdown-content {
    position: absolute;
    top: 60px; /* Adjust positioning for better dropdown alignment */
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

#user-info {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    font-size: 0.9em;
}

#logout-button {
    width: 100%;
    padding: 8px 0;
    background-color: #ff4e5b;
    color: white;
    text-align: center;
    text-decoration: none;
    display: block;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logout-button:hover {
    background-color: #e03a46;
}

#user-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #007bff;
}

#user-info {
    flex-grow: 1;
}

#logout-button {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logout-button:hover {
    background-color: #c82333;
}