/* ===================== */
/* GLOBAL */
/* ===================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  text-align: center;
  background: #f5f5f5;
}

h1 {
  margin: 10px;
}


/* ===================== */
/* MAP CONTAINER */
/* ===================== */
#map {
  width: 100%;
  height: 90vh;
  position: relative;
  overflow: hidden;
}


/* ===================== */
/* MAP CONTENT (TRANSFORM TARGET) */
/* ===================== */
#map-content {
  width: 100%;
  height: 100%;
  position: relative;

  transform-origin: center center;
  transition: transform 0.3s ease;
}


/* ===================== */
/* SVG */
/* ===================== */
#floor-svg {
  width: 100%;
  height: 100%;
}


/* ===================== */
/* SVG INTERACTION */
/* ===================== */
#visual rect,
#visual path {
  cursor: pointer;
  pointer-events: all;
  transition: 0.2s;
}

#visual rect:hover,
#visual path:hover {
  opacity: 0.7;
}

#visual rect:not([fill]),
#visual path:not([fill]) {
  fill: transparent;
}


/* ===================== */
/* DEVICE ANCHOR (HIDDEN) */
/* ===================== */
#devices path {
  opacity: 0;
}


/* ===================== */
/* ICON LAYER */
/* ===================== */
#icon-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.device-icon {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 22px;
  cursor: pointer;
}

.device-icon:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

/* ===================== */
/* TOOLTIP */
/* ===================== */
#tooltip {
  position: fixed;
  background: black;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  pointer-events: none;
  z-index: 999;
}

.hidden {
  display: none;
}


/* ===================== */
/* CONTROLS (GENERAL) */
/* ===================== */
.view-controls,
.left-controls {
  z-index: 20;
}


/* ===================== */
/* ROTATE CONTROLS */
/* ===================== */
.rotate-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.rotate-controls button {
  pointer-events: auto;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 12px 16px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 10px;
}

.rotate-controls button:hover {
  background: black;
}


/* ===================== */
/* VIEW CONTROLS */
/* ===================== */
.view-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.view-controls button {
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}


/* ===================== */
/* LEFT CONTROLS */
/* ===================== */
.left-controls {
  position: absolute;
  top: 10px;
  left: 10px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  background: rgba(0,0,0,0.6);
  padding: 8px 10px;
  border-radius: 6px;
  color: white;
  font-size: 14px;
}

.checkbox-row {
  display: flex;
  gap: 10px;
}

/* ===================== */
/* LABEL LAYER */
/* ===================== */
#label-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: bold;
  color: black;
  background: rgba(255,255,255,0.8);
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

/* TEXT */
.label-text {
  display: inline-block; /* 🔥 WAJIB */
  font-size: 12px;
  font-weight: bold;
  color: black;

  background: rgba(255,255,255,0.85);
  padding: 2px 4px;
  border-radius: 3px;

  white-space: nowrap;
}

/* ===================== */
/* SIDE PANEL */
/* ===================== */
#side-panel {
  position: fixed;
  top: 20%;
  right: 10%;

  width: 300px;
  height: 50%;

  background: white;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  border-left: 2px solid #ccc;
  z-index: 100;
  padding: 16px;

  overflow-y: auto;

    /* 🔥 TAMBAHKAN INI */
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical center */
  align-items: center;     /* horizontal center */
  text-align: center;      /* teks rata tengah */
}

/* hidden state */
#side-panel.hidden {
  display: none;
}

/* isi panel */
#side-panel h2 {
  margin-top: 0;
}

/* ===================== */
/* SIDE PANEL CONTENT */
/* ===================== */

.panel-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
}

.panel-subtitle {
  font-size: 16px;
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
}

.panel-text {
  font-size: 14px;
  margin-bottom: 10px;
}

.panel-footer {
  margin-top: 20px;
  text-align: center;
}

.panel-footer a {
  color: blue;
  text-decoration: underline;
  font-weight: bold;
}

.input-field {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

#btn-submit {
  margin-right: 10px;
}

/* ===================== */
/* RECENT REPORTS CONTENT */
/* ===================== */

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 13px;
  text-align: left;
  table-layout: fixed; /* 🔥 penting */
}

.report-table td {
  padding: 4px 8px;  /* 🔥 tambahin horizontal spacing */
  vertical-align: top;
}

/* kolom ID */
.col-id {
  width: 80px;
  font-family: monospace;
  color: #888;
  text-align: left;
}

/* kolom pesan */
.col-pesan {
  padding: 0 8px;
  word-break: break-word;
  text-align: left;
  width: auto;
}

/* kolom status */
.col-status {
  text-align: right;
  font-weight: 500;
  width: 70px;
}

/* ===================== */
/* LEFT PANEL (STATIC) */
/* ===================== */
#left-panel {
  position: fixed;
  top: 30%;
  left: 5%;
  background: #ffffff;
  border-right: 2px solid #ddd;   /* lebih soft */
  box-shadow: 4px 0 15px rgba(0,0,0,0.15); /* lebih jelas */
  display: flex;

  width: 25%;
  height: 50%;

  z-index: 100;
  padding: 16px;

  overflow-y: auto;

  flex-direction: column;
  justify-content: flex-start; /* 🔥 beda dari side-panel */
  align-items: stretch;
  text-align: left;
}

/* default: desktop → sembunyikan */
#btn-left-close {
  display: none;
}

/* ===================== */
/* LEFT PANEL HEADER */
/* ===================== */
/* HEADER FIXED */
#left-panel-header {
  flex: 0 0 auto;
  background: white;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
  position:relative;
}

.left-panel-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* CONTENT SCROLL */
#left-panel-content {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* tombol close (pojok kanan atas) */
#btn-left-close {
  position: absolute;   /* 🔥 gak perlu absolute lagi */
  top: 8px;
  right: 8px;

  margin: 0;

  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;

  padding: 4px 8px;
}

.left-panel-header h2 {
  margin: 0;
  padding-right: 30px;     /* kasih space buat tombol */
}

/* ===================== */
/* MOBILE LEFT PANEL */
/* ===================== */
@media (max-width: 1024px) {

  #left-panel {
    top: 0;
    left: 0;
    width: 80%;
    height: 100%;

    /* ❌ HAPUS display none */
    /* display: none !important; */

    transform: translateX(-100%);
    transition: transform 0.3s ease;

    z-index: 999;
  }

  #left-panel.active {
    transform: translateX(0);
  }
}

/* mobile → tampilkan */
@media (max-width: 1024px) {
  #btn-left-close {
    display: block;
  }
}

/* ===================== */
/* LEFT PANEL - TIKET */
/* ===================== */
.col-ticket {
  width: 90px;              /* biar konsisten */
  font-family: monospace;   /* biar rata */
  color: #666;              /* opsional biar subtle */
}

.col-device {
  width: 90px;              /* biar konsisten */
  font-weight: bold;
  color: #666;              /* opsional biar subtle */
}

