/* =========================================================
   MEDIAPIPE-MONITOR.CSS
   Style khusus panel analisis & tabel sudut

   Fokus baru:
   - index.html tetap menampilkan Mediapipe tanpa tabel angle
   - dashboard.html menampilkan Mediapipe + tabel angle lengkap
   - panel hasil ROM dibagi menjadi 2 bagian tabel
   - kolom indikator dipaksa lebih pendek
   - kolom nilai dipaksa lebih lebar
   - jarak indikator ke nilai dibuat rapat
   ========================================================= */

/* =========================================================
   AREA KAMERA / MEDIAPIPE
   ========================================================= */
.input_video {
  display: none;
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: auto;
}

.rom-canvas-wrapper {
  position: relative;
  width: 100%;
  min-height: auto;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.96));
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.output_canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  border-radius: 14px;
}

/* =========================================================
   DASHBOARD LAYOUT ROM
   ========================================================= */
.dashboard-page {
  padding-bottom: 32px;
}

.rom-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.rom-dashboard-header__left {
  flex: 1 1 auto;
}

.rom-dashboard-header__right {
  flex: 0 0 280px;
}

.rom-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 150, 153, 0.08);
  color: #0f766e;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid rgba(0, 150, 153, 0.12);
  margin-bottom: 14px;
}

.rom-dashboard-title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  color: #111827;
}

.rom-dashboard-subtitle {
  margin: 0;
  max-width: 760px;
  font-size: 15px;
  line-height: 1.7;
  color: #4b5563;
}

.rom-status-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.rom-status-card__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 8px;
}

.rom-status-card__value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.rom-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.14);
}

.rom-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(650px, 1.12fr);
  gap: 20px;
  align-items: start;
}

.rom-camera-panel,
.rom-results-panel {
  min-width: 0;
}

.rom-results-panel {
  min-width: 650px;
}

/* =========================================================
   CARD UMUM DASHBOARD
   ========================================================= */
.rom-card {
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.rom-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background:
    linear-gradient(180deg, rgba(249, 250, 251, 0.98), rgba(255, 255, 255, 0.98));
}

.rom-card__header--results {
  padding-bottom: 16px;
}

.rom-card__body {
  padding: 22px 24px 24px;
}

.rom-card__eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: #6b7280;
}

.rom-card__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  color: #111827;
}

.rom-card--camera .rom-card__body {
  padding: 18px;
}

.rom-camera-stage {
  width: 100%;
}

/* =========================================================
   PANEL HASIL ROM
   ========================================================= */
.angle-table-panel {
  position: static;
  bottom: auto;
  left: auto;
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  text-align: left;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.panel-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  color: #1f2937;
  letter-spacing: 0.2px;
}

.separator {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 8px 0 12px;
}

/* =========================================================
   BOX DURASI
   ========================================================= */
.time-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background-color: rgba(0, 150, 153, 0.08);
  border: 1px solid rgba(0, 150, 153, 0.14);
  font-size: 13px;
  color: #374151;
}

.time-box span {
  font-weight: 600;
}

#time {
  font-weight: 800;
  color: #009699;
}

/* =========================================================
   GRID HASIL ROM DUA BAGIAN
   ========================================================= */
.rom-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.rom-table-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rom-table-section__title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 8px;
  padding-left: 4px;
}

/* =========================================================
   WRAPPER TABEL
   ========================================================= */
.rom-table-wrapper {
  width: 100%;
  overflow-x: visible;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

/* =========================================================
   TABEL HASIL
   Fokus utama:
   - kolom indikator dipaksa pendek
   - kolom nilai dipaksa lebar
   - jarak jadi rapat
   ========================================================= */
#angleDataLeft,
#angleDataRight {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  background-color: #ffffff;
}

#angleDataLeft thead tr,
#angleDataRight thead tr {
  background-color: #f3f4f6;
}

#angleDataLeft th,
#angleDataRight th {
  padding: 11px 10px;
  font-size: 10.5px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  border-bottom: 1px solid #e5e7eb;
}

#angleDataLeft td,
#angleDataRight td {
  padding: 9px 10px;
  font-size: 10px;
  line-height: 1.24;
  color: #1f2937;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

#angleDataLeft tbody tr:last-child td,
#angleDataRight tbody tr:last-child td {
  border-bottom: none;
}

#angleDataLeft tbody tr:hover,
#angleDataRight tbody tr:hover {
  background-color: #f9fafb;
}

/* kolom indikator: dipendekkan paksa */
#angleDataLeft td:first-child,
#angleDataLeft th:first-child,
#angleDataRight td:first-child,
#angleDataRight th:first-child {
  width: 60%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  padding-right: 2px;
}

/* kolom nilai: diperlebar paksa */
#angleDataLeft td:last-child,
#angleDataLeft th:last-child,
#angleDataRight td:last-child,
#angleDataRight th:last-child {
  width: 40%;
  text-align: right;
  white-space: nowrap;
  font-weight: 800;
  padding-right: 10px;
  padding-left: 0;
}

/* =========================================================
   FOOTER PANEL
   ========================================================= */
#footer {
  text-align: center;
  font-size: 12px;
  margin-top: 14px;
  color: #555;
  display: none !important;
}

#footer div {
  margin-top: 5px;
}

#footer .kedua {
  margin-top: -2px;
  font-size: 10px;
}

#recordData {
  margin-top: 12px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1600px) {
  .rom-dashboard-layout {
    grid-template-columns: minmax(0, 1fr) minmax(620px, 1.08fr);
    gap: 18px;
  }

  .rom-results-panel {
    min-width: 620px;
  }
}

@media (max-width: 1450px) {
  .rom-dashboard-layout {
    grid-template-columns: minmax(0, 1fr) minmax(590px, 1.04fr);
    gap: 16px;
  }

  .rom-results-panel {
    min-width: 590px;
  }

  #angleDataLeft td,
  #angleDataRight td {
    font-size: 9.7px;
  }

  #angleDataLeft td:first-child,
  #angleDataLeft th:first-child,
  #angleDataRight td:first-child,
  #angleDataRight th:first-child {
    width: 58%;
  }

  #angleDataLeft td:last-child,
  #angleDataLeft th:last-child,
  #angleDataRight td:last-child,
  #angleDataRight th:last-child {
    width: 42%;
  }
}

@media (max-width: 1320px) {
  .rom-dashboard-layout {
    grid-template-columns: minmax(0, 1fr) minmax(560px, 1fr);
    gap: 16px;
  }

  .rom-results-panel {
    min-width: 560px;
  }

  .rom-dashboard-title {
    font-size: 24px;
  }

  #angleDataLeft th,
  #angleDataRight th {
    font-size: 10px;
  }

  #angleDataLeft td,
  #angleDataRight td {
    font-size: 9.5px;
  }

  #angleDataLeft td:first-child,
  #angleDataLeft th:first-child,
  #angleDataRight td:first-child,
  #angleDataRight th:first-child {
    width: 56%;
  }

  #angleDataLeft td:last-child,
  #angleDataLeft th:last-child,
  #angleDataRight td:last-child,
  #angleDataRight th:last-child {
    width: 44%;
  }
}

@media (max-width: 1200px) {
  .rom-dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .rom-dashboard-header__right {
    flex: 1 1 auto;
  }

  .rom-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .rom-results-panel {
    min-width: 0;
  }

  .rom-card__title {
    font-size: 20px;
  }

  #angleDataLeft td:first-child,
  #angleDataLeft th:first-child,
  #angleDataRight td:first-child,
  #angleDataRight th:first-child {
    width: 68%;
    white-space: normal;
  }

  #angleDataLeft td:last-child,
  #angleDataLeft th:last-child,
  #angleDataRight td:last-child,
  #angleDataRight th:last-child {
    width: 32%;
  }
}

@media (max-width: 992px) {
  .rom-results-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .rom-canvas-wrapper {
    padding: 10px;
  }

  #angleDataLeft td,
  #angleDataRight td {
    font-size: 10px;
  }
}

@media (max-width: 576px) {
  .rom-dashboard-title {
    font-size: 21px;
  }

  .rom-dashboard-subtitle {
    font-size: 14px;
  }

  .rom-badge {
    font-size: 12px;
    padding: 7px 10px;
  }

  .rom-card {
    border-radius: 18px;
  }

  .rom-card__header {
    padding: 16px 16px 12px;
  }

  .rom-card__body {
    padding: 16px;
  }

  .rom-card__title {
    font-size: 18px;
  }

  .rom-status-card {
    padding: 16px;
    border-radius: 16px;
  }

  .rom-table-section__title {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .rom-results-grid {
    gap: 12px;
  }

  #angleDataLeft td,
  #angleDataRight td {
    font-size: 9.8px;
  }
}

/* =========================================================
   PRINT STYLE
   ========================================================= */
@media print {
  nav,
  footer,
  #recordData,
  #downloadLinkWrapper,
  .custom-ui,
  .rom-status-card,
  .rom-badge {
    display: none !important;
  }

  .main-wrapper {
    padding-top: 0;
  }

  .rom-dashboard-layout {
    display: block;
  }

  .rom-card,
  .angle-table-panel {
    box-shadow: none;
    border: none;
    background: #ffffff;
  }

  .rom-card__header,
  .rom-card__body {
    padding-left: 0;
    padding-right: 0;
  }

  .canvas-wrapper,
  .rom-canvas-wrapper {
    min-height: auto;
    background: #ffffff;
    border: none;
  }
}