/* Overlay Styling */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7); /* Light overlay background */
    z-index: 1000;
    overflow-y: scroll;  /* Allows scrolling */
    scrollbar-width: none;  /* For Firefox */
}

.overlay::-webkit-scrollbar {
    display: none;  /* For Chrome, Safari, and Opera */
}

/* Overlay content */
.overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff; /* Light mode default */
    padding: 30px;
    padding-top: 10px;
    border-radius: 10px;
    width: 90%; /* Make the overlay responsive to viewport width */
    max-width: 2000px; /* Set a maximum width so it doesn't get too wide */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    max-height: 90%; /* Prevents overlay from exceeding viewport height */
    overflow-y: auto; /* Allows scrolling within the overlay if content overflows */
    scrollbar-width: none;  /* For Firefox */
}

.overlay-content::-webkit-scrollbar {
    display: none;  /* For Chrome, Safari, and Opera */
}

/* Monitoring checkbox at the top right */
.monitoring-checkbox {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
}

/* Split the content into two panes */
.edit-container {
    display: flex;
    flex-direction: row-reverse; /* Reverse the order in RTL */
    gap: 20px; /* Space between the graph and form */
    height: 100%;
}

/* Left pane: Graph */
.graph-container {
    flex: 1;
    padding: 10px;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Space between the two charts */
    justify-content: center;
}

/* Last ping tag */
#last-ping {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

/* Set maximum height for individual charts */
.graph-container canvas {
    max-height: 300px; /* Set a maximum height for each chart */
    width: 100%;       /* Ensure the width is 100% of the parent container */
}

/* Right pane: Form */
.form-container {
    flex: 1;
}

/* Adjust the form to fit within the right pane */
.form-container form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Label and Input Styling */
.overlay-content label {
    font-size: 20px;
    color: #333;
    margin: 5px;
}

.overlay-content input[type="text"],
.overlay-content select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 20px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.overlay-content input[type="text"]:focus,
.overlay-content select:focus {
    border-color: #18bc9c;
    outline: none;
}

/* Submit Button Styling */
.overlay-content button[type="submit"] {
    grid-column: 1 / span 2; /* Make the submit button span across both columns */
    padding: 10px 20px;
    background-color: #18bc9c;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.overlay-content button[type="submit"]:hover {
    background-color: #139e7a;
}

.overlay-content button[type="submit"]:active {
    background-color: #0d7f5e;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 10px;
    left: 20px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* Title */
.overlay-content h2 {
    text-align: center; /* Center the text horizontally */
    margin-top: 0px 0;
    margin-bottom: 20px 0;
    font-size: 1.4rem;
    font-weight: bold;
    width: 100%; /* Ensure the h2 takes up the full width of the container */
}

/* Dark Mode Specific Styles */
[data-theme="dark"] .overlay {
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay background */
}

[data-theme="dark"] .overlay-content {
    background-color: #2c2c2c; /* Dark background */
    color: #fff; /* White text */
}

[data-theme="dark"] .close-btn {
    color: #fff; /* White close button */
}

[data-theme="dark"] .overlay-content label {
    color: #ccc; /* Light gray label */
}

[data-theme="dark"] .overlay-content input[type="text"],
[data-theme="dark"] .overlay-content select {
    background-color: #3c3c3c; /* Darker input background */
    border-color: #555; /* Darker border */
    color: #fff; /* White text */
}

[data-theme="dark"] .overlay-content button[type="submit"] {
    background-color: #156e5c; /* Darker button */
}

[data-theme="dark"] .overlay-content button[type="submit"]:hover {
    background-color: #135d4e;
}

[data-theme="dark"] .overlay-content button[type="submit"]:active {
    background-color: #0d4b3c;
}

[data-theme="dark"] #last-ping {
    color: #fff;
}
