/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal overflow */
    overflow-y: auto; /* Allow vertical scrolling */
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #444;
    margin-top: 20px;
}

/* Form Styles */
form {
    margin: 10px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

form input,
form select,
form button {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

form button {
    background-color: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:disabled {
    background-color: #cccccc; /* Light gray background */
    color: #666666; /* Dark gray text */
    cursor: not-allowed; /* Show a "not allowed" cursor */
    opacity: 0.6; /* Make the button appear slightly transparent */
}

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

/* Table Styles */
table {
    width: 90%;
    margin: 0px auto;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #007bff;
    font-weight: bold;
}

table tr:hover {
    background-color: #f1f1f1;
}

table tr:last-child td {
    border-bottom: none;
}

#routeStatsTable {
    border-collapse: collapse;
    overflow: auto;
}

.sticky-header th {
    position: sticky;
    top: 0;
    z-index: 1;

}

/* Button Styles */
button {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button.cancelTaskButton {
    background-color: #dc3545;
    color: #fff;
}

button.cancelTaskButton:hover {
    background-color: #c82333;
}

button#confirmCancel {
    background-color: #28a745;
    color: #fff;
}

button#confirmCancel:hover {
    background-color: #218838;
}

button#cancelPopup {
    background-color: #6c757d;
    color: #fff;
}

button#cancelPopup:hover {
    background-color: #5a6268;
}

/* Popup Styles */
#confirmationPopup {
    max-width: 400px;
    text-align: center;
}

/* Input Styles */
input[type="number"] {
    width: auto;
    display: inline-block;
    margin-left: 10px;
}

/* Filter container styles */
#filterContainer {
    position: absolute;
    top: 35px;
    left: 10px;
    transition: all 0.3s ease-in-out;
    z-index: 10;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    /* padding: 10px; */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Collapsed state */
.filter-collapsed {
    width: 40px;
    height: 40px;
    cursor: pointer;
    overflow: hidden;
}

/* Expanded state */
.filter-expanded {
    width: 300px;
    height: auto;
    cursor: default;
}

#filterContainer .filter-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

#filterContainer .filter-button img {
    width: 20px;
    height: 20px;
}

#files-panel h3 {
    margin-top: 0;
}

#files-list {
    list-style-type: none;
    padding: 0;
}

#files-list li {
    margin-bottom: 10px;
}

#files-list a {
    text-decoration: none;
    color: #007bff;
    cursor: pointer;
}

#result {
    width: 100%; /* Full width below the form and files panel */
    max-width: 100%;
    height: 30vh; /* Set a fixed height for the results section */
    overflow-y: auto; /* Add vertical scrollbar if content overflows */
    background-color: #fff; /* Optional: Add background for better visibility */
    padding: 10px; /* Optional: Add padding for better spacing */
    border: 1px solid #ddd; /* Optional: Add border for better separation */
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
#main-container{
    display:flex;
    flex-direction:column;
    height: calc(100vh - 25px);
    width:100%;
    max-width: 100%;
    overflow: hidden;
}
#header{
    justify-content: center; /* Horizontally center content */
    align-items: center; /* Vertically center content */
    height: 5vh;
    min-height: 100px;
    width: 100%;
    text-align: center; /* Ensure text alignment is centered */
}
/* Main container for form and files panel */
#content-container {
    display: flex;
    flex-direction: row;
    gap: 20px; /* Add spacing between form and files panel */
    margin-bottom: 20px; /* Add spacing between this section and the results */
    height: 60vh; /* Set a fixed height for the main container */
    overflow-y: auto;
    max-width: 100%;
}

#body-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 5vh); /* Adjust height to fill the remaining space */
    width: 100%;
    max-width: 100%;
    overflow-y: auto; 
}
/* Form container */
#form-container {
    flex: 4; /* Take up 4/5 of the horizontal space */
    overflow-y: auto; /* Add vertical scrollbar if content overflows */
    background-color: #fff; /* Optional: Add background for better visibility */
    padding: 10px; /* Optional: Add padding for better spacing */
    border: 1px solid #ddd; /* Optional: Add border for better separation */
    border-radius: 5px;
}

/* Files panel */
#files-panel {
    flex: 1; /* Take up 1/5 of the horizontal space */
    overflow-y: auto; /* Add vertical scrollbar if content overflows */
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

/* Task Info Container */
.task-info-container {
    display: flex;
    gap: 10px; /* Add spacing between task blocks */
    flex-direction: column;
}

/* Task Info Container */
.task-info {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
    flex-grow: 1; /* Allow the task container to grow and take available space */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Add spacing between child elements */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Prevent content overflow */
}

/* Task ID and Slug */
.task-id,
.task-slug {
    flex-shrink: 0; /* Prevent shrinking */
    flex-grow: 1;
    white-space: nowrap; /* Prevent wrapping */
}

/* Task Description */
.task-description {
    flex-grow: 1; /* Allow the description to take up remaining space */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis for truncated text */
    white-space: nowrap; /* Prevent wrapping */
}

/* Task Status Line */
.task-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 5px;
}

/* Inner Task Info */
.task-status-line .task-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    flex: 1;
    width: 100%;
    gap: 3px;
}

/* Task Info Text */
.task-info-text, .task-slug{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    width: 100%;
}

/* Task Title */
.task-title {
    font-size: 0.9em;
    color: black;
    margin-bottom: 5px;
}

/* Task Status */
.task-status {
    flex-shrink: 0; /* Prevent shrinking */
    width: 120px; /* Fixed width for consistent size */
    text-align: center; /* Center-align the status text */
}

/* Pending task */
.task-info.pending {
    background-color: rgba(214, 214, 5, 0.3); /* Transparent yellow */
}

/* Running task */
.task-info.running {
    border: 2px solid green;
    background-color: rgba(0, 255, 0, 0.1); /* Extremely transparent light green */
}

/* Failed task */
.task-info.failed {
    background-color: red;
    color: black; /* Ensure text is readable */
}

/* Completed task */
.task-info.completed {
    background-color: green;
    color: black; /* Ensure text is readable */
}

/* Other task statuses */
.task-info.other {
    border: 2px solid yellow;
}

/* Highlighted */
.highlighted {
    background-color: #d1ecf1; /* Light blue background */
    border-left: 4px solid #007bff; /* Blue border */
    padding-left: 10px; /* Add padding for visual separation */
}

.api-link {
    color: #007bff;
    text-decoration: none;
    display: inline-block; /* Ensure the width applies */
    width: 100%; /* Make all links the same width */
    text-align: left; /* Align text to the left */
    padding: 5px 10px; /* Add some padding for better spacing */
    box-sizing: border-box; /* Include padding in the width */
}

.api-link:hover {
    text-decoration: underline;
    background-color: #f1f1f1; /* Optional: Add a hover background for better visibility */
}

.api-item {
    display: flex; /* Ensure consistent alignment */
    width: 100%; /* Ensure the list item takes up full width */
    align-items: center;
    gap: 1rem
}

.api-label {
    flex: 1;
}

.api-link {
    flex: 1;
    text-decoration: none;
    color: blue; /* Optional styling */
}

.api-description {
    flex: 6;
}

/* Floating button */
.floating-button {
    position: fixed;
    right: 20px;
    bottom: 30px;
    top: auto;
    z-index: 1000;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
    .floating-button {
        left: 20px;
        right: 20px;
        width: auto;
    }
}

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

/* Floating debug output */
.floating-debug {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    width: calc(100% - 40px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: monospace;
    white-space: pre-wrap;
}

.form-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 2rem;
}

/* Black magic to make checkboxes and labels align properly */
input[type="checkbox"] + label,
input[type="checkbox"]
{
    width:inherit;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px; /* Optional: Add spacing between the label and checkbox */
}

/* Endpoint Detail Page Styles */
.info-section {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tabs-container {
    margin: 20px 0;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.tab-button.active {
    border-bottom-color: #007bff;
    color: #007bff;
}

.tab-button:hover {
    background-color: #f0f0f0;
}

.tab-content {
    display: none;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

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

.meter-item,
.request-item,
.read-item {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
}

.request-item.completed {
    background: #e8f5e8;
    border-color: #4caf50;
}

.request-item.pending {
    background: #fff3cd;
    border-color: #ffc107;
}

.error {
    color: black;
    /* background: #ffebee; */
    padding: 10px;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin: 10px 0;
}

/* Cycles Scrollable Container */
.cycles-scrollable {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 10px 0;
}

.cycles-header {
    font-size: 1.2em;
    margin: 10px 0 5px 0;
    font-weight: bold;
}

.cycles-table .current-cycle {
    background-color: #e3f2fd;
    font-weight: bold;
}

.progress-container {
    margin-top: 5px;
    width: calc(100% - 10px);
}

.progress-item {
    display: grid;
    grid-template-columns: fit-content(250px) 1fr;
    gap: 5px;
    align-items: center;
    margin-bottom: 2px;
}

.progress-name {
    font-size: 0.8em;
    color: #666;
    white-space: nowrap;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50;
    width: 0%;
    transition: width 0.3s;
}
