body {
  background-color: black;
  color: white;
  margin: 0;
  font-family: 'Arial', sans-serif;
}
*{
  box-sizing: border-box;
}
a{
  text-decoration: none;
}
h4{
  margin: 0px;
}

.time{
  font-weight: bold;
}
#fieldSpace {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1; /* behind all content */
  width: 100%;
  height: 100%;
  background: black;
}
.maincontent{
  display: flex;
}
header {
  display: flex;
  align-items: center;
  padding: 10px 30px;
  background-color: #000000;
  border-bottom: 1px solid white;
}

.logoa {
  font-size: 24px;
  font-weight: bold;
  color:#66ccff;
}



.user {
  display: flex;
  align-items: center;
  gap: 15px; /* space between link and button */
  margin-left: auto; /* pushes .user all the way to the right */
}

.monitor{
  width: 33%;
  text-align: center;
}
.logotime{
width: 33%;
align-items: center;
}
main {
  display: block;
  height: 100%;
}

.center-block {
  width: 50%;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cube-placeholder {
  width: 300px;
  height: 300px;
  background-color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  border: 2px solid white;
  border-radius: 3px;
  transition: 0.3s;
}

.cube-placeholder:hover {
  background-color: #777;
}

.sidebar {
  width: 50%;
  padding: 20px;
  position: relative;
}

h2 {
  margin-top: 0;
}

.object-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-left: 15%;
  

}

.object-card {
  border: 1px solid white;
  padding: 10px 15px;
  cursor: pointer;
  background-color: rgb(0, 0, 0);
  border-radius: 3px;
  transition: 0.3s;
  width: 65%;

}
.objname {
  margin :5px;
  text-align: left;
}
.object-card:hover {
  background-color: rgba(255,255,255,0.1);
}

.object-details {
  background-color: rgba(255,255,255,0.1);
  margin-top: 10px;
  padding: 10px;
  /*border: 1px solid white;*/
  border-radius: 3px;
}
.object-details p{
  margin: 3px 0px;

}
/* Панель выбора под графиком */
.controlschart {
  display: flex;
  gap: 20px; /* Space between elements */
  padding: 10px;
}

.controlschart div {
  display: flex;
  flex-direction: column;
  flex: 1; /* Equal width */
  font-size: 14px;
  min-width: 0;
}
input[type="date"] {
  flex: 1 1 0;          /* allow shrinking and growing */
  min-width: 0;         /* remove browser default min-width */
  background-color: black;
  color: white;
  border: 1px solid white;
  border-radius: 3px;
  padding: 10px 15px;
  text-align: start;
  width: 100%;          /* let flexbox control the width */
  box-sizing: border-box;
}
select, input[type="date"] {
    /*-webkit-appearance: none; 
  -moz-appearance: none;
  appearance: none;*/
  background-color: black;
  color: white;
  border: 1px solid white;
  border-radius: 3px;
  padding: 10px 15px;
  text-align: start;
  width: 100%;
  height: 100%;
}

select:focus, input[type="date"]:focus {
  outline: none;
  border-color: #888;
}

canvas {
  background-color: #000000;
  width: 100%;
  height: 500px;
}


/* Убираем полоску прокрутки, но оставляем прокрутку колесиком */
.sidebar::-webkit-scrollbar {
  width: 0;
  background: transparent;
}
.sidebar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
  margin-bottom: 100px;
}
.logout-button {
  margin-left: 15px;
  background-color: transparent;
  color: white;
  border: 1px solid white;
  border-radius: 3px;
  padding: 5px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  font-weight: bold;
}

.logout-button:hover {
  background-color: white;
  color: black;
}

.create-button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #2b72ff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.create-button:hover {
  background-color: #174dcc;
}
.delete-button {
  background-color: #000000;
  color: white;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid white;
  font-weight: 600;
  text-align: right;
}
.delete-button:hover {
  background-color: #ffffff;
  color: rgb(0, 0, 0);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background-color: #4caf50;
}

.status-dot.offline {
  background-color: #f44336;
}
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.online {
  background-color: #4CAF50; /* Зеленый */
}

.status-indicator.offline {
  background-color: #F44336; /* Красный */
}


    .controllers {
    position: fixed;
    bottom: 30px;
    right: 120px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    background: rgb(72 72 72 / 90%);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    width: auto;
    max-width: none;
    z-index: 1000;
}

#save-settings {
    background-color: #4554a0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#save-settings:hover {
    background-color: #4554a0;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
/* Add these styles to your existing CSS */
.parameter-headers {
    display: flex;
    padding:15px;
    border-bottom: 1px solid #333;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
}



.parameter-header.name {
    width: 25%;
}

.parameter-header.value {
    width: 15%;
        text-align: center;
}

.parameter-header.settings {
    width: 60%;
        text-align: center;
}

.parameter-row {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px 15px;
    border-bottom: 1px solid #333;
}

.parameter-name {
    width: 25%;
    font-size: 18px;
}

.parameter-value {
    width: 15%;
    font-size: 18px;
    text-align: center;
}

.parameter-controls {
    width: 60%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-label {
    width: 50px;
    text-align: right;
    font-size: 14px;
}

.range-input {
    flex-grow: 1;
    height: 2px;
}

.value-input {
    width: 100px;
    padding: 8px;
    background: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 3px;
    text-align: center;
}

.control-row.mid .value-input {
    margin-left: auto;
}
    #map {
      width: 100%;
      height: 100%;
    }
    .loading {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1000;
      background: white;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 0 10px rgba(0,0,0,0.2);
      color: black;
    }
    .error-message {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: white;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 0 10px rgba(0,0,0,0.2);
      text-align: center;
      z-index: 1000;
      color: black;
    }
    .selecter {
    padding: 10px 15px;
    padding-right: 35px;
    border-radius: 3px;
    border: 1px solid #ddd;
    background-color: rgb(0, 0, 0);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 200px;
    color: rgb(255, 255, 255);
}
.l0006{
  position: fixed;
    top: 12%; left:3%; max-width: 40%;z-index: -1;
}
.l0007{
  position: fixed;
    top: 39%; right:8%; max-width: 25%;z-index: -1;
}
.l0004phone{
  display: none;
}
.controllers {
    padding: 8px 10px;
  }
/* Responsive Design for Tablets (768px and below) */
@media all and (max-width: 768px) {
  #map{
    height: 50vh;
  }
  .maincontent {
    flex-direction: column; /* Stack center-block and sidebar vertically */
    min-height: calc(100vh - 51px); /* Adjust for smaller header */
  }
  header {
    padding: 8px 15px; /* Reduce padding */
  }

  .logo {
    font-size: 20px; /* Smaller logo */
  }

  .user {
    gap: 10px;
  }

  .logout-button {
    padding: 4px 10px;
    font-size: 12px;
    min-width: 60px; /* Touch-friendly */
  }

  .monitor, .logotime {
    width: 33%; /* Maintain proportions */
    font-size: 14px;
  }

  .center-block, .sidebar {
    width: 100%; /* Full width */
    padding: 15px;
  }



  .object-list {
    padding-left: 0; /* Remove left padding */
    align-items: center;
  }

  .object-card {
    width: 65%; /* Wider cards for better readability */
    padding: 8px 12px;
  }

  .controlschart {
    gap: 10px;
    padding: 8px;
    margin-bottom: 35px;
  }

  .controlschart div {
    font-size: 12px;
  }

  select, input[type="date"] {
    padding: 8px;
    font-size: 14px;
  }

  canvas {
    height: 300px; /* Reduce canvas height */
  }
}

/* Responsive Design for Phones (425px and below) */
@media all and (max-width: 435px) {
  .l0006{
    all: unset;
display: block;
}
.l0007{
  all: unset;
  display: block;
  max-width: 70%
}
.l0004{
  display: none;
}
.l0004phone{
  display: block;
}
  .selecter{
    min-width: 100px;
  }
  .maincontent {
    min-height: calc(100vh - 41px); /* Adjust for smaller header */
  }

  header {
    padding: 6px 10px;
    flex-wrap: wrap; /* Allow wrapping for very small screens */
  }

  .logo {
    font-size: 18px;
  }

  .user {
    gap: 8px;
    flex-wrap: wrap;
  }

  .logout-button {
    padding: 3px 8px;
    font-size: 11px;
    min-width: 50px;
  }

  .monitor, .logotime {
    width: 100%; /* Stack vertically if needed */
    font-size: 12px;
    text-align: center;
  }

  .center-block {
    padding: 10px;
  }

  .cube-placeholder {
    width: 150px;
    height: 150px;
    font-size: 16px;
  }

  .sidebar {
    padding: 10px;
  }

  .object-list {
    gap: 10px;
  }

  .object-card {
    width: 65%; /* Full width */
    padding: 6px 10px;
  }

  .objname {
    margin: 3px;
    font-size: 14px;
  }

  .object-details {
    padding: 8px;
  }

  .object-details p {
    font-size: 12px;
  }

  .controlschart {
    padding: 5px;
  }

  .controlschart div {
    font-size: 11px;
  }

  select, input[type="date"] {
    padding: 6px;
    font-size: 12px;
  }

  canvas {
    height: 200px; /* Further reduce canvas height */
  }



  #save-settings {
    padding: 6px 12px;
    font-size: 12px;
  }

  .parameter-headers {
    font-size: 14px;
    padding: 8px;
    flex-wrap: wrap;
  }



  .parameter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .parameter-name, .parameter-value {
    width: 100%;
    font-size: 14px;
    text-align: left;
  }

  .parameter-controls {
    width: 100%;
  }

  .control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .control-label {
    width: 100%;
    text-align: left;
    font-size: 11px;
  }

  .value-input {
    width: 100%;
    padding: 5px;
  }

  .range-input {
    width: 100%;
  }
  header {
    flex-direction: column;      /* stack header sections vertically */
    align-items: center;
    gap: 5px;
    text-align: center;
  }

  .logotime {
    width: 100%;
    justify-content: center;
    padding: 0;
  }

  .logo {
    font-size: 20px;
  }

  .time {
    padding-left: 10px !important;
    font-size: 12px;
  }

  .monitor {
    width: 100%;
    text-align: center;
    font-size: 12px;
    margin-top: 3px;
  }

  .user {
    width: 100%;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-top: 5px;
  }

  .logout-button {
    font-size: 11px;
    padding: 4px 10px;
  }
}

