/* ============================================================
   PDF VIEWER - Standalone viewer untuk dashboard
   Theme: Hamim (#e26100 orange)
   ============================================================ */

#pdf-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#pdf-viewer-overlay.visible {
  display: flex;
  opacity: 1;
}

#pdf-viewer-container {
  width: 95%;
  max-width: 1400px;
  height: 90vh;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

/* ===== Header ===== */
#pdf-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(135deg, #e26100, #ff8f3d);
  color: #ffffff;
  flex-shrink: 0;
}

#pdf-viewer-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pdf-viewer-actions {
  display: flex;
  gap: 8px;
}

.pdf-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.pdf-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pdf-action-btn.pdf-close {
  background: rgba(0, 0, 0, 0.2);
}

.pdf-action-btn.pdf-close:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ===== Toolbar ===== */
#pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  gap: 16px;
}

#pdf-draw-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

#pdf-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-tool-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #ffffff;
  color: #414344;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.pdf-tool-btn:hover {
  background: #e26100;
  border-color: #e26100;
  color: #ffffff;
}

#pdf-draw-toggle.active {
  background: #e26100;
  border-color: #e26100;
  color: #ffffff;
}

.pdf-color-btn {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.pdf-color-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pdf-color-btn.active {
  border-color: #414344;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #414344;
}

#pdf-zoom-label {
  min-width: 50px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #414344;
}

/* ===== Canvas Area ===== */
#pdf-canvas-wrap {
  flex: 1;
  overflow: auto;
  background: #e8e8e8;
  position: relative;
  padding: 20px;
}

#pdf-pages-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform-origin: top center;
  transition: transform 0.2s ease;
}

.pdf-page-canvas {
  display: block;
  width: 100%;
  border-bottom: 2px solid #e0e0e0;
}

.pdf-page-canvas:last-child {
  border-bottom: none;
}

/* Drawing Canvas Overlay */
#pdf-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#pdf-draw-canvas.draw-active {
  pointer-events: auto;
  cursor: crosshair;
}

/* ===== Loading State ===== */
#pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #666;
}

/* ===== Responsive Mobile ===== */
@media (max-width: 768px) {
  #pdf-viewer-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  #pdf-viewer-header {
    padding: 12px 16px;
  }

  #pdf-viewer-title {
    font-size: 16px;
  }

  .pdf-action-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .pdf-action-btn i {
    font-size: 14px;
  }

  #pdf-toolbar {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  #pdf-draw-tools {
    gap: 6px;
  }

  .pdf-tool-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .pdf-color-btn {
    width: 24px;
    height: 24px;
  }

  #pdf-canvas-wrap {
    padding: 10px;
  }

  #pdf-zoom-label {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .pdf-action-btn span {
    display: none;
  }

  .pdf-action-btn {
    padding: 8px;
    min-width: 36px;
  }
}
