/* CSS untuk History Modal dengan max-width konsisten */

.text-center {
    text-align: center;
}

/* --- DEFINISI FINAL HISTORY MODAL --- */
.history-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: rgba(0,0,0,0.85) !important;
  z-index: 999999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: auto !important;
  padding: 20px !important;
  width: 100% !important;
  height: 100% !important;
}

.history-modal.show {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  animation: historyFadeIn 0.3s ease-out !important;
}

@keyframes historyFadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* Dialog dengan max-width konsisten */
.history-modal__dialog {
  background: #1f1f1f !important;
  max-width: 1200px !important;
  width: 100% !important;
  border-radius: 10px !important;
  position: relative !important;
  padding: 15px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  margin: 20px auto !important;
  overflow: hidden !important;
  min-height: 300px !important;
}

.history-modal__close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  background: #ffd700 !important;
  color: #111 !important;
  border: none !important;
  width: 36px !important;
  height: 36px !important;
  font-size: 22px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  line-height: 1 !important;
  z-index: 10 !important;
}

#historyFrame {
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  display: block !important;
  min-height: 300px !important;
}

/* Helper untuk status modal open */
body.modal-open {
  overflow: hidden !important;
}

.htitle {
    color: #ffd700;
    text-align: center;
    margin: 0 0 5px;
    font-size: 24px;
    width: 100%;
}

.hmarket, 
.pasaran-name {
  color: #ffd700;
  font-size: 18px;
  text-align: center;
  margin-bottom: 15px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* CSS untuk tabel di dalam iframe dengan max-width konsisten */
body.history-embed {
  margin: 0;
  padding: 0;
  background-color: transparent;
  overflow: hidden;
}

.history-embed .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.history-embed table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

.history-embed th, 
.history-embed td {
  padding: 8px 12px;
  text-align: center;
}

/* Mobile responsive untuk history modal */
@media (max-width: 768px) {
  .history-modal__dialog {
    max-width: calc(100% - 20px) !important;
    margin: 10px auto !important;
    padding: 10px !important;
  }
  
  .history-embed .container {
    padding: 0 10px;
  }
  
  .history-embed th,
  .history-embed td {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .htitle {
    font-size: 20px;
  }
  
  .hmarket,
  .pasaran-name {
    font-size: 16px;
  }
}