:root {
  --primary-color: #3498db;
  --primary-color-hover: #2980b9;
  --background-color: #f0f0f0;
  --text-color: #333;
  --heading-color: #2c3e50;
  --border-radius: 8px;
  --transition-duration: 0.3s;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  width: 100%;
  padding: 15px 0;
  background-color: #fdfdfd;
  border-bottom: 1px solid #dcdcdc;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-link {
  font-size: 2rem;
  color: #3498db;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1px;
  transition: color 0.3s, transform 0.3s;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 12px;
}

.header-link:hover {
  color: #2ecc71;
  transform: translateY(-3px);
}

.header-link:active {
  background-color: transparent;
}

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

#pdf-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.page-container {
  position: relative;
  flex: 0 1 calc(25% - 20px);
  max-width: calc(25% - 20px);
  padding: 10px;
  background-color: white;
  border-radius: var(--border-radius);
  transition: transform var(--transition-duration) ease;
  user-select: none;
  cursor: grab;
}

.page-container:hover {
  transform: scale(1.05);
}

.page-container.drag-over {
  border: 2px dashed var(--primary-color);
}

.page-container.selected {
  border: 2px solid var(--primary-color);
  transform: scale(1.05);
  cursor: grabbing;
}

.pdf-canvas {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  transition: transform var(--transition-duration) ease;
}

.page-number {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-size: 12px;
  color: var(--text-color);
  background-color: rgba(255, 255, 255, 0.7);
  padding: 2px 5px;
  border-radius: var(--border-radius);
}

.page-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity var(--transition-duration) ease;
}

.page-container:hover .page-actions {
  opacity: 1;
}

.action-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  padding: 5px;
  cursor: pointer;
  transition: background-color var(--transition-duration) ease;
}

.action-btn:hover {
  background-color: var(--primary-color-hover);
}

.upload-btn,
.download-btn,
.undo-btn {
  display: inline-block;
  margin: 10px 5px;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-duration) ease;
  text-align: center;
}

.upload-btn:hover,
.download-btn:hover,
.undo-btn:hover {
  background-color: var(--primary-color-hover);
}

.hidden {
  display: none;
}

/* Notification Styles */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #2ecc71;
  color: white;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.notification.show {
  display: block;
  opacity: 1;
}

.notification.hide {
  display: none;
  opacity: 0;
}

.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.zoom-container {
  position: relative;
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  max-width: 90%;
  max-height: 90%;
}

.zoom-canvas {
  width: 100%;
  height: auto;
}

@media (max-width: 1200px) {
  .page-container {
    flex: 0 1 calc(33.33% - 20px);
    max-width: calc(33.33% - 20px);
  }
}

@media (max-width: 768px) {
  .page-container {
    flex: 0 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}

@media (max-width: 480px) {
  .page-container {
    flex: 0 1 100%;
    max-width: 100%;
  }
}
