body {
    font-family: Arial, sans-serif;
    background-color: #f7f7f7; 
    background-size: cover; 
    background-repeat: no-repeat;
    background-attachment: fixed; 
    color: #333; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
}

h1 {
    color: #333; 
    text-align: center;
    background-color: #A9C9F3; 
    padding: 20px;
    border-radius: 8px;
    flex: 1;
}

.toggle-container {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 25px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #bbb; /* Changed for a softer effect */
}

input:checked + .slider:before {
    transform: translateX(25px);
}

#toggleLabel, #toggleLabel2 {
    color: #333; /* Changed from white */
    font-weight: bold;
    font-size: 16px;
    padding: 5px;
    margin-top: 10px;
}

#diagram {
    border: 2px solid #bbb; /* Changed from white */
    background-color: #B3D4FC; /* Changed from #00fff8 to a subtle pastel blue */
    width: 1000px;
    height: 450px;
    margin-bottom: 20px;
    border-radius: 12px;
}

.waveform-container-default {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 1200px;
    margin-right: 100px;
}

.waveform-container1, .waveform-container2 {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 1200px;
    margin-right: 100px;
}

#waveform1, #waveform2, #waveform3, #waveform4, #waveform5, #waveform6, #waveform7, #waveform8 {
    border: 2px solid #bbb; 
    background-color: #B3D4FC; 
    width: 1300px;
    height: 200px;
    color: #4A4A4A; 
    border-radius: 12px;
}

#waveform3, #waveform4, #waveform5, #waveform6, #waveform7, #waveform8 {
    display: none; 
}

#waveform1 {
    margin-right: 10px;
    margin-bottom: 10px;
}

#waveform2, #waveform1, #waveform3, #waveform4, #waveform5, #waveform6, #waveform7, #waveform8 {
    margin-bottom: 20px;
}

#tableContainer {
    max-height: 615px; 
    overflow-y: auto;
    width: 1200px;
    border: 1px solid #bbb; /* Changed from #3B1E54 */
    background-color: #B3D4FC; /* Changed from #00fff8 */
    box-sizing: border-box;
    margin-bottom: 20px;
    display: block; /* Ensure the container supports scrolling */
}

#tableContainer::-webkit-scrollbar {
    width: 12px; 
}

#tableContainer::-webkit-scrollbar-track {
    background: #B3D4FC; /* Changed from #00fff8 */
    border-radius: 10px;
}

#tableContainer::-webkit-scrollbar-thumb {
    background-color: #888; /* Changed from #3B1E54 */
    border-radius: 10px;
    border: 3px solid #B3D4FC; /* Changed from #00fff8 */
}

#gridData {
    width: 100%;
    border-collapse: collapse;
    background-color: #B3D4FC; /* Changed from #00fff8 */
    color: #4A4A4A; /* Changed from #3B1E54 */
    border: 1px solid #888; /* Changed from #3B1E54 */
}

th, td {
    border: 1px solid #bbb; /* Changed from white */
    padding: 8px;
    text-align: center;
}

th {
    background-color: #A9C9F3; /* Changed from #00d5ff */
    color: #333; /* Changed from white */
    position: sticky; /* Make headers sticky */
    z-index: 1; /* Ensure headers stay above table rows */
}

#gridData tr:nth-child(1) th {
    top: 0; /* First header row sticks to the top */
}

#gridData tr:nth-child(2) th {
    top: 35px; /* Second header row sticks below the first row */
}

td {
    background-color: #B3D4FC; /* Changed from #00fff8 */
    color: #4A4A4A; /* Changed from #3B1E54 */
}

.tooltip {
    position: absolute;
    background-color: #F7EEDC; /* Changed from #FFE0B5 */
    border: 1px solid #E0CDAA; /* Changed from #D8AE7E */
    color: #4A4A4A; /* Changed from #3B1E54 */
    padding: 5px;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip-modal {
    position: absolute;
    background-color: #E2D6C3; /* Changed from #D8AE7E */
    border: 1px solid #AFAFAF; /* Changed from #3B1E54 */
    color: #4A4A4A; /* Changed from #3B1E54 */
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    z-index: 1000;
    visibility: hidden;
}

.controls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px; /* Adjust spacing between controls and the diagram */
    gap: 30px; 
}

.toggle-container {
    display: flex;
    align-items: center;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    width: 50%;
    border-radius: 10px;
    text-align: center;
}

.modal-buttons {
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px;
    margin: 5px;
    cursor: pointer;
}
/* Modal Background */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    backdrop-filter: blur(5px); /* Blur effect for a modern look */
}

/* Modal Content */
.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 40%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal Header */
.modal-content h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 15px;
}

/* Dropdown Styling */
label {
    font-size: 16px;
    font-weight: bold;
    color: #555;
    display: block;
    margin-top: 10px;
    text-align: left;
}

select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 5px;
    background-color: #f8f8f8;
    cursor: pointer;
}

/* Modal Buttons */
.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-buttons button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

#applyResolution {
    background-color: #007bff;
    color: white;
}

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

#closeModal {
    background-color: #dc3545;
    color: white;
}

#closeModal:hover {
    background-color: #a71d2a;
}
/* Download Button Styling */
#download-container {
    display: none; 
    margin-left: 20px;
}

button#downloadBtn {
    margin-top: 5px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    background-color: #A9C9F3;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

/* Responsive Modal */
@media (max-width: 600px) {
    .modal-content {
        width: 80%;
        max-width: 350px;
    }
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#timestampDisplay {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #333;
    background-color: #f0f0f0;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin: 10px 0 15px 0;
}

/* Loading Overlay Styles */
#loadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    text-align: center;
    padding-top: 20%;
}

/* Spinner Styling */
.spinner {
    border: 8px solid #f3f3f3; /* Light grey border */
    border-top: 8px solid #A9C9F3; /* Matching the theme color */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto; /* Center the spinner */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 40%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
    /* allow scrolling inside modal if content overflows */
    max-height: 80vh;
    overflow-y: auto;
}

/* Specifically make register modal larger */
#registerModal .modal-content {
    width: 60%;       /* increase width */
    max-width: 800px; /* allow more space */
    margin-top: 5%;   /* shift upward a bit */
}

.modal-content label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    text-align: left;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"],
.modal-content input[type="tel"],
.modal-content select {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: #f8f8f8;
    cursor: pointer;
}

/* Dropdown arrow styling */
.modal-content select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='5'><path fill='%23333' d='M0 0l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.modal-content .input-with-eye {
    position: relative;
}

.modal-content .input-with-eye input {
    padding-right: 2.5em;
}

.modal-content .input-with-eye .eye-icon {
    position: absolute;
    right: 10px;
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.modal-content .info-icon {
    margin-left: 10px;
    font-size: 16px;
    color: #007bff;
    cursor: pointer;
}

.modal-content .password-tooltip {
    visibility: hidden;
    position: absolute;
    top: 50%;
    left: 110%;
    transform: translateY(-50%);
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    font-size: 12px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    white-space: pre-line;
    width: 200px;
}

.modal-content .info-icon:hover + .password-tooltip {
    visibility: visible;
}

.modal-buttons button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
}

/* Login modal: error / verification message */
.login-error-message {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 5px;
    text-align: left;
    font-size: 14px;
    background-color: #ffebee;
    border: 1px solid #c62828;
    color: #b71c1c;
}

.login-error-message .btn-resend {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    display: inline-block;
    transition: background 0.3s ease-in-out;
}

.login-error-message .btn-resend:hover {
    background-color: #0056b3;
}

.login-error-message.verification-pending {
    background-color: #fff8e1;
    border-color: #f59e0b;
    color: #92400e;
    text-align: center;
}

.login-error-message.verification-pending .verification-text {
    margin-bottom: 1em;
}

.login-error-message.verification-pending .verification-line1 {
    margin-bottom: 0.35em;
}

.login-error-message.verification-pending .verification-line2 {
    margin-left: 0;
    color: #78350f;
}

.login-error-message.verification-pending .verification-action {
    padding-top: 0.5em;
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    text-align: center;
}

.login-error-message.verification-pending .btn-resend {
    background-color: #f59e0b;
}

.login-error-message.verification-pending .btn-resend:hover {
    background-color: #d97706;
}

.login-success-message {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 5px;
    text-align: left;
    font-size: 14px;
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.login-post-verify-message {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 5px;
    text-align: left;
    font-size: 14px;
    background-color: #ecfdf5;
    border: 1px solid #10b981;
    color: #047857;
}

/* ---------- Multi-Select Styling (reference) ---------- */
.multi-select-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.multi-select-header {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #f8f8f8;
    cursor: pointer;
    color: #999;
    text-align: left;
    min-height: 34px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-right: 30px;
    gap: 5px;
}

.multi-select-header.selected {
    color: #333;
}

.multi-select-header::after {
    content: '▼';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #333;
}

.multi-select-header .placeholder {
    color: #999;
}

.multi-select-header .tag {
    display: inline-flex;
    align-items: center;
    background-color: #e0e0e0;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 12px;
    margin: 2px 0;
}

.multi-select-header .remove-tag {
    margin-left: 5px;
    cursor: pointer;
    color: #333;
    font-weight: bold;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.multi-select-dropdown li {
    padding: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.multi-select-dropdown li:hover {
    background-color: #f0f0f0;
}

.other-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #f8f8f8;
}
/* ---------- End of Modal & Multi-Select Styles ---------- */
/* ---------- Admin Dashboard Top-Left ---------- */
.admin-dashboard-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

/* ---------- Auth Buttons Top-Right ---------- */
.auth-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 10px;
}

#loginBtnTop {
    background-color: #A9C9F3;
    color: black;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

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

#loggedInNav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    background-color: #A9C9F3;
    color: black;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.nav-btn:hover {
    background-color: #0056b3;
}

.profile-dropdown-trigger {
    position: relative;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    background-color: #e8e8e8;
}

.profile-dropdown-trigger:hover {
    background-color: #d0d0d0;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 220px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    padding: 8px 0;
    z-index: 150;
}

.profile-dropdown-trigger.open .profile-dropdown {
    display: block;
}

.profile-dropdown-header {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-dropdown-header span:first-child {
    font-weight: 600;
    color: #333;
}

.profile-dropdown-header span:last-child {
    font-size: 12px;
    color: #666;
}

.profile-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.profile-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

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

.profile-dropdown-trigger svg {
    display: block;
}

/* Nudge auth buttons down when verification banner is visible */
body.verification-visible .auth-buttons {
    top: 70px;
}

body.verification-visible .admin-dashboard-container {
    top: 70px;
}

/* ---------- Download Button Disabled-State Hover Removal ---------- */
button#downloadBtn:disabled, button#downloadBtn:disabled:hover {
    background-color: #A9C9F3;
    cursor: default;
    /* disable hover transition */
    transition: none;
}

/* group the icon + label */
.label-with-icon {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
  }
  
  .label-with-icon .info-icon {
    margin-right: 6px;
    font-size: 16px;
    color: #007bff;
    cursor: pointer;
  }
  
  /* when you hover the info‑icon, show its tooltip */
  .label-with-icon .info-icon:hover + .password-tooltip,
  .password-container .info-icon:hover + .password-tooltip {
    visibility: visible;
    opacity: 1;
  }
  
  /* ensure tooltip positions relative to its container */
  .password-tooltip {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
  }
  /* show the tooltip when hovering the info‑icon or its label container */
.label-with-icon:hover + .password-container .password-tooltip {
    visibility: visible;
    opacity: 1;
  }
  
.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.info-row label {
  flex: 0 0 150px; /* Fixed width for labels to ensure alignment */
  font-weight: bold;
  color: #333;
}

.info-row span {
  flex: 1; /* Span takes remaining space */
}

.edit-icon {
  cursor: pointer;
  margin-left: 5px;
}

.edit-container {
  margin-top: 5px;
  margin-left: 160px; /* Align with the span content */
}

/* Support Help Button styling */
.support-help-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background-color: #A9C9F3;
    color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.support-help-button:hover {
    background-color: #0056b3;
    color: white;
    transform: scale(1.05);
}


.date-format-hint {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}
