/* General Reset */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Orbitron', sans-serif;
    background-color: #e0f7fa; /* Light Aqua Background */
    color: #2e7d32; /* Forest Green Text */
    overflow-x: hidden;
}

#site-logo{
    width: 40px;
    height: 40px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 2px solid #81c784; /* Green Accent */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #e8f5e9; /* Light Green */
}

header div {
    display: flex;
    align-items: center;
    gap: 5px;
}

#page_title {
    flex: 80%;
    align-items: center;
    justify-content: space-between;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    color: #2e7d32; /* Forest Green */
}

/* Buttons */
button {
    padding: 3px 5px;
    border: 2px solid #81c784; /* Green Accent */
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #ffffff; /* White */
    color: #2e7d32; /* Forest Green */
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(129, 199, 132, 0.4); /* Hover Glow */
}

#master_visual, #slave_section, #main_section{
    display: flex;
    align-items: stretch;
}

#section_user{
    flex: 15%;
    gap: 5px;
    padding: 5px 5px;
    column-gap: 10px;
}

#stats {
    flex: 20%;
}

#autorefresh_panel{
    flex: 10%;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
}

#user_theme{
    flex: 11%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Tables */
table {
    width: 90%;
    border-collapse: collapse;
    margin: 20px 5px;
    text-align: center;
}

table th, table td {
    padding: 8px;
    border: 1px solid rgba(129, 199, 132, 0.5); /* Table Border */
}

table th {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    background-color: #e8f5e9; /* Light Green */
    color: #2e7d32; /* Forest Green */
}

table tbody tr:hover {
    background-color: rgba(129, 199, 132, 0.1); /* Hover Glow */
}

#slave_table{
    flex: 1;
}

/* Gadgets & Panels */
#gadget_master_weather, #gadget_master_sensor, #up_time {
    padding: 20px;
    flex: 1;
    height: 400px;
    width: auto;
    border-radius: 10px;
    text-align: center;
    margin: 10px;
    background: linear-gradient(145deg, #ffffff, #e0f7fa); /* Subtle Gradient */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#weather_master_sensor, #weather_master_get, #weather_master_alerts{
  /*display: flex;*/
  /*justify-content: center;  Horizontal center*/ 
  align-items: center;     /* Vertical center */
}

/* Minimap */
#minimap {
    flex: 0 1 40%;
    height: auto;
    width: auto;
    border: 2px solid #81c784; /* Green Accent */
    border-radius: 10px;
}

/* Canvas (Charts) */
canvas {
    margin: 10px;
    border: 2px solid #81c784; /* Green Accent */
    border-radius: 10px;
}
#slave_charts {
    flex: 1;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    border-top: 2px solid #81c784; /* Green Accent */
    background-color: #f5efe8; /* Light Green */
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Toggle Switch */

#autorefresh_switch {
    /* font-family: 'Courier New', Courier, monospace; */
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2e7d32;
    /* font-size: 18px; */
    text-shadow: 1px 1px 2px #e8f5e9;
}

#autorefresh_switch span {
    /* font-weight: none; */
    letter-spacing: 1px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffffff, #c8e6c9);
    box-shadow: inset 2px 2px 5px #aaa, inset -2px -2px 5px #fff;
    cursor: pointer;
}

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

.slider {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: linear-gradient(145deg, #dcedc8, #81c784);
    box-shadow: 2px 2px 5px #aaa, -2px -2px 5px #fff;
    transition: 0.4s;
}

input:checked + .slider {
    left: 14px;
    background: linear-gradient(145deg, #388e3c, #66bb6a);
    box-shadow: 3px 3px 5px #aaa, -1px -1px 5px #388e3c;
}

#autorefresh_switch {
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

#autorefresh_switch:hover {
    opacity: 1;
}

input:checked ~ #autorefresh_switch {
    color: #2e7d32;
    opacity: 1;
}

/* Selectors */
select {
    padding: 1px 1px;
    border: 2px solid #81c784;
    border-radius: 5px;
    background: #ffffff;
    color: #2e7d32;
    font-size: 14px;
}

/* Input Fields */
input[type="text"], input[type="datetime-local"] {
    padding: 1px;
    border: 2px solid #81c784;
    border-radius: 5px;
    font-size: 14px;
    background: #ffffff;
    color: #2e7d32;
}

/* Output */
output {
    display: block;
    padding: 5px;
    border: 1px solid #81c784;
    border-radius: 5px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 14px;
}



/* Section */
#section_user, #stats {
    padding: 2px;
    margin: 2px 0;
    border: 2px solid #81c784; /* Green Accent */
    border-radius: 10px;
    background: linear-gradient(145deg, #ffffff, #e8f5e9); /* Subtle Gradient */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* Status Box Styling */
.status-box {
    display: flex;
    align-items: center;
    border-radius: 10px;
    padding: 10px 20px;
    margin: 10px 0;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Status Icons */
.status-icon {
    margin-right: 10px;
    font-size: 1.5em;
}

/* Alert Status (Red) */
.alert {
    background-color: #FF4C4C;
    color: #fff;
    border: 1px solid #FF0000;
}

/* Warning Status (Yellow) */
.warning {
    background-color: #FFD700;
    color: #333;
    border: 1px solid #FFC107;
}

/* Success Status (Green) */
.success {
    background-color: #32CD32;
    color: #fff;
    border: 1px solid #008000;
}

#system_status, #user_status{
    display: block;
    padding: 5px;
    border: 1px solid #81c784;
    border-radius: 5px;
    background: #e8f5e9;
    color: #2e7d32;
}

/* Common styles for both alert and no-alert cases */
#weather_master_alerts {
    padding: 10px;
    border-radius: 5px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

/* Style for alert (Yellow background with warning sign) */
.weather_alert {
    background-color: #fdd835; /* Yellow background */
    color: #333;
    /*font-weight: bold;*/
}

.weather_alert::before {
    content: "\26A0";/* Warning sign */
    margin-right: 10px;
    font-size: 16px; /* Increase size of the warning icon */
}

/* Style for no alert (Green background with OK sign) */
.no-weather_alert {
    background-color: #4caf50; /* Green background */
    color: white;
    /*font-weight: bold;*/
}

.no-weather_alert::before {
    content: "\2713" ;/* OK sign */
    margin-right: 10px;
    font-size: 16px; /* Increase size of the OK icon */
}

/* General styles for icons */
.weather-icon {
    display: flex;
    justify-content: flex-start;
    width: 30px;
    height: 30px;
    margin-right: 5px;
    vertical-align: middle;
}



/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
    }

    #content {
        flex-direction: column;
    }

    table, #gadget_master_weather, #gadget_master_sensor, #gadget-3, #gadget_master_UV, #minimap {
        width: 100%;
    }

    /*------------------------------------------------------------*/
    #master_visual, #slave_section, #main_section {
        flex-direction: column;
        align-items: center;
    }
    #stats, #autorefresh_panel, #user_theme {
        width: 100%;
    }
    
    /* Wrap tables in a scrollable container */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
    }
    
    table thead {
        display: table;
        width: 100%;
    }
    
    table tbody {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table th, table td {
        padding: 8px;
        font-size: 14px;
        white-space: nowrap;
        border: 1px solid rgba(129, 199, 132, 0.5);
    }
    
    /* Ensure minimap remains visible */
    #minimap {
        width: 100%;
        height: 250px;
        display: block;
        margin: 10px auto;
        overflow: hidden;
        border: 1px solid #81c784;
    }
}

/* Original Code Retained */

/* Responsive Design */
@media (max-width: 1024px) {
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    #content {
        flex-direction: column;
    }
    table, #gadget_master_weather, #gadget_master_sensor, #minimap {
        width: 100%;
    }
}