/* ==============================================================================
   STYLE CÔ ĐỌNG (KẾT HỢP VỚI BOOTSTRAP 5)
   Chỉ giữ lại các quy tắc cần thiết cho SVG 16:9, Toàn màn hình & In ấn
   ============================================================================== */

/* Khung chứa sơ đồ 16:9 co giãn */
.stage-wrapper {
  overflow: hidden;
  flex: 1 1 0;
  height: calc(100vh - 40px);
  min-height: 0;
}

#svg-canvas {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100%;
  display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  user-select: none;
}

/* Kéo thả file Excel vào màn hình */
body.drag-active::after {
  content: "📥 Thả file Excel (.xlsx) vào đây để nạp dữ liệu";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  color: #38bdf8;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  border: 4px dashed #38bdf8;
  pointer-events: none;
}

/* Fullscreen Mode & Auto-hide Toolbar */
.fullscreen-hover-trigger {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 1040;
}

body.is-fullscreen .fullscreen-hover-trigger {
  display: block;
}

body.is-fullscreen #top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 1050;
}

body.is-fullscreen .fullscreen-hover-trigger:hover ~ #top-navbar,
body.is-fullscreen #top-navbar:hover {
  transform: translateY(0);
  opacity: 1;
}

body.is-fullscreen .stage-wrapper {
  height: 100vh !important;
  flex: 1 1 100vh !important;
  padding: 0 !important;
}

body.is-fullscreen #diagram-container {
  box-shadow: none !important;
}

body.is-fullscreen #btn-exit-fs {
  display: block !important;
}

/* In ấn chuẩn trang ngang 16:9 */
@media print {
  @page {
    size: landscape;
    margin: 0;
  }
  body {
    background: #fff !important;
  }
  .no-print, nav, .btn, .fullscreen-hover-trigger {
    display: none !important;
  }
  .stage-wrapper {
    height: 100vh !important;
    padding: 0 !important;
  }
  #diagram-container,
  #svg-canvas {
    box-shadow: none !important;
  }
}
