:root {
    --alert-color: #e2111e;
    --page-bg: #f3f3f3;
}

.container-fluid {
    text-align: center;
    background-image: url('/static/images/board.jpg') center;
    background: #000000;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; 
    background-color: #000; 
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.navbar-brand {
    font-family: Ubuntu;
    font-size: 2rem;
    font-weight: bold;
}

.nav-item {
    font-family: Ubuntu;
    font-size: 1.2rem;
    padding: 18px;
    font-weight: bold;
}

.nav-link {
    font-family: Ubuntu;
    font-size: 2rem;
}

.brand-icon {
    color: rgb(0, 0, 0);
}

/* Main Section */
.main {
    list-style-type: none;
    padding-left: 0;
}


.footer-section {
    color: rgb(75, 75, 75);
    padding: 20px 0;
    font-weight: 200;
    height: auto;
    min-height: 2.5rem;
    width: 100%;
    text-align: center;
    position: relative;
    margin-top: auto;
}

.main-content {
    padding-bottom: 100px; /* Space for footer */
}

.card-footer {
    text-align: center;
    padding: 10px;
    background-color: #969696;
    border: none;
    justify-content: center;
    align-items: center;
}


.check-icon {
    color: #008f24;
}

.alert-icon {
    color: var(--alert-color);
}

.alert-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: auto;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.alert-container .alert {
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.logo-image {
    border-radius: 50%;
}

/* Menu bar */
a {
    color: inherit;
    text-decoration: none;
}

ul li {
    font-family: Ubuntu;
    font-size: 20px;
    font-weight: 600;
    margin-top: 20px;
}

ul li label i {
    width: 50px;
    margin-right: 5px;
    text-align: center;
}

.drop {
    display: none;
}

/* Dropdown arrows */
input[name=dropdowns] {
    display: none;
}

input[name=dropdowns]:checked~label>#downarrow {
    display: none;
}

input[name=dropdowns]:checked~label>#uparrow {
    display: inline-block;
}

input[name=dropdowns]:not(checked)~label>#uparrow {
    display: none;
}

#uparrow,
#downarrow {
    float: right;
}

ul li label:hover {
    cursor: pointer;
}

.drop li {
    display: block;
    font-size: 16px;
}

.drop li label i {
    width: 40px;
}

input[type="checkbox"] {
    accent-color: #4e155e;
}

input[type="checkbox"] {
    accent-color: #4e155e;
}

input[type=submit] {
    background-color: transparent;
    color: black;
    padding: 0px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Ubuntu;
    font-size: 20px;
    font-weight: 600;
    margin-top: 0px;
}

input[type=Submit]:hover {
    background-color: transparent;
    color: #FFBD59;
}

@media (min-aspect-ratio: 1/1) {
    aside {
        width: 265px;
        height: 100%;
        float: left;
        overflow: fill;
    }

    input[type=checkbox]:checked~ul {
        display: block;
    }
}

@media (max-aspect-ratio: 1/1) {
    ul {
        display: block;
        text-align: center;
    }

    ul li {
        display: inline;
        margin-top: 0px;
        position: relative;
    }

    input~ul {
        position: absolute;
        background-color: #9696967F;
        z-index: 1;
        padding-left: 0px;
        padding-right: 5px;
        left: 20px;
        text-align: left;
        border-radius: 10px;
    }

    input[type=checkbox]:checked~ul {
        display: block;
    }
}

h1 {
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500;
    font-size: 2rem;
    color: black;
    text-align: center;
    margin-top: 20px;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 10px;
}

/* SensoBlocks */
.sensoblocks-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(360px, 1fr)); /* 2 columns on desktop, wrap to new rows */
    gap: 20px;
    box-sizing: border-box;
    padding: 20px;
    align-items: start; /* prevent equal-height stretching */
}

/* Keep single card behavior intact � center it and limit width */
.sensoblocks-container > .sensoblock:only-child {
    grid-column: 1 / -1;       /* span both columns */
    justify-self: center;      /* center the card in the row */
    width: min(600px, 100%);   /* do not stretch full width */
}

/* If the last row has a single item (odd number of blocks), center that last card */
.sensoblocks-container > .sensoblock:last-child:nth-child(odd) {
    grid-column: 1 / -1;       /* span both columns */
    justify-self: center;      
    width: min(600px, 100%);   
}

.sensoblock {
    position: relative;
    background: #f9f9f9;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    width: 100%;           /* fill the grid column */
    max-width: none;
    min-width: 0;          /* allow grid to control min width */
    height: auto;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    overflow: visible;
}

/* Keep single card behavior intact */
.sensoblocks-container>.sensoblock:only-child {
    width: 100%;
    max-width: none;
    overflow: visible;
}
.sensoblock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sensoblock-content h2,
.sensoblock-content p {
    text-align: center;
    font-weight: bold;
    margin: 0;
}

.block-link {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #333;
}

.graphs-button-corner, 
.sensoblock .delete-button {
    position: absolute;
    top: 1px;
    width: 35px;
    height: 35px;
    padding: 0;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.sensoblock .delete-button {
    right: 10px;
    background: #fdecec;
    color: #c53030;
    font-weight: bold;
    line-height: 1;
    display: flex;         
    align-items: center;    
    justify-content: center;
    font-size: 16px;
    border-radius: 50%;
    border: 1px solid #f9caca;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.sensor-item .delete-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #fdecec;
    color: #c53030;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    border: 1px solid #f9caca;
    cursor: pointer;
    width: 25px;
    height: 25px;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.sensor-item .delete-button i {
    pointer-events: none; /* allow click to hit button */
    font-size: 12px;
}

.sensor-item .delete-button:hover {
    background-color: #c53030;
    color: #fff;
    transform: scale(1.1);
}

.graphs-button-corner {
    left: 10px;
    background-color: #17a2b8;
    color: white !important;
    font-size: 20px;
    line-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 16px; 
    
}

.delete-button:hover {
    background-color: #c53030;
    color: #fff;
    transform: scale(1.1);
}

.graphs-button {
    display: none !important;
}

.graphs-button-corner:hover {
    background-color: #e6a847;
}

/* Sensoblock Info Page Specific Styles */
.sensoblock-info-page .sensoblock-info {
  max-width: 900px;
  margin: 20px auto;
  padding: 25px 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sensoblock-info .info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9e9e9;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.sensoblock-info .block-title {
  margin: 0;
  font-size: 2.2rem;
  color: #333;
  font-weight: 600;
}

.sensoblock-info .export-button {
  background: #4e155e;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: background-color 0.2s, transform 0.2s;
}

.sensoblock-info .export-button:hover {
  background-color: #6a2c7e;
  transform: translateY(-2px);
}

.sensoblock-info .block-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px 25px;
  margin-bottom: 30px;
  background-color: #fdfdfd;
  padding: 20px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}

.sensoblock-info .block-meta p {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f1f1;
  padding: 10px 5px;
}

.sensoblock-info .block-meta p:last-child {
  border-bottom: none;
}

.sensoblock-info .block-meta p strong {
  color: #333;
  margin-right: 10px;
  white-space: nowrap;
}

.sensoblock-info .block-meta p span {
  text-align: right;
}

.sensoblock-info .block-meta p span.yes {
  color: #28a745;
  font-weight: bold;
}

.sensoblock-info .block-meta p span.no {
  color: #dc3545;
  font-weight: bold;
}

.sensoblock-info .sensor-title-wrapper {
  margin-top: 40px;
  border-top: 1px solid #e9e9e9;
  padding-top: 30px;
}

.sensoblock-info .sensor-heading {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.6rem;
  color: #444;
  font-weight: 600;
}

/* Responsive layout for small screens */
@media (max-width: 768px) {
.sensoblocks-container {
        /* grid already collapses to one column via minmax, keep padding adjustments */
        padding-top: 100px; 
        padding-left: 10px;
        padding-right: 10px;
        grid-template-columns: 1fr; /* force 1 column on small screens */
    }

    .sensoblock {
        width: 100%;
        min-width: auto;
        height: auto; 
        margin-bottom: 20px;
    }

    /* IP address fields mobile layout */
    #ip-input,
    #gw-input,
    #sm-input {
        display: flex;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 5px !important;
    }
    
    #ip-input input,
    #gw-input input,
    #sm-input input {
        width: 22% !important;
        flex: 1 1 0;
        min-width: 40px;
        padding: 8px 4px !important;
        font-size: 16px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Configuration page mobile styles */
    .sensoblock-form-container {
        width: 90% !important;
        max-width: none !important;
        margin: 10px auto !important;
        padding: 15px !important;
    }
    
    /* Form elements mobile adjustments */
    .form-row {
        flex-direction: column !important;
        gap: 5px !important;
        align-items: stretch !important;
    }
    
    .form-row label {
        text-align: center !important;
        flex-basis: auto !important;
    }

    .modbus-reg-item {
        flex-direction: column !important;
        gap: 5px !important;
        align-items: stretch !important;
    }
    
    .modbus-reg-item label {
        text-align: center !important;
        flex-basis: auto !important;
    }
    
    .modbus-reg-item input {
        width: 100% !important;
        flex-basis: auto !important;
    }
    
    /* Select elements mobile */
    select {
        font-size: 16px !important;
        padding: 12px 10px !important;
    }
    
    input[type="number"] {
        font-size: 16px !important;
        padding: 12px 10px !important;
    }
    
    /* Configuration page layout adjustments */
    .config-flex-layout {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .config-sidebar {
        flex: none !important;
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        margin: 0 0 20px 0 !important;
        order: 2 !important;
    }
    
    .config-center {
        flex: none !important;
        width: 100% !important;
        padding: 0 !important;
        order: 1 !important;
    }
    
    /* Added sensors section mobile */
    .added-sensors-title {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }
    
    .sensor-item {
        width: 100% !important;
        margin: 5px 0 !important;
        font-size: 12px !important;
    }
    
    /* Save button mobile */
    .save-configuration-button {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        width: auto !important;
        min-width: 120px !important;
        max-width: 180px !important;
        padding: 10px 16px !important;
        font-size: 0.95rem !important;
        text-align: center !important;
        z-index: 9999 !important;
        border-radius: 5px !important;
    }
    #added-sensors-sidebar 
    {
        display: none !important;
    }
    #view-sensors-btn [type="submit"]
    {
        display: block !important;
        background-color: #4e155e;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        font-size: 1rem;
        font-family: Ubuntu;
        font-weight: bold;
        cursor: pointer;
        margin-top: 15px;
        transition: background-color 0.3s ease;
    }
}

   /* Show sidebar and hide button on desktop */
   @media (min-width: 769px) {
      #added-sensors-sidebar {
         display: block !important;
      }
      #view-sensors-btn {
         display: none !important;
      }
   }

/* Flex Properties for Block Positioning */
.sensoblocks-1 {
    justify-content: center;
}

.sensoblocks-2 {
    justify-content: space-between;
}

.sensoblocks-3 {
    justify-content: space-between;
}

.sensoblocks-more {
    justify-content: flex-start;
}

/* Additional Styles */
ul.main {
    margin-top: 20px;
}

ul.main li i {
    margin-right: 10px;
}

html,
body {
    height: 100%;
    padding-top: 56px;
    margin: 0;
    padding-bottom: 40px;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom right, #f7f8fa, #e9edf3); 
}
.section-border, .section-background, section {
    background-color: transparent !important; /* Allow body background to show through */
}

/* Override body styles for the SensoBlock info page */
body.sensoblock-info-page {
    display: flex;
    flex-direction: column;
}

/* Wrapper for main content on sensoblock info page */
body.sensoblock-info-page .main-section {
    flex: 1;
    display: block;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Style for the form container */
.sensoblock-form-container {
    width: 50%;
    text-align: center;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 20px auto;
}

/* Style for the h2 inside the form container */
.sensoblock-form-container h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

/* Style for labels inside the form */
.sensoblock-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: center;
}

/* Style for the select dropdown */
select {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: 2px solid #4e155e;
    border-radius: 5px;
    font-family: Ubuntu;
    font-size: 1rem;
    background-color: #f9f9f9;
    text-align: center;
    text-align-last: center;
}

/* Style for the options within the dropdown */
select option {
    background-color: #ffffff;
    color: #333;
    padding: 12px 15px; 
    border-bottom: 1px solid #e0e0e0; 
    font-family: Ubuntu, sans-serif;
}

/* Remove border from the last option */
select option:last-child {
    border-bottom: none;
}

/* Hover effect for options */
select option:hover {
    background-color: #4e155e;
    color: #ffffff;
}

/* Style for the input fields */
 .input-container {
    width: 100% !important;
    min-width: 120px !important;
    max-width: 220px !important;
    justify-content: center !important;
}

.input-container input[type="number"] {
    width: 100%;
    margin-right: 5px;
}

input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #4e155e;
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
    font-family: Ubuntu;
    background-color: #f9f9f9;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.form-row label {
    flex-basis: 40%;
    text-align: right;
    margin-bottom: 0;
    white-space: nowrap;
}

.modbus-reg-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.modbus-reg-item label {
    flex-basis: 40%;
    text-align: right;
    margin-bottom: 0;
    white-space: nowrap;
}

.modbus-reg-item input {
    flex-basis: 55%;
    width: 100%; /* Allow input to shrink/grow */
}

.unit {
    margin-left: 10px;
    font-size: 1rem;
    font-family: Ubuntu;
    color: #4e155e;
}

/* Style for the submit button */
button[type="submit"] {
    background-color: #4e155e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    font-family: Ubuntu;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: #ffbd59;
    color: black;
}

/* Success message styling */
#successMessage {
    font-size: 1rem;
    font-weight: bold;
    color: green;
    margin-top: 15px;
}

.save-configuration-button {
    position: fixed;
    bottom: 40px;
    right: 40px;
    padding: 12px 25px;
    background-color: #4e155e;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-family: Ubuntu;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 9999;
}

/* Hover effect */
.save-configuration-button:hover {
    background-color: #ffbd59;
    color: black;
}

.save-configuration-button:active {
    background-color: #ff9f00;
}

/* Sensor container */
.sensor-item {
    display: flex;
    flex-direction: column;
    margin: 10px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 14px;
    position: relative;
    width: 200px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.sensor-item:hover {
    background-color: #f0f0f0;
}

.sensor-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    gap: 5px;
}

.sensor-block span {
    flex: 1 1 auto;
    min-width: fit-content;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* Delete SB Button */
.remove-btn {
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
}

.remove-btn:hover {
    background-color: #cc0000;
}

.added-sensors-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: 20px;
    text-align: center;
    text-transform: uppercase;
}

/* Configure and Diagnosis Buttons */
.buttons-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: center;
    min-height: 48px;
    flex-wrap: wrap;
}

.configure-button,
.diagnosis-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-family: Ubuntu;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.update-sw-button,
.operational-button,
.diagnosis-button,
.configure-button {
    min-width: 120px;
    height: 40px;
    line-height: 24px; 
    padding: 8px 15px;
    white-space: nowrap;
    display: inline-flex;         
    align-items: center;
    justify-content: center;
}

.configure-button {
    background-color: #4e155e;
    color: white;
}

.configure-button:hover {
    background-color: #ffbd59;
    color: black;
}

.diagnosis-button {
    background-color: #ff0000;
    color: white;
}

.diagnosis-button:hover {
    background-color: #cc0000;
    color: white;
}

.diag-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    padding: 20px;
    position: relative;
}

.page-title {
    margin-top: 20px;
    font-size: 2rem;
    text-align: center;
}

.config-btn-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-purple,
.btn-send {
    display: inline-block;
    background-color: #4e155e;
    font-family: Ubuntu, sans-serif;
    font-weight: bold;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    width: 150px;
}

.btn-purple:hover,
.btn-send:hover {
    background-color: #FFBD59;
    transform: scale(1.05);
}

.form-container {
    margin-top: 20px;
    text-align: center;
}

.form-group-diag input {
    width: 300px;
    margin-bottom: 15px;
}

.data-output {
    width: 100%;
    max-width: 500px;
    height: 200px;
    border: 1px solid #aaa;
    margin-top: 20px;
    padding: 5px;
    background-color: #f2f2f2;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    line-height: 1;
    display: block;
}

.data-output p,
.data-output div {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.data-output pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    overflow: visible;
    height: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 20px;
    overflow: hidden;
}

/* Modal content container */
.modal-content {
    background-color: #ffffff;
    color: #333;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-family: 'Ubuntu';
    text-align: center;
    transition: all 0.3s ease-in-out;
}

.modal-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.modal-content .modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-content button {
    flex: 1;
    padding: 0.6rem 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    box-sizing: border-box;
}

.modal-content button:hover {
    transform: translateY(-1px);
}

#confirm-yes {
    background-color: #4e155e;
    color: white;
}

#confirm-no {
    background-color: #FFBD59;
    color: white;
}

.sensoblock.configured {
    background: linear-gradient(135deg, #e9f9e9, #d9f2d9);
    color: #1b5e20;
}

.sensoblock.unconfigured {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #b71c1c;
}

.status {
    font-weight: bold;
    margin-top: 5px;
}

.operational-button.disabled-btn,
.diagnosis-button.disabled-btn,
.update-sw-button.disabled-btn,
.configure-button.disabled-btn {
    background-color: grey !important;
    color: #fff !important;
    cursor: not-allowed !important;
}

button:disabled {
    pointer-events: none;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
}

.back-button a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 20px;
    transition: color 0.2s ease;
}

.back-button a:hover {
    color: #6a1b9a;
}

.add-sensoblock-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 95%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.add-sensoblock-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.add-sensoblock-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.add-sensoblock-content input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.add-sensoblock-content input#name {
    width: 80%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#hw-ip-input {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

#hw-ip-input input {
    width: 35px;
    flex-grow: 1;
    max-width: 40px;
    padding: 5px;
    border: 2px solid #4e155e;
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
    font-family: Ubuntu;
    background-color: #f9f9f9;
}

#ip-input,
#gw-input,
#sm-input {
    display: flex;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 5px !important;
}

#ip-input input,
#gw-input input,
#sm-input input {
    width: 65px;
    padding: 3px;
    text-align: center;
    font-size: 14px;
}

button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

button:hover {
    background-color: #45a049;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#add-sensoblock-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4e155e;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#add-sensoblock-btn:hover {
    background-color: #ffbd59;
    color: black;
}

#add-sensoblock-btn i {
    margin-right: 8px;
    font-size: 18px;
}

.selected-sensor {
    border: 2px solid #4e155e;
    background-color: rgba(78, 21, 94, 0.1);
    box-shadow: 0 0 10px rgba(78, 21, 94, 0.3);
    transform: scale(1.02);
}

.form-buttons {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.online {
    color: green;
    font-weight: bold;
}

.offline {
    color: red;
    font-weight: bold;
}

.update-sw-button {
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    min-width: 120px;
    height: 40px;
    line-height: 24px;
    white-space: nowrap;
}

.update-sw-button:hover:not(.disabled-btn) {
    background-color: #2600ff;
}

.update-progress-container {
    /* transparent, compact overlay */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100% - 48px)); 
    margin: 0;
    padding: 0;                 
    background: transparent;    
    box-shadow: none;           
    border-radius: 0;           
    z-index: 50;
    pointer-events: none;
}

/* Compact header */
.progress-info {
    display: flex;               
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.progress-text,
.progress-percentage {
    font-size: 0.95rem; 
}

/* Smaller bar */
.progress-bar {
    width: 100%;
    height: 10px;                             
    border-radius: 8px;
    background-color: rgba(0,0,0,0.08);       
    border: 1px solid rgba(0,0,0,0.06);
}
.progress-fill {
    height: 100%;
    width: 0%;                   /* JS updates this */
    background: linear-gradient(90deg, #7c4dff, #00c853);
    transition: width 0.3s ease-out;
    border-radius: 8px;
    opacity: 0.95;
}

/* While updating, hide overlapping texts behind the overlay */
.sensoblock.updating .current-mode,
.sensoblock.updating .status-connection,
.sensoblock.updating .status {
    visibility: hidden;
}
.sensoblock.updating h2 { visibility: visible; }

/* Styles for SensoBlock info page */
.sensoblock-info {
    max-width: 900px;
    margin: auto;
    font-family: 'Ubuntu';
    color: #333;
    padding: 0.5rem;
}

.block-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.block-meta p {
    margin: 0.5rem 0;
}

.block-meta .yes {
    color: green;
    font-weight: bold;
}

.block-meta .no {
    color: red;
    font-weight: bold;
}

.sensor-title-wrapper {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.sensor-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.8rem;
    color: #333;
}

.sensor-heading i {
    font-size: 1.6rem;
}

.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.sensor-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
    text-align: left;
}

.sensor-card:hover {
    transform: translateY(-4px);
}

.sensor-info p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
}

.no-sensors {
    font-style: italic;
    color: #888;
}

.sensor-icon i {
    font-size: 2rem;
    color: #FFBD59;
}

.sensoblock-link {
    color: inherit;
    text-decoration: none;
}

.sensoblock-link:hover {
    color: inherit;
    text-decoration: none; 
}

/* Loading Page Styles */
.websocket-monitoring-starting {
    text-align: center;
    padding: 50px;
    max-width: 600px;
    margin: 0 auto;
}

.websocket-monitoring-starting h2 {
    color: #333;
    margin-bottom: 30px;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 8px solid #ccc;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    margin: 30px 0;
    color: #4e155e;
}

.websocket-monitoring-starting p {
    font-size: 1.1em;
    color: #666;
    margin: 15px 0;
}

.config-flex-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start; 
    width: 100vw;
    min-height: 80vh;
    box-sizing: border-box;
    gap: 0;
}

.config-sidebar {
    flex: 0 0 340px;
    min-width: 320px;
    max-width: 400px;
    margin-left: 0;
    margin-right: 0;
    align-self: flex-start;
}

.config-center {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    justify-content: flex-start; 
    min-height: 80vh;
    padding-left: 40px; 
}

/* Modal Animations */
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeOutModal {
    from { opacity: 1; }
    to { opacity: 0; }
}
.modal.fade-in {
    animation: fadeInModal 0.3s forwards;
}
.modal.fade-out {
    animation: fadeOutModal 0.3s forwards;
}

body.modal-open {
    overflow: hidden !important;
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"] {
        font-size: 16px !important;
    }
}

/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 10px;
    font-family: Ubuntu, sans-serif;
}

.custom-select {
    position: relative;
    cursor: pointer;
}

.custom-select-trigger {
    width: 100%;
    padding: 5px;
    border: 2px solid #4e155e;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #f9f9f9;
    color: #333;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.custom-select-trigger::after {
    content: '▼';
    font-size: 0.8rem;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #070000;
    border-radius: 5px;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.1);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.custom-select.open .custom-options {
    display: block;
}

.custom-option {
    display: block;
    padding: 1px 15px;
    cursor: pointer;
    border-bottom: 1px solid #585656; /* The separator line */
    text-align: center;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover, .custom-option.selected {
    background-color: #4e155e;
    color: #fff;
}

.real-select {
    display: none !important; /* Hide the original select */
}

.form-group.mb-0 input[type="submit"] {
    display: block;
    width: 40%;
    margin: 12px auto 0 auto;
    background-color: #000; /* Black background */
    color: #fff; /* White text */
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
}

.form-group.mb-0 {
    margin: 0;
    padding: 0;
    width: 100%;
}

.form-group.mb-0 input[type="submit"] {
    display: block;
    width: 100%;
    margin: 12px 0 0 0;
    background-color: #969696;
    color: black;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
}

.form-group.mb-0 input[type="submit"]:hover,
.form-group.mb-0 input[type="submit"]:active {
    background-color: #FFBD59;
    color: black !important;
}

/* Filtering Section */
.tooltip-label {
    position: relative;
    cursor: help;
}

.tooltip-label:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-weight: normal;
}

.tooltip-label:hover::before {
    content: "";
    position: absolute;
    bottom: 118%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

.filtering-section span {
    display: block;
    font-size: 14px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.filtering-section span:last-child {
    margin-bottom: 0;
}

.filtering-section span:first-child {
    font-weight: bold;
    color: #4e155e;
    margin-bottom: 5px;
}

/* Filtering info page button styles */
.back-config-btn {
    background-color: #4e155e;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    font-family: Ubuntu;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.back-config-btn:hover {
    background-color: #ffbd59;
    color: black;
}

#acquisition_time_unit {
    height: 38px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    box-sizing: border-box;
}

#integrity-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 2000;     
    align-items: center;  
    justify-content: center; 
}

#added-sensors-sidebar .sensor-item,
#sensors-modal .sensor-item,
.sensor-item,
.sensor-item * ,
.remove-btn,
#add-sensoblock-btn,
.save-configuration-button,
.added-sensors-title,
.add-sensoblock-content,
.sensoblock,
.navbar,
.footer-section,
.sensoblock-form-container,
.back-button,
.back-button * ,
.export-button,
.export-button * ,
.modal-buttons,
.clear-button,
.card-content,
button[onclick="triggerImport()"] {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	caret-color: transparent;
	outline: none;
}

.main-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px); /* Adjust based on header/footer height */
    padding: 2rem;
    box-sizing: border-box;
}

.main-page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-page-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.main-page-header p {
    font-size: 1.2rem;
    color: #666;
    margin-top: 0.5rem;
}

.main-page-cards {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.main-page-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    width: 300px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.main-page-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.main-page-card .card-icon {
    font-size: 3rem;
    color: #4e155e;
}

.main-page-card .card-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.main-page-card .card-content p {
    font-size: 1rem;
    color: #777;
    margin: 0;
}

.page-main-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 170px); 
    margin-bottom: 80px;           
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

section.footer-section,
footer#footer.white-section,
footer.white-section,
.footer-section,
.white-section,
.container > footer,
.container.footer,
div.container,
div.container > footer,
div.main-content,
.section.footer-section {
    background: linear-gradient(to bottom right, #f7f8fa, #e9edf3) !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    box-shadow: none !important;
    border-top: none !important;
}

.auth-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px); 
    gap: 10px;
    padding: 20px;
    box-sizing: border-box;
}

.auth-card-wrapper .card {
    margin: 0;
}

.auth-card-wrapper .text-center {
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .auth-card-wrapper .card,
    .auth-card-wrapper .text-center {
        width: 92% !important;
        max-width: none;
    }
}

.disabled-logo {
    pointer-events: none;
}

.no-sensoblocks-card {
    max-width: 480px;
    margin: 80px auto 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    padding: 3.5rem 2.5rem 2.5rem 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap:18px;
}

.empty-state-desc {
    color: #666;
    font-size: 1rem;
    white-space: normal;
    margin-bottom: 10px
}

.captcha-card {
    max-width: 400px;
    margin: 80px auto 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    padding: 2.5rem 2rem 2rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.captcha-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #4e155e;
    margin-bottom: 18px;
}

.captcha-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.captcha-card .btn-primary {
    background-color: #4e155e;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 2rem;
    margin-top: 18px;
    box-shadow: 0 2px 8px rgba(76, 0, 128, 0.08);
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
}

.captcha-card .btn-primary:hover {
    background-color: #ffbd59;
    color: black;
    box-shadow: 0 4px 16px rgba(76, 0, 128, 0.12);
}

/* Login card styles */
.login-modern-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modern-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 500px;
  min-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-modern-card:hover {
  box-shadow: 0 16px 48px rgba(78,21,94,0.16), 0 2px 12px rgba(0,0,0,0.10);
}

.login-modern-title {
  font-family: Ubuntu;
  font-size: 1.8rem;
  font-weight: 600;
  color: #222;
  margin-bottom:8px;
  text-align: center;
}

.login-modern-subtitle {
  color: #888;
  font-size: 1.1rem;
  margin-bottom: 22px;
  text-align: center;
}

.login-modern-buttons {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.gsi-material-button,
.login-modern-microsoft-btn {
    width: 100%;
    max-width: 400px;
    min-width: 240px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-family: 'Roboto', Arial, Ubuntu, sans-serif;
    color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background 0.18s, box-shadow 0.18s;
    margin-bottom: 0;
    cursor: pointer;
    text-decoration: none;
    padding: 0 12px;
}

.gsi-material-button:hover,
.login-modern-microsoft-btn:hover {
    background: #ebf2f8;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    color: #222;
}

.gsi-material-button .gsi-material-button-icon {
    height: 22px;
    width: 22px;
    margin-left: 8px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gsi-material-button .gsi-material-button-icon img {
    height: 22px;
    width: 22px;
    display: block;
}

.gsi-material-button-contents {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #3f3e3e;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: normal;
    line-height: 44px;
    letter-spacing: 0.3px;
}

.login-modern-microsoft-btn img {
    height: 22px;
    width: 22px;
    margin-left: 8px;
    margin-right: 12px;
}

.login-modern-microsoft-btn span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #3f3e3e;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: normal;
    line-height: 44px;
    letter-spacing: 0.4px;
}
