/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    text-align: center;
}

/* Header */
h1 {
    color: #333;
    margin: 20px 0;
}

/* Buttons */
button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

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

/* Stop Button Specific Styles */
#Stop-button {
    background-color: #dc3545; /* Red */
}

#Stop-button:hover {
    background-color: #b22222; /* Darker red */
}

/* Select Dropdown */
select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* Connection Status */
#connection-status {
    font-size: 18px;
    font-weight: bold;
    color: #d9534f;
}

/* Connection Modal */
#overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark semi-transparent background */
    z-index: 999; /* Ensure it is above other content */
}

#device-selection-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
    z-index: 1000; /* Ensure modal is above overlay */
}


/* Controls Section */
#controls {
    margin: 20px auto;
    max-width: 600px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

/* Parameters Section */
#parameters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 450px;
    margin: auto;
}

.parameter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.parameter-item label {
    flex: 1;
    text-align: left;
    font-weight: bold;
}

.parameter-item input {
    flex: 2;
    padding: 5px;
    border: 1px solid #aaa;
    border-radius: 4px;
    width: 120px;
    text-align: right;
}

/* Make sure buttons align nicely */
button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

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

/* Mode & Parameters Display */
#runInfo {
    background: white;
    padding: 15px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#runInfo p {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 5px 0;
}

#runInfo strong {
    color: #007bff;
}


/* Debug Table */
#debugTable {
    width: 90%;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

#debugTable th, #debugTable td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

#debugTable th {
    background-color: #007bff;
    color: white;
}

/* Responsive Design */
@media (max-width: 600px) {
    #controls, #debugData {
        width: 90%;
    }

    button {
        width: 100%;
    }
}


.sensor-data-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
}

#sensorDataTable {
    width: 100%;
    border-collapse: collapse;
}

#sensorDataTable th, #sensorDataTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#sensorDataTable th {
    background-color: #f4f4f4;
    font-weight: bold;
}

#sensorDebugStatus {
    font-weight: bold;
    color: red;
}

button#toggleSensorDebugBtn {
    margin-bottom: 10px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
}


.centered-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 20px 0;
    width: 100%; /* Ensures the container doesn't shrink */
}


#sensorBarContainer {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 150px;
    width: 90%; /* Limit width instead of full 100% */
    border: 1px solid black;
    padding: 10px;
    position: relative;
    margin:auto;
}

.bar-container {
    position: relative;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.max-bar {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: lightgray;
    border-radius: 5px;
}

.sensor-bar {
    position: absolute;
    width: 80%;
    background-color: blue;
    border-radius: 5px;
    text-align: center;
    color: white;
    font-size: 12px;
    bottom: 0; /* Ensure bar starts from the bottom */
}

.canvas-container {
    width: 80%;
    max-width: 600px;
    margin: 20px auto;
}

#sensorCanvas {
    width: 100%;
    height: 250px;
    border: 1px solid black;
}

#weightControls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#batteryInfo {
    display: flex;
    gap: 10px; /* Adjust spacing between items */
    font-size: 16px; /* Adjust text size if needed */
}

.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0px 0px;
    font-size: 18px;
}

.rc-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.rc-row {
    display: flex;
    gap: 5px;
}

.arrow {
    width: 50px;
    height: 50px;
    font-size: 24px;
    background-color: #ccc;
    border: none;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.arrow.active {
    background-color: #ffcc00; /* Highlight when pressed */
}
