html{
    scroll-behavior: smooth;
}
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    /*background-color: #f4f4f4;*/
}

/* Navbar */
.navbar {
    /*background-color: #dfe4e8;*/
    color: #294CB4;
    padding: 7px 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    /*gap: 20px;*/
}

.navbar-left {
    display: flex;
    flex-direction: column;
    width: 50%;
    margin-right: 10px;
}

.title-section h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 2px solid #294CB4;
    padding-bottom: 5px;
    width: 345px;
}

.subtitle {
    margin-top: 5px;
    font-size: 14px;
    width: 345px;
    font-weight: 700;

}

/* Dropdowns in Navbar */
/*.navbar-dropdowns {*/
/*    !*margin-top: 40px;*!*/
/*    display: flex;*/
/*    gap: 20px;*/
/*    flex-wrap: wrap;*/
/*    justify-content: flex-end;*/
/*    width: 50%;*/
/*}*/

.dropdown-group {
    display: flex;
    flex-direction: column;
    color: white;
    font-size: 13px;
}

.dropdown-group label {
    /*margin-bottom: 4px;*/
    /*font-weight: 500;*/
    /*color: #000;*/
}

.dropdown-group select, .dropdown-group input[type="text"]{
    padding: 5px 10px;
    /*border: 1px solid #294CB4 !important;*/
    font-size: 14px;
    width: 210px;
    border-radius: 0.25rem;
    /*color: #333;*/
}

/* Profile */
.profile-section {
    position: relative;
}

.profile-button {
    background-color: #c4bfd1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #555;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.profile-button:hover {
    background-color: #9385b3;
}

.profile-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background-color: #fff;
    color: #333;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 140px;
    z-index: 1000;
}

.profile-menu a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.profile-menu a:hover {
    background-color: #f0f0f0;
}

/* DARK MODE OVERRIDES */
body.dark-mode {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Navbar */
body.dark-mode .navbar {
    background-color: #121212;
    color: #ffffff;
}

body.dark-mode .subtitle {
    border-top: 2px solid #aaa;
}

body.dark-mode .dropdown-group label {
    color: #e0e0e0;
}

body.dark-mode .dropdown-group select {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #666;
}

/* Profile button */
body.dark-mode .profile-button {
    background-color: #333;
    border-color: #777;
}

body.dark-mode .profile-menu {
    background-color: #2c2c2c;
    color: #eee;
}

body.dark-mode .profile-menu a {
    color: #ccc;
}

body.dark-mode .profile-menu a:hover {
    background-color: #444;
}

/* Cards and boxes */
body.dark-mode .left-card,
body.dark-mode .right-section,
body.dark-mode .chart-block,
body.dark-mode .sensor-card {
    background-color: #2a2a2a;
    color: #f0f0f0;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05);
}

body.dark-mode .element-box {
    background-color: #333;
    color: #fff;
}

body.dark-mode .element-box span {
    color: #ccc;
}

/* Info bar */
body.dark-mode .info-bar {
    color: #ddd;
}

/* DataTable */
body.dark-mode .env-table thead {
    background-color: #333;
    color: #fff;
}

body.dark-mode .env-table tbody tr:nth-child(even) {
    background-color: #1e1e1e;
}

body.dark-mode .env-table tbody tr:hover {
    background-color: #294CB4;
}

body.dark-mode .dataTables_filter input {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

/* Map titles */
body.dark-mode .map-title {
    background-color: #111;
    color: #ddd;
}

/* KPI boxes */
body.dark-mode .kpi-box {
    background-color: #333;
    border-left: 5px solid #5b44b9;
    color: #f0f0f0;
}

/* Chart area canvas text color (if needed) */
body.dark-mode canvas {
    background-color: transparent;
    color: white !important;
}

.dark-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #294CB4;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/*KPI Tickers*/
/*.kpi-ticker-container {*/
/*    overflow: hidden;*/
/*    !*background: #e1e6eb;*!*/
/*    border: 1px solid #ddd;*/
/*    !*box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);*!*/
/*    padding: 6px 0;*/
/*    position: relative;*/
/*    width: 100%;*/
/*}*/

/*.kpi-ticker {*/
/*    display: flex;*/
/*    !*animation: scroll 30s linear infinite;*!*/
/*}*/

/*.kpi-card {*/
/*    min-width: 200px;*/
/*    margin-right: 15px;*/
/*    padding: 3px 15px;*/
/*    background: #CFE2FF;*/
/*    border: 1px solid #294CB4;*/
/*    color: #000;*/
/*    text-align: center;*/
/*    !*box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);*!*/
/*    flex-shrink: 0;*/
/*}*/

@keyframes scroll {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Main Container */
.main-container {
    display: flex;
    justify-content: flex-start;
    padding: 10px;
    gap: 1px;
}

/* Left Section */
.left-section {
    flex: 1;
    max-width: 900px;
}

.left-card {
    background-color: #e1e6eb;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.left-card-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #294CB4;
}

.element-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.element-box {
    flex: 1 1 calc(30% - 12px);
    min-width: 120px;
    background-color: #eee;
    color: #294CB4;
    text-align: center;
    padding: 12px 10px;
    font-size: 14px;
    font-weight: bold;
    /*border: 1px solid #ff0000*/
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.element-box span {
    /*display: block;*/
    margin-top: 6px;
    /*font-size: 13px;*/
    font-weight: bold;
    /*color: #f4f4f4;*/
}

@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .left-section {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .right-section {
        max-width: 100%;
    }

    .element-box {
        flex: 1 1 calc(45% - 12px);
    }
}

@media (max-width: 600px) {
    .element-box {
        flex: 1 1 calc(100% - 12px);
    }
}


/* Right Section */
.right-section {
    background-color: #e1e6eb;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.chart-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Occupy all available height */
    width: 100%;
    /* Full width of its parent */
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: #f2f6fa;

}

#environmentMap {
    flex-grow: 1;
    /* This will make the map fill remaining space */
    width: 100%;

}


@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-dropdowns {
        flex-direction: column;
        gap: 10px;
    }

    .main-container {
        justify-content: center;
    }

    .chart-container {
        max-width: 100%;
    }
}

/* Section for Bar Graphs */
.section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    justify-content: space-between;
}

.chart-block {
    background: #e1e6eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex: 1 1 45%;
    min-width: 350px;
    max-width: 48%;
    padding: 20px;
    gap: 20px;
}

.kpi-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 120px;
}

.kpi-box {
    background: #f0f0f0;
    border-left: 5px solid #294CB4;
    padding: 10px;
}

.kpi-title {
    font-size: 13px;
    color: #555;
}

.kpi-value {
    font-size: 15px;
    font-weight: bold;
}

.chart-area {
    flex: 1;
}

canvas {
    width: 100% !important;
    height: auto !important;
}

@media (max-width: 768px) {
    .section {
        flex-direction: column;
    }

    .chart-block {
        max-width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .kpi-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .kpi-box {
        width: 45%;
    }
}

.map-section {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    background-color: #f4f4f4;
}

.map-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.map-title {
    padding: 8px;
    background-color: #294CB4;
    color: white;
    font-size: 14px;
}

.map {
    width: 100%;
    border: 1px solid #ccc;
    height: 240px;
}

.map-large {
    height: 517px;
}

.sensor-card {
    background-color: #e1e6eb;
    margin: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.table-title {
    text-align: center;
    font-size: 20px;
    color: #294CB4;
    margin-bottom: 15px;
}

.env-table {
    width: 100%;
    border-collapse: collapse;
}

.env-table thead {
    background-color: #294CB4;
    color: white;
}

.env-table th,
.env-table td {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.env-table tbody tr:nth-child(even) {
    background-color: #fff;
}

.env-table tbody tr:hover {
    background-color: #e0f7fa;
}

.dataTables_filter {
    margin-bottom: 10px;
    /* Space below the search bar */
    margin-top: 10px;
    /* Space above the search bar */
    margin-right: 10px;
    /* Optional: adjust space from right edge */
    float: right;
    /* Keeps search bar aligned to right */
}


@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .main-container {
        flex-direction: column;
    }

    .section {
        flex-direction: column;
    }

    .chart-block {
        max-width: 100%;
        flex-direction: column;
    }

    .kpi-column {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/*----------------------------------------------------------------------------------------------------------------------*/
.text-green {color: #00AF51;}
.text-light-green {color: #A8CF96}
.text-orange {color: #FCC10B}
.text-dark-orange{color: #EA7932}
.text-red{color: #F56161}
.text-purple{color: #9D72B2}
.text-dark-purple{color: #A06A7A}

.loader{
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: url('../images/loader.gif')
    50% 50% no-repeat rgb(249,249,249);
}

/*------------scroll style----------------------*/
/* width */
::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

/* Track */
::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: #b0b0b0;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #696969;
}

.bg-custom-primary{
    background: #e4effd;
}