/* ============================================================
   style-pdf-viewer.css
   CSS untuk PDF Viewer Sakatoplan
   ============================================================ */

/* ============================================================
   1. MODAL PDF VIEWER
   ============================================================ */
.modal-pdf-viewer {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-pdf-viewer.show {
  display: flex !important;
  opacity: 1;
}

.modal-pdf-viewer .modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 0;
  width: 92%;
  max-width: 1000px;
  max-height: 92vh;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-pdf-viewer.show .modal-content {
  transform: scale(1);
}

/* ============================================================
   2. HEADER PDF VIEWER
   ============================================================ */
.modal-pdf-viewer .modal-header {
  padding: 16px 24px;
  border-bottom: 2px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.modal-pdf-viewer .modal-header h5 {
  font-weight: 700;
  color: #0a3d7c;
  margin: 0;
  font-size: 1.1rem;
}

.modal-pdf-viewer .modal-header h5 i {
  margin-right: 10px;
  color: #dc3545;
}

.btn-close-pdf {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #6c757d;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-close-pdf:hover {
  background: #f1f4f8;
  color: #dc3545;
  transform: rotate(90deg);
}

/* ============================================================
   3. BODY PDF VIEWER
   ============================================================ */
.modal-pdf-viewer .modal-body {
  padding: 20px;
  flex: 1;
  min-height: 400px;
  max-height: 70vh;
  overflow-y: auto;
  background: #f1f3f5;
}

.modal-pdf-viewer .modal-body #pdfCanvas {
  width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.modal-pdf-viewer .pdf-loader {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.modal-pdf-viewer .pdf-loader i {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 15px;
}

.modal-pdf-viewer .pdf-loader .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* ============================================================
   4. FOOTER PDF VIEWER
   ============================================================ */
.modal-pdf-viewer .modal-footer {
  padding: 12px 24px;
  background: #fff;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  border-radius: 0 0 16px 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-pdf-viewer .modal-footer .page-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-pdf-viewer .modal-footer .page-controls button {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: #fff;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.modal-pdf-viewer .modal-footer .page-controls button:hover {
  background: #e9ecef;
}

.modal-pdf-viewer .modal-footer .page-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-pdf-viewer .modal-footer .page-controls span {
  font-weight: 600;
  color: #495057;
  min-width: 80px;
  text-align: center;
}

/* ============================================================
   5. TOMBOL PDF
   ============================================================ */
.btn-download-pdf {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: #28a745;
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-download-pdf:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-print-pdf {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: #17a2b8;
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-print-pdf:hover {
  background: #138496;
  transform: translateY(-2px);
}

/* ============================================================
   6. RESPONSIVE PDF VIEWER
   ============================================================ */
@media (max-width: 768px) {
  .modal-pdf-viewer .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  .modal-pdf-viewer .modal-body {
    min-height: 300px;
    max-height: 60vh;
    padding: 12px;
  }
  .modal-pdf-viewer .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-pdf-viewer .modal-footer .page-controls {
    justify-content: center;
  }
  .modal-pdf-viewer .modal-footer .btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
  }
}