/* ==========================================================================
   MODAL DIALOG (PANDUAN / INFORMASI PENGGUNAAN)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--sidebar-bg);
  color: var(--text-color);
  border: 1px solid var(--sidebar-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  width: min(720px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--text-color);
  background: var(--btn-hover);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Sections & Cards dalam Modal */
.guide-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.guide-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-color);
}

.guide-section-header svg {
  color: var(--accent-focus);
  flex-shrink: 0;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.guide-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.guide-card-title {
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.guide-card-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Tabel Shortcut Keyboard */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}

.shortcuts-table tr:not(:last-child) {
  border-bottom: 1px solid var(--card-border);
}

.shortcuts-table td {
  padding: 0.6rem 0.9rem;
}

.shortcuts-table td:first-child {
  width: 140px;
  white-space: nowrap;
}

.shortcuts-table td:last-child {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-container {
    max-height: 90vh;
    border-radius: 16px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 0.9rem 1.1rem;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .shortcuts-table td:first-child {
    width: 110px;
  }
}

/* ---- Tablet / iPad ---- */
@media (max-width: 1024px) and (min-width: 641px) {
  .modal-container {
    width: min(640px, 92vw);
    max-height: 88vh;
  }
}



.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
