.pdf-merger-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
}

.drop-zone {
  position: relative;
  padding: 24px;
  text-align: center;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  cursor: pointer;
  padding-bottom: 35px;
  padding-top: 35px;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.pdf-list {
  margin-top: 16px;
  padding: 0;
  list-style-type: none;
}

.pdf-list li {
  background-color: #f0f0f0;
  padding: 12px;
  margin: 6px 0;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  gap: 10px;
}

.remove-btn {
  color: #e74c3c;
  cursor: pointer;
}

.merge-btn {
  background-color: #3498db;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 16px;
  transition: background-color 0.3s ease; /* Added transition for smooth effect */
}

.merge-btn:not(:disabled) {
  background-color: orange; /* Orange background when enabled */
}

.merge-btn:not(:disabled):hover {
  background-color: #121212; /* Dark background on hover when enabled */
}

.merge-btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

.checkbox-container {
  margin-top: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
}

.checkbox {
  margin-right: 8px;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.overlay-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top: 6px solid #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.filename-input {
  margin-top: 16px;
  padding: 10px;
  width: 100%;
  border: 1px solid #f7f7f7;
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
}

.drag-handle {
  font-size: 18px;
  cursor: grab;
  user-select: none;
  color: #888;
}

.sortable-chosen {
  background-color: #d1ecf1;
  transform: scale(1.02) rotate(1deg);
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sortable-ghost {
  opacity: 0.5;
  background-color: #ecf0f1;
  border: 2px dashed #95a5a6;
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* New CSS for preview overlay */
.pdf-preview-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: 10000;
}

.pdf-preview-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 90%;
}

.pdf-preview-container iframe {
  width: 100%;
  height: 100%;
  border: none; /* Remove iframe border */
}

.close-preview {
  position: absolute;
  top: 65px; /* Adjusted top position */
  right: 25px; /* Adjusted right position */
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 10001;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 40px; /* Adjusted width */
  height: 40px; /* Adjusted height */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1; /* Try to center the X vertically */
  transition: background-color 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: sans-serif; /* Ensure consistent font */
}

.close-preview:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Thumbnail Hover Styles */
.thumbnail-container {
  position: relative;
  display: inline-block;
}

.thumbnail-container:hover .preview-text {
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 13px;
  display: none;
  cursor: pointer;
  border-radius: 5px;
  text-align: center;
}

.thumbnail-canvas {
  max-width: 60px;
  transition: filter 0.3s ease;
  display: block;
  border-radius: 5px;
}

.thumbnail-container:hover .thumbnail-canvas {
  filter: brightness(0.7);
}

/* Toggle Switch Styles */
.toggle-container {
  display: flex;
  align-items: center;
  margin-top: 16px;
}

.toggle-label {
  margin-left: 10px;  /* Space between toggle and label */
  font-size: 14px;
  color: #555;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
