body {
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
  flex-direction: column;
}

#topbar {
  width: 100%;
  background: #333;
  color: white;
  display: flex;
  //justify-content: center;
  gap: 8px;
  padding: 10px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
}

#topbar button {
  padding: 8px 10px;
  border: none;
  background: #0078d4;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}





#sidebar {
  width: 230px;
  background: #f7f7f7;
  border-right: 2px solid #ccc;
  padding: 10px;
  position: fixed;
  top: 50px;
  bottom: 0;
  overflow-y: auto;  /* Scroll eklendi */
  overflow-x: hidden;
}




.sigorta-item {
  padding: 8px;
  margin-bottom: 10px;
  background: #0078d4;
  color: #fff;
  border-radius: 5px;
  text-align: center;
  cursor: grab;
}

#workspace {
  flex: 1;
  position: absolute;
  left: 250px;
  top: 50px;
  right: 0;
  bottom: 0;
  background: #e9ecef;
  overflow: hidden;
}

.sigorta {
  position: absolute;
  width: 100px;
  height: 70px;
  background: #fff;
  border: 2px solid #0078d4;
  border-radius: 8px;
  text-align: center;
  cursor: move;
  user-select: none;
  z-index: 5;
}

.connector {
  width: 10px;
  height: 10px;
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
}

.connector-top {
  top: -5px;
}

.connector-bottom {
  top: 60px;
}

#cableLayer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}


/* Orange sebeke buttons */
.grid-item {
  background: #d77600 !important;
}

/* Workspace block for sebeke */
.grid-block {
  border: 2px solid #FF8C00 !important;
  background: #FFEFD5 !important;
}


/* Baralar sidebar button */
.bara-item {
  background: #555 !important;
  color: white;
}

/* Bara block in workspace */
.bara-block {
  position: absolute;
  width: 200px;
  height: 50px;
  background: #f2f2f2;
  border: 2px solid #555;
  border-radius: 8px;
  text-align: center;
  line-height: 50px;
  font-weight: bold;
  cursor: move;
  user-select: none;
  z-index: 5;
}


/* Make sidebar buttons smaller */
#sidebar .sigorta-item, 
#sidebar .grid-item, 
#sidebar .bara-item {
  font-size: 12px;
  padding: 5px;
  margin-bottom: 6px;
}


/* Print styling: only workspace area will be printed */
@media print {
  body * {
    visibility: hidden;
  }
  #workspace, #workspace * {
    visibility: visible;
  }
  #workspace {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}


/* Selected element highlight (baras, sigortas, grids) */
.selected { border: 2px solid red !important; }









select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #c9e2f1;
  color: #333;
  font-size: 14px;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 110px;
  cursor: pointer;

  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20,50 70,100 120,50' stroke='%23333' stroke-width='15' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: border-color 0.3s;
margin-bottom:8px;
}

#sigortaAdi:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.4);
}



.json-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.json-buttons button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.json-buttons button:hover {
  background-color: #0056b3;
}



.priz {
  border: 2px solid #85817e !important;
  background: #76d0af !important;
width:65px;
color:black;
}





.sigorta.solar {
  width: 70px;
  height: 70px;
  background: #1e3a5f;
  border: 2px solid #0d1a2b;
  border-radius: 6px;
  position: absolute;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  color: #ffffff;
  box-shadow: inset 0 0 8px rgba(0, 255, 255, 0.3), 2px 2px 6px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Panel ızgara çizgileri */
.sigorta.solar::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 10px;
  width: 50px;
  height: 40px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 10px 10px;
}

/* Z şekli için üst katman */
.sigorta.solar::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 20px;
  top: 25px;
  left: 15px;
  background: rgba(0, 255, 255, 0.15);
  transform: skewY(-20deg) rotate(-10deg);
  border: 1px solid rgba(0, 255, 255, 0.3);
}

/* Bağlantı konnektörleri (alt) */
.sigorta.solar .connector {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  bottom: 5px;
}





.sigorta.charger {
  width: 260px;
  height: 75px;
  background: #1f2d3a;
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 6px;
  border: 2px solid #34495e;
  text-align: center;
  line-height: 20px;
  padding-top: 5px;
  box-shadow: inset 0 0 10px #0ff3, 2px 2px 6px rgba(0,0,0,0.3);
  position: absolute;
}

/* Ortak konnektör */
.sigorta.charger .connector {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  font-size: 10px;
  color: #fff;
  text-align: center;
  line-height: 16px;
  border: 1px solid #ccc;
  font-weight: bold;
}




/* Labeled konektör */
.connector.labeled {
  width: 18px;
  height: 18px;
  color: white;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 18px;
  border-radius: 50%;
  border: 1px solid #222;
}



/* Konumlara göre */
.connector-bottom {
  bottom: -8px;
}
.connector-top {
  top: -8px;
}
.connector-left {
  left: -8px;
}










.sigorta.battery {
  width: 60px;
  height: 70px;
  background: #e8ff00;
  border: 2px solid #555;
  color: black;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  padding-top: 5px;
  border-radius: 4px;
  position: absolute;
}

.sigorta.battery .connector {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
}

.sigorta.battery .connector span {
  position: absolute;
  top: -16px;
  left: 2px;
  font-size: 13px;
  color: #000;
  font-weight: bold;
}




.sigorta.regulator {
  width: 130px;
  height: 75px;
  background: #be8080;
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 6px;
  border: 2px solid #34495e;
  text-align: center;
  line-height: 20px;
  padding-top: 5px;
  box-shadow: inset 0 0 10px #0ff3, 2px 2px 6px rgba(0,0,0,0.3);
  position: absolute;
}

.sigorta.charger .regulator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  font-size: 10px;
  color: #fff;
  text-align: center;
  line-height: 16px;
  border: 1px solid #ccc;
  font-weight: bold;
}





.sigorta.jenerator {
  width: 130px;
  height: 75px;
  background: #dee375;
  color: black;
  font-size: 12px;
  font-weight: bold;
  border-radius: 6px;
  border: 2px solid #34495e;
  text-align: center;
  line-height: 20px;
  padding-top: 5px;
  box-shadow: inset 0 0 10px #0ff3, 2px 2px 6px rgba(0,0,0,0.3);
  position: absolute;
}
