
body {
    font-family: Arial, sans-serif;
    background: #d8efff;
    background-size: cover;
    background-attachment: fixed;
    text-align: center;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center; /* horizontal centering */
    align-items: center;     /* vertical centering */
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
}

/* Existing styles... */

/* Style for the "Show Sensor List" button */
.show-list-button {
    background-color: #007bff; /* Blue color */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.show-list-button:hover {
    background-color: #0056b3;
}

.button-center-container {
    text-align: center; /* Center the button */
    margin-top: 20px; /* Space above the button */
}

/* Style for scrollable container */
.scrollable-box {
    max-height: 400px; /* Adjust this height as needed */
    overflow-y: auto; /* Enable vertical scrolling */
    border: 1px solid #444; /* Optional: adds a border to the scrollable area */
    border-radius: 8px;
    margin-bottom: 20px; /* Space between table and buttons */
    background-color: #1a1a1a; /* Match the dark theme */
}

/* Ensure table inside scrollable box takes full width */
.scrollable-box table {
    width: 100%;
    border-collapse: collapse;
}

/* Optional: Style for scrollbar to match theme */
.scrollable-box::-webkit-scrollbar {
    width: 10px;
}

.scrollable-box::-webkit-scrollbar-track {
    background: #313131;
    border-radius: 10px;
}

.scrollable-box::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.scrollable-box::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
}

/* Style for scrollable container (for the main sensor table) */
.scrollable-box {
    max-height: 400px; /* Adjust this height as needed */
    overflow-y: auto; /* Enable vertical scrolling */
    border: 1px solid #444; /* Optional: adds a border to the scrollable area */
    border-radius: 8px;
    margin-bottom: 20px; /* Space between table and buttons */
    background-color: #1a1a1a; /* Match the dark theme */
}

/* Ensure table inside scrollable box takes full width */
.scrollable-box table {
    width: 100%;
    border-collapse: collapse;
}

/* Optional: Style for scrollbar to match theme */
.scrollable-box::-webkit-scrollbar {
    width: 10px;
}

.scrollable-box::-webkit-scrollbar-track {
    background: #313131;
    border-radius: 10px;
}

.scrollable-box::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.scrollable-box::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
}

/* Existing styles... */

/* Style for scrollable container (for the main sensor table) */
.scrollable-box {
    max-height: 400px; /* Adjust this height as needed */
    overflow-y: auto; /* Enable vertical scrolling */
    border: 1px solid #444; /* Optional: adds a border to the scrollable area */
    border-radius: 8px;
    margin-bottom: 20px; /* Space between table and buttons */
    background-color: #1a1a1a; /* Match the dark theme */
}

/* Ensure table inside scrollable box takes full width */
.scrollable-box table {
    width: 100%;
    border-collapse: collapse;
}

/* Optional: Style for scrollbar to match theme */
.scrollable-box::-webkit-scrollbar {
    width: 10px;
}

.scrollable-box::-webkit-scrollbar-track {
    background: #313131;
    border-radius: 10px;
}

.scrollable-box::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.scrollable-box::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of other content */
}

/* Popup Box */
.popup-box {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90%;
    width: 400px; /* Adjust width as needed */
    color: #333;
    font-family: 'Inter', sans-serif;
}

.popup-box h2 {
    color: #d9534f; /* Red for error messages */
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: bold;
}

.popup-box p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* New style for the scrollable list inside the problem popup */
.stale-sensor-list-scroll {
    max-height: 150px; /* Max height for the scrollable list of sensors */
    overflow-y: auto; /* Enable vertical scrolling */
    border: 1px solid #ddd; /* Light border for the list box */
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: #eee; /* Light background for the list */
    text-align: left; /* Align text left within the list */
    font-size: 0.95em;
    line-height: 1.4;
}

.stale-sensor-list-scroll span {
    display: block; /* Each item on its own line */
    padding: 2px 5px;
    /* background-color: #f0f0f0; */ /* Removed background color for cleaner look */
    border-radius: 3px;
    margin: 2px 0; /* Adjust margin */
}

.popup-buttons button {
    background-color: #5cb85c; /* Green for close button */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.popup-buttons button:hover {
    background-color: #4cae4c;
}

/* --- Minimized Popup Styles --- */
.minimized-popup {
    position: fixed;
    top: 20px; /* Adjust as needed */
    left: 20px; /* Adjust as needed */
    background-color: #fbff00; /* Red background */
    color: rgb(0, 0, 0);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 999; /* Below full popup, but above main content */
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.minimized-popup:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.minimized-popup-notification {
    font-size: 1.5em;
    line-height: 1; /* Adjust to center vertically */
}

.minimized-popup-text {
    font-weight: bold;
}

.minimized-popup-logo {
    width: 30px;        /* Set a small, fixed width */
    height: 30px;       /* Set a small, fixed height */
    object-fit: contain; /* Ensures the icon scales down without cropping and maintains aspect ratio */
}

/* Brightening Animation */
@keyframes brighten-glow {
    0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(255, 255, 0, 0.6), 0 0 15px rgba(255, 255, 0, 0.8); } /* Yellowish glow */
    100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
}

.brighten-animation {
    animation: brighten-glow 2s ease-out forwards; /* Apply animation */
}



.header-container {
    display: flex;
    align-items: center;
    justify-content: center;  /* Centers the title */
    position: relative;  /* Allows positioning of button */
    width: 100%;
    padding: 10px;
}

#back-button {
    position: absolute;
    left: 10px; /* Keep the button on the left */
    background-color: #33C3F0;
    color: #0B0B0B;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    max-width: 50px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.back-img{
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

#back-button:hover {
    background-color: #44576D;
}
/*login page*/
.login-container {
    background: #0A1F44;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    margin: 20px auto;
    padding: 20px;
    padding-bottom: 10%;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    color: #0B0B0B;
}
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

button {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    text-align: center;
    color: #0B0B0B;
    
}
input{
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    text-align: center;
    width: 20%;
    margin: 0 auto;
    
}

.role-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    color: #0B0B0B;
}

.back-button {
    background-color: #33C3F0;
    color: #0B0B0B;
    font-size: 16px;
    cursor: pointer;
    border-radius: 10px;
    width: 50px;
    height: 50px;

}

/* NEW: Full-page centering container */
.page-container {
    display: flex;
    justify-content: center; /* Horizontal centering */
    align-items: center;     /* Vertical centering */
   /* Full viewport height */
    padding: 20px;          /* Prevents edge touching */
  }
  
  /* Your form styling - UPDATED */
  .login-form {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: #0A1F44;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Optional shadow */
    align-items: center;
  }
  
  .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
  }
  
  .user-img, .pass-img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  
  input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
  }
  
  .button-container {
    margin-top: 20px;
    position: center;
  }
  
  .submit {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
  }
  button {
    width: 100%;
    padding: 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
  }
  button {
    width: 100%;
    max-width: 300px;;
    padding: 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
  }
  
  .button-container {
    width: 100%;
    max-width: 300px;     /* Matches input width */
    display: flex;
    justify-content: center;
  }
  
h1 {
    margin: 0;
    text-align: center;
    flex-grow: 1; /* Allows the title to take the remaining space */
    color: white;
}

.sensor-container {
    width: 90%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    padding-bottom: 10%;
    background: #0A1F44;
}
.system-container {
    width: 90%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    padding-bottom: 10%;
    background: #0A1F44;
    align-items: center;
    justify-content: center; /* horizontal centering */
}

h1 {
    color: white;
    padding-block: 50px;
    font: 50px/1.2 'Arial', sans-serif;
    color: rgb(255, 255, 255); /* Fill color */
    text-shadow: 
      -1px -1px 0 #ffffff80,
      1px -1px 0 #ffffff80,
      -1px 1px 0 #0379ff80,
      1px 1px 0 #0379ff80;
}
h2 {
    color: white;
    font-size: 1.5em;
    margin-bottom: 20px;
}

label{
    color: white;
    font-size: 1.2em;
    margin-bottom: 10px;
}
.status-summary {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.2em;
    margin-bottom: 20px;
}

view{
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.2em;
    margin-bottom: 20px;
        background-color: #33C3F0;
    color: #0B0B0B;
}

.active {
    color: rgb(3, 240, 3);
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    align-items: center;
}

.inactive {
    color: rgba(51, 51, 51, 0.548);
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    align-items: center;
}
.inactiveText {
    color: rgb(253, 36, 36);
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    align-items: center;
}

.battery {
    color: #ffffff;
    text-align: center;
    align-items: center;
    font-size: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-radius: 10px;   
    overflow: hidden;
    
}

thead {
    background: #666666;
}

th{
    padding: 10px;
    border: 1px solid #1f1f1f;
    text-align: center;
    color: white;
    border-left: none;            /* Remove left border */
    border-right: none;           /* Remove right border */
    font-size: 20px;
    font-weight: bold;
}
td {
    padding: 10px;
    border: 1px solid #1f1f1f;
    text-align: center;
    color: white;
    border-left: none;            /* Remove left border */
    border-right: none;           /* Remove right border */
    
}

button {
    background: #33C3F0;
    color: #0B0B0B;    
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

button:hover {
    background: #44576D;
}

.logo{
    width: auto;
    height: 70px;
    margin-bottom: 20px;
    bottom: 10px;  
    padding: 20px; 
}
s
.button-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}
/* Admin specific styles */
.admin-actions {
    margin-bottom: 20px;
    text-align: right;
    display: none; /* Hidden by default */
}

.admin-button {
    background-color: #33C3F0;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 300px;

}

.admin-button:hover {
    background-color: #45a049;
}
/* Logout button styles */
.logout-btn {
    background-color: #f44336;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s;
    width: 150px;
}

.logout-btn:hover {
    background-color: #d32f2f;
}
.status-indicator {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 5px;
  }
  
  /* Temperature status colors */
  .status-high-temp {
    background-color: #ff4444;
  }
  
  .status-normal-temp {
    background-color: #44ff44;
  }
  
  .status-low-temp {
    background-color: #4444ff;
  }
  
  /* Level status colors */
  .status-normal-level {
    background-color: #44ff44;
  }
  
  .status-warning-level {
    background-color: #ffcc00;
  }
  
  .status-critical-level {
    background-color: #ff4444;
  }
  
  /* Blinking animation for critical status */
  @keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
  }
  
  .critical-alert {
    animation: blink 1s linear infinite;
  }
  .system-info {
    text-align: center;
    margin: 10px 0 20px 0;
    padding: 10px;
    background-color: rgba(33, 147, 176, 0.1);
    border-radius: 5px;
}

.system-info h2 {
    margin: 0;
    color: #4cacfa;
    font-size: 1.3em;
}
.System-Header{
    text-align:center;
    position: center;
}

/*Register page*/
.register-container {
    background: #0A1F44;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    margin: 20px auto;
    padding-bottom: 10%;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    color: #0B0B0B;
}

h2 {
    color: white;
    font-size: 1.5em;
    margin-bottom: 20px;
}
.registration-form {
    width: 90%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    padding-bottom: 10%;
    background: #0A1F44;
    align-items: center;
    justify-content: center; /* horizontal centering */
    
}
.management-container {
    width: 90%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    padding-bottom: 10%;
    background: #0A1F44;
    align-items: center;
    justify-content: center; /* horizontal centering */
}
/* --- NEW Styles for Admin Button Group --- */
.admin-button-group {
    display: flex;
    justify-content: center; /* Center the group horizontally */
    gap: 20px; /* Space between the two buttons */
    margin-bottom: 20px;
    margin-top: 10px;
}

/* Ensure the individual admin buttons look good side-by-side */
.admin-button-group button {
    width: 180px; /* Set a fixed width for uniformity */
    /* Reuse existing button styles, but specify widths */
}

/* Ensure 'REMOVE' button has the same styling if it was using default button style */
#restore-sensors, 
#remove-button {
    background-color: #33C3F0; /* Use the desired background color */
    color: #0B0B0B;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    width: 180px; /* FIX 1: Explicitly set a common width */
    margin: 0; /* Important: Remove generic button margin-top */
    font-weight: bold; /* Make the text stand out */
}

#restore-sensors:hover, 
#remove-button:hover {
    background-color: #44576D;
    color: white;
}


/* --- Styles for Download Section Padding and Colors --- */

.download-container {
    margin-top: 40px !important; /* Increase top padding for separation */
    padding: 30px; /* Add internal padding */
    background-color: #1a1a1a; /* Dark background for better visibility */
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.download-container h3 {
    color: #33C3F0; /* Change header color to blue/cyan */
    margin-bottom: 20px;
    font-size: 1.5em;
}

.download-container label {
    color: #ffffff; /* Change label color to white */
    margin-right: 10px;
}

.download-container input[type="date"] {
    width: 180px; /* Adjust width for date inputs */
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #313131; /* Darker input background */
    color: white; /* White text inside date picker */
}

/* --- Styles for Download Section and Button --- */

/* Give the button an ID style for easy reference */
#download-report-btn {
    background: #33C3F0; /* Enabled color (Blue/Cyan) */
    color: #0B0B0B;
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer; /* Ensure pointer shows when enabled */
    transition: background 0.3s;
}

#download-report-btn:hover:not(:disabled) {
    background: #44576D; /* Hover for enabled state */
    color: white;
}

#download-report-btn:disabled {
    background: #555555; /* FIX 2: Gray background for disabled state */
    color: #aaaaaa;     /* Gray text for disabled state */
    cursor: not-allowed; /* Show that it's unclickable */
    opacity: 0.7;        /* Slight opacity change for effect */
}

.download-container input[type="date"] {
    width: 150px; /* Adjusted width to fit better, use 180px if preferred */
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #313131;
    color: white;
}

/* Ensure labels for the date inputs are next to each other */
.download-container label {
    display: inline-block;
    vertical-align: middle;
}

/* Ensure inputs for the date inputs are next to each other */
.download-container input[type="date"] {
    display: inline-block;
    vertical-align: middle;
}
/* Style for the voltage toggle switch (optional, using default is fine) */
#voltage-toggle {
    vertical-align: middle;
}

/* --- CRITICAL RULE: CSS to hide the VOLTAGE column (Column 6: TH and TD) --- */
/* The 'hide-voltage' class will be applied to the table wrapper by JavaScript. */
.hide-voltage th:nth-child(6),
.hide-voltage td:nth-child(6) {
    display: none;
}
/* Assuming the toggle is wrapped in a div with the inline style provided previously */
.sensor-container > div[style*="text-align: right"] label {
    /* CRITICAL FIX: Reduce the margin-right to minimal or zero */
    margin-right: 2px !important; /* Reduces the space to 2 pixels */
    /* Ensure no large padding/margin from other rules is affecting it */
    padding: 0;
}

/* Ensure the input (checkbox) is also close */
.sensor-container > div[style*="text-align: right"] input[type="checkbox"] {
    margin-left: 2px; /* Set a small margin-left if needed for alignment */
    vertical-align: middle;
}