/* Google Fonts - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

* {
  /*margin: 0;*/
  /*padding: 0;*/
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  min-height: 100%;
  background: #1e1e1e;
}

nav {
    position: fixed; /* Assuming this is how you're positioning your menu */
    top: 0;
    left: 0;
    height: 70px;
    width: 100%;
    display: flex;
	justify-content: space-between;
    align-items: center;
    background: #444444;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
    z-index: 10; /* Higher z-index for the menu */
}

nav .logo {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.logo .menu-icon {
  color: #bbbbbb;
  font-size: 24px;
  margin-right: 14px;
  cursor: pointer;
}
.logo .logo-name {
  color: #bbbbbb;
  font-size: 24px;
  font-weight: 500;
}

.nav-actions
{
    margin-right: 20px;
	align-items: center;
}

.refresh-icon
{
    font-size: 28px;
    color: #bbbbbb;
    cursor: pointer;
    transition: 0.5s;
}

.refresh-icon:hover
{
    color: #ffffff;
    transform: rotate(180deg);
}

nav .sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  height: 100%;
  width: 260px;
  padding: 20px 0px;
  background-color: #444444;
  box-shadow: 0 5px 1px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
}
nav.open .sidebar {
  left: 0;
}
.sidebar .sidebar-content {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0px;
}
.sidebar-content .list {
  list-style: none;
}

.bottom-content {
    margin-left: -10px;
	margin-bottom: -20px;
    display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 10px 0px;
}

/* Styling for the list items within bottom-content */
.bottom-content .list {
	list-style: none;
}

/* You can further style the links inside the bottom-content */
.bottom-content .nav-link {
	margin-bottom: 10px;
}

/* Adjustments for the text and icons */
.bottom-content .icon {
	color: #bbbbbb;
    font-size: 20px; /* Adjust icon size */
    margin-right: 8px; /* Adjust space between icon and text */
}

.bottom-content .link {
    font-size: 16px; /* Adjust text size */
    color: #bbbbbb;
}

.list .nav-link {
  display: flex;
  align-items: center;
  margin-top: 5px;
  margin-left: -10px;
  margin-right: 10px;
  padding: 14px 12px;
  border-radius: 8px;
  text-decoration: none;
}

/* Active state for main menu items */
.list .nav-link.active {
  background-color: #4070f4;
  color: #fff;
  border-radius: 8px;
}

/* Change the icon and text color when active */
.list .nav-link.active .icon,
.list .nav-link.active .link {
  color: #fff;
}

.lists .nav-link:hover {
  background-color: #4070f4;
}
.nav-link .icon {
  margin-right: 14px;
  font-size: 20px;
  color: #bbbbbb;
}
.nav-link .link {
  font-size: 16px;
  color: #bbbbbb;
  font-weight: 400;
}
.lists .nav-link:hover .icon,
.lists .nav-link:hover .link {
  color: #fff;
}
.overlay {
  position: fixed;
  top: 0;
  left: -100%;
  height: 1000vh;
  width: 200%;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  background: rgba(0, 0, 0, 0.3);
}
nav.open ~ .overlay {
  opacity: 1;
  left: 260px;
  pointer-events: auto;
}




/* Initial styles for the submenu */
.sub-menu {
  list-style: none;
  background-color: rgba(240, 240, 240, 0.9);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
  margin-right: 5px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  position: relative;
  z-index: 1;
}

/* Styles for submenu items */
.sub-menu li {
  margin: 0;
}

.sub-menu li a {
  display: block;
  margin-top: 0px;
  padding: 10px 16px;
  font-size: 14px;
  color: #555;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
}

/* Active state for submenu items */
.sub-menu li a.active {
  background-color: #4070f4;
  color: #fff;
  border-radius: 6px;
}

/* Optional: Add subtle border or shadow for the active submenu item */
.sub-menu li a.active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Highlight submenu items on hover */
.sub-menu li a:hover {
  background-color: #4070f4;
  color: #fff;
}

/* Styles when the submenu is open */
.arrow.showMenu .sub-menu {
  max-height: 300px; /* Set to a large enough value to accommodate all items */
  padding: 0px;
}


/* Rotate the arrow icon when .showMenu is active */
.arrow .arrow-icon {
  margin-left: auto;
  transition: transform 0.3s;
}

.arrow.showMenu .arrow-icon {
  transform: rotate(180deg);
}




.main-content
{
  margin: 80px 5px 0px 0px; /* Adjust for the fixed navbar and sidebar */
  padding: 0px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  min-width: 310px; 
  max-width: 620px;
  height: auto;
  /*background-color: white;*/ /*#92a8d1;*/
  background-color: #1e1e1e; /* General background color */
  font-family: Arial, sans-serif;
  color: #BBBBBB;
}

/* Headings */
.main-content h1, .main-content h2 {
  color: #333; /* Dark text color */
}

/* Paragraphs */
.main-content p {
  color: #555; /* Lighter text color */
  line-height: 1.6; /* Improve readability */
}

/* Lists */
.main-content ul {
  list-style-type: disc; /* Bullet points for lists */
  margin-left: 20px; /* Indent list */
}

.header {
    background-color: #00cc66;
    padding: 15px;
    text-align: center;
    position: relative;
    border-radius: 10px;
    transition: margin-left 0.4s ease; /* Add transition for smooth effect */
}

.header .title
{
	font-size: 24px;
	margin: 0;
}

.header .device-name
{
	margin-bottom: -13px;
	font-size: 16px; 
	color: #000000;
}

.header .last-updated
{
	margin-top: -5px;
	font-size: 11px; 
	color: #000000;
}

.gauge-container
{ 
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around; /* Space the gauges evenly */
}
		
.GaugeMeter
{
	Height: 80%;
	margin-left: -7px;
	margin-bottom: -40px;
	Position: Relative;
	Text-Align: Center;
	Overflow: Hidden;
	Cursor: Default;
}

.GaugeMeter SPAN,
.GaugeMeter B
{
	Margin:	0 23%;
	Width: 54%;
	Position: Absolute;
	Text-Align: Center;
	Display: Inline-Block;
	/*Color: RGBa(0,0,0,.8);*/
	Color:#aaaaaa;
	Font-Weight: 50;
	Font-Family: "Open Sans", Arial;
	Overflow: Hidden;
	White-Space: NoWrap;
	Text-Overflow: Ellipsis;
}
.GaugeMeter[data-style="Semi"] B
{
	Margin: 0 10%;
	Width: 80%;
}

.GaugeMeter S,
.GaugeMeter U
{
	Text-Decoration:None;
	Font-Size: .30em;
	Font-Weight: 50;
	Opacity: .6;
}

.GaugeMeter B
{
	Color: Black;
    Font-Weight: 50;
    Font-Size: 0.85em;
    Opacity: .8;
	margin-top: -8px;
}

.container
{
	max-width: 100%;
}

.data-section
{
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 5px;
	text-align: center;
	margin-top: 1px;
}

.data-section-wide
{
	display: flex;
	flex-direction: column; 
    align-items: center; 
	text-align: center;
	margin-top: 5px;
}
    
.data-item
{
	background-color: #333333; /* Slightly lighter background for data sections */
	padding: 0px;
	border-radius: 10px;
}

.data-item-wide
{
	width: 100%;
	height: 100%;
	display: flex; 
	flex-direction: column;
	background-color: #333333; /* Slightly lighter background for data sections */
	padding: 1px;
	border-radius: 10px;
}

.data-item-wide-title
{  
	font-family: "Poppins", sans-serif;
	font-weight: bold;
    text-align: center;
    font-size: 16px; 
    color: #aaaaaa; 
    margin-top: 1px; 
	margin-bottom: -2px;
}


.data-item h2,
.data-item-wide h2
{
	font-size: 8px;
	margin-bottom: -5px;
	color: #aaaaaa;
}

.data-item .value,
.data-item-wide .value
{
	font-size: 22px;
	color: #00ccff;
}

.light-container-group
{
	width: 100%;
	margin-top: -1px;
	margin-bottom: 5px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-evenly;
}

.light-container-group h2
{
	font-size: 8px;
	margin-bottom: -5px;
	color: #aaaaaa;
}

.data-item .light-container,
.data-item-wide .light-container
{
	width: calc(100% / 7); /* subtract the gap if used */
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.reading .light,
.data-item .light,
.data-item-wide .light
{
    width: 25px;
    height: 25px;
	margin-top: 5px;
	margin-bottom: 5px;
    border-radius: 50%;
    background-color: #444;
    box-shadow: 0 0 6px rgba(255, 255, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.reading .light.on,
.data-item .light.on,
.data-item-wide .light.on
{
    background-color: yellow;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

.debug-table {
  display: flex;
  flex-direction: column;
  padding: 0 10px 10px;
  gap: 4px;
}

.debug-row {
  display: flex;
  justify-content: space-between;
  color: #cccccc;
  font-size: 14px;
  padding: 2px 0;
  border-bottom: 1px solid #2a2a2a;
}

.debug-label {
  font-weight: bold;
  color: #aaaaaa;
}

.debug-value {
  text-align: right;
  color: #00ccff;
}

.chart-section
{
	margin-top: 5px;
	background-color: #333333; /* Match the data section background */
	padding: -5x;
	border-radius: 10px;
	text-align: center;
}

.chart_container
{
	margin-bottom: 0px;
}

.PV-charts
{
	background-color: #444444; /* Differentiating color for chart placeholder */
	height: 300px;
	border-radius: 10px;
	display: flex;
	justify-content: center;
	align-items: center;
	color: #777777;
}




.control-group
{
	margin-top: 2px;
    margin-bottom: 0px;
    text-align: left;
    padding: 8px;
	font-size: 14px;
    border-radius: 8px;
    background-color: #333333; /* Slightly lighter dark background */
}


.locked 
{
    position: relative; /* To allow positioning of the overlay */
    opacity: 0.4; /* Makes the contents semi-transparent */
    pointer-events: none; /* Prevents interaction with inputs */
}

.locked::after
{
    content: ""; /*PAUSE CHARGING TO UNLOCK*/
    position: absolute;
	top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(100, 0, 0, 0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
	border-radius: 10px;
}

label
{
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
	font-family: 'Roboto', sans-serif;
    color: #fff; /* White text for dark background */
}

input[type="number"],
input[type="password"]
{
    width: calc(100%);
    padding: 7px;
	padding-left: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
    font-size: 14px;
}

input[type="password"]
{
	padding: 10px;
}

.segmented-toggle
{
  display: inline-flex;
  border: 1px solid #555;
  border-radius: 8px;
  overflow: hidden;
  background-color: #222;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.segmented-toggle input[type="radio"] 
{
	display: none
}

.segmented-toggle label
{
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  user-select: none;
  background-color: #333;
  border-right: 1px solid #555;
  transition: background-color 0.2s, color 0.2s;
  margin: 0;
  line-height: 1.2;
  vertical-align: middle;
}

.segmented-toggle label:last-of-type
{
  border-right: none;
}

.segmented-toggle input[type="radio"]:checked + label
{
  background-color: #007bff;
  color: white;
}



.toggle-modern
{
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.toggle-label
{
  display: flex;
  margin: 0px;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #555;
  border-radius: 8px;
  overflow: hidden;
  background-color: #333;
  padding: 7px 10px;
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

.switch
{
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input
{
  opacity: 0;
  width: 0;
  height: 0;
}

.slider
{
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before
{
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider
{
  background-color: #007bff;
}

input:checked + .slider:before
{
  transform: translateX(26px);
}


.btn
{
	display: flex;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin: 5px;
	margin-top: -10px;
	margin-bottom: 0px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-inactive {
    background-color: #555555;
}

.btn-danger:hover {
    background-color: #b02a37;
}

.info
{
	font-size: 11px;
    color: #ccc;
    margin-top: 2px;
    cursor: pointer;
}


/* Loading Message Styling */
.loading-message {
    display: flex;
    flex-direction: row;
    align-items: center;
    color: #d9534f;
    font-size: 12px;
    font-weight: bold;
    margin: 10px 0;
}

.spinner {
    border: 3px solid #555555;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    margin-right: 8px;
	margin-left: 20px;
    animation: spin 1s linear infinite;
	flex-shrink: 0; /* Prevent spinner from shrinking */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}





/* Make form act like a normal control-group */
.device-select-form {
    width: 100%;
}

/* Wrapper becomes full width */
.select-wrapper.wide {
    position: relative;
    width: 100%;
}

/* Select styled like your inputs */
.select-wrapper.wide select {
    width: 100%;
    height: 40px;

    appearance: none;
    background-color: #1e1e1e;
    color: #fff;

    border: 1px solid #333;
    border-radius: 8px;
	border-color: #555;

    padding: 8px 40px 8px 12px;
    font-size: 14px;

    transition: border-color 0.2s, box-shadow 0.2s;
}

.select-wrapper.wide select:focus {
    outline: none;
    border-color: #4da3ff;
    box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.25);
}

/* Arrow stays on the right */
.select-wrapper.wide .select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #888;
    font-size: 22px;
}





.notification {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Overlay background */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; /* Initially transparent */
    transition: opacity 0.3s ease-in-out; /* Smooth fade-in/out */
    font-family: Arial, sans-serif;
}

.notification.show
{
	display: flex;
	opacity: 1;
}

.notification .notification-content {
    background-color: #1e1e1e; /* Match general background */
    padding: 20px;
    border-radius: 8px; /* Match rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Similar shadow */
    text-align: center;
    max-width: 620px;
    color: #fff; /* White text for contrast */
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification .notification-content h2 {
    margin-top: 0;
    color: #00cc66; /* Accent color, similar to headings */
    font-size: 1.5em;
    text-align: center;
}

.notification .notification-content p {
    margin: 10px 0 20px;
    color: #c0c0c0; /* Light gray for less emphasis */
    text-align: center;
}

.notification .notification-content button {
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #007bff; /* Match button colors */
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s;
}

.notification .notification-content button:hover {
    background-color: #0056b3; /* Darker hover effect */
}




.message {
  background-color: #2a2a2a; /* Dark background */
  width: calc(100% - 0em);
  padding: 1em 1.5em;
  border-left-width: 6px;
  border-left-style: solid;
  border-radius: 8px;
  position: relative;
  line-height: 1.6;
  color: white; /* White text for readability */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); /* Subtle shadow for depth */
  
  & + & {
    margin-top: 0.5em; /* Spacing between messages */
  }
  
  &:before {
    color: #2a2a2a;
    width: 1.5em;
    height: 1.5em;
    position: absolute;
    top: 1em;
    left: -3px;
    border-radius: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    line-height: 1.5;
    text-align: center;
    font-size: 1em; /* Consistent icon size */
  }
  
  p {
    margin: 0 0 1em;
    color: #aaaaaa;
	font-size: 14px;
    line-height: 1.4;
    &:last-child {
      margin-bottom: 0;
    }
  }
  
  h2 {
    margin: 0;
    color: #ffffff;
    font-size: 22px; /* Larger font for message type */
    line-height: 1.2;
  }
  
  .message-time {
    display: block;
    margin-bottom: 2px; /* Spacing under timestamp */
    color: #aaaaaa;
    font-size: 12px;
    line-height: 1;
  }
  
  .message-id {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 12px;
    color: #aaaaaa;
  }
}

.message--success {
  border-left-color: #28a745;
  
  &:before {
    background-color: #28a745;
    color: white;
    content: "✔";
  }
}

.message--info {
  border-left-color: #1e90ff;
  
  &:before {
    background-color: #1e90ff;
    color: white;
    content: "ⓘ";
  }
}

.message--warning {
  border-left-color: #ffc107;
  
  &:before {
    background-color: #ffc107;
    color: black;
    content: "!";
  }
}

.message--error {
  border-left-color: #dc3545;
  
  &:before {
    background-color: #dc3545;
    color: white;
    content: "✖";
  }
}


.header_dashboard {
  margin: 15px 0 10px;
  border-left: 4px solid #00c9a7;
  padding-left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header_dashboard .title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.status-light {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border-radius: 50%;
    background-color: #444; /* default off */
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.status-light.green {
    background-color: #0f0;
    box-shadow: 0 0 15px rgba(0,255,0,0.7);
}

.status-light.red {
    background-color: #f00;
    box-shadow: 0 0 15px rgba(255,0,0,0.7);
}

.card {
  background: #2a2a2a;
  border-radius: 16px;
  padding: 10px;
  margin: 10px 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ===== Data Section ===== */
.data-section_dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin: 15px 0;
}

.data-item_dashboard:hover {
  background: #242424;
}

.data-item_dashboard h2 {
  font-size: 0.8rem;
  font-weight: 500;
  color: #9e9e9e;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-item_dashboard .value {
  font-size: 1.3rem;
  font-weight: 600;
  color: #00c9a7; /* accent */
}

.device-card{
    background:#2e2e2e;
    border-radius:16px;
    margin-bottom:10px;
    cursor:pointer;
    transition:0.25s;
    border:1px solid #2a2a2a;
}
.device-card:hover{
    background:#252525;
}

.device-summary{
    display:flex;
	justify-content: space-between;
    padding:10px 14px;
    gap:12px;
}

.device-name{
	display:flex;
    align-items:center;
    gap:10px;
    font-size:20px;
    font-weight:600;
}

.device-last{
    font-size:13px; 
    opacity:0.6;
    margin-top:4px;
}

.device-right
{
	display:grid;
	grid-template-columns: 140px;
    align-items:center;
	justify-content: end;
}

.reading{
    font-size:17px;
    font-weight:600;
    text-align: center;
}

.reading .gpio_status_box
{
	display: flex; 
	justify-content: space-evenly; 
	align-content: center; 
	align-items: center; 
	border: 1px solid #555; 
	border-radius: 8px;
}

.status-badge{
    margin-top:6px;
    font-size:12px;
    padding:4px 10px;
    border-radius:20px;
    width:fit-content;
}

.status-badge.ok{
    background:#193d2b;
    color:#42ff9b;
}

.status-badge.error{
    background:#3d1919;
    color:#ff6b6b;
}

.status-badge.off{
    background:#3d1919;
    color:#ff6b6b;
}

.status-badge.on{
    background:#193d2b;
    color:#42ff9b;
}

.device-details{
    max-height:0;
    overflow:hidden;
    transition:max-height 0.35s ease;
}

.device-details.open{
    max-height:2000px;
    margin-top:0px;
}