.editor-container {
  display: none;
  margin-top: 30px;
}

.editor-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
}

.main-editor {
  flex: 1;
  min-width: 0;
}

.toolbar {
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.tool-btn {
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #1e3a8a;
  position: relative;
  white-space: nowrap;
}

.tool-btn:hover {
  background: #e5e7eb;
  border-color: #4f46e5;
}

.tool-btn.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.tool-btn i {
  font-size: 16px;
}

.cta-button {
  background: #fbbf24;
  color: #1e3a8a;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #1e3a8a;
  cursor: pointer;
}

.cta-button:hover {
  background: #f59e0b;
}

.properties-dropdown {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 4px solid #1d0cff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  padding: 15px;
  z-index: 1000;
  width: max-content;
  max-width: 95vw;
  cursor: auto;
}

#drawProperties .property-row,
#shapeProperties .property-row {
  align-items: end;
}

#drawProperties .cta-button,
#shapeProperties .cta-button {
  padding: 7px 9px;
}

#drawProperties .property-row .cta-button i,
#shapeProperties .property-row .cta-button i {
  font-size: 14px;
  margin-right: 0;
}

.tool-btn.active .properties-dropdown {
  display: block;
}

.property-row {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.property-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.property-item .color-select {
  display: flex;
  gap: 5px;
}

.property-item label {
  font-size: 13px;
  font-weight: 500;
  color: #1e3a8a;
  white-space: nowrap;
}

.property-item input[type="number"],
.property-item select {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  min-width: 80px;
}

.property-item input[type="color"] {
  width: 40px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
}

.property-item input[type="text"] {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
}

.page-thumbnails {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.thumbnails-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 245px);
}

.page-thumbnails h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #1e3a8a;
}

.thumbnail-item {
  margin-bottom: 12px;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 8px;
  padding: 8px;
  transition: all 0.3s;
  background: #f9fafb;
}

.thumbnail-item:hover {
  border-color: #e5e7eb;
  background: #f3f4f6;
}

.thumbnail-item.active {
  border-color: #4f46e5;
  background: #eff6ff;
}

.thumbnail-item canvas {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.thumbnail-item .page-label {
  text-align: center;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.thumbnail-item.active .page-label {
  color: #4f46e5;
}

.canvas-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  padding: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.pdf-page-wrapper {
  position: relative;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background: white;
  display: none;
  max-width: 100%;
  max-height: 100%;
}

.pdf-page-wrapper.active {
  display: block;
}

.pdf-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.annotation-item {
  position: absolute;
  pointer-events: all;
  cursor: move;
  user-select: none;
}

.text-annotation {
  border: 2px dashed transparent;
  padding: 5px;
  min-width: 100px;
  min-height: 30px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.text-annotation:hover {
  border-color: #4f46e5;
}

.text-annotation.selected {
  background: transparent;
  border-color: #4f46e5;
}

.image-annotation {
  border: 2px solid transparent;
}

.image-annotation:hover,
.image-annotation.selected {
  border-color: #4f46e5;
}

.image-annotation img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.shape-annotation {
  border: 2px solid transparent;
  pointer-events: all;
}

.shape-annotation:hover,
.shape-annotation.selected {
  border-color: #4f46e5;
}

.annotation-controls {
  position: absolute;
  top: -35px;
  right: 0;
  display: none;
  gap: 5px;
  background: white;
  padding: 5px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.annotation-item.selected .annotation-controls,
.annotation-item:hover .annotation-controls {
  display: flex;
}

.control-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  color: #374151;
}

.control-btn:hover {
  background: #e5e7eb;
}

.control-btn.delete-btn {
  color: #ef4444;
}

.control-btn.delete-btn:hover {
  background: #fee2e2;
}

.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #4f46e5;
  border: 2px solid white;
  border-radius: 50%;
  display: none;
  z-index: 10;
}

.annotation-item.selected .resize-handle {
  display: block;
}

.resize-handle.se {
  bottom: -5px;
  right: -5px;
  cursor: se-resize;
}

.resize-handle.ne {
  top: -5px;
  right: -5px;
  cursor: ne-resize;
}

.resize-handle.sw {
  bottom: -5px;
  left: -5px;
  cursor: sw-resize;
}

.resize-handle.nw {
  top: -5px;
  left: -5px;
  cursor: nw-resize;
}

input[type="file"].hidden {
  display: none;
}

.drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.drawing-canvas.active {
  display: block;
  pointer-events: all;
}

.file-info {
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-info-left i {
  color: #ef4444;
  font-size: 24px;
}

.file-name-text {
  font-weight: 600;
  color: #1e3a8a;
}

.delete-file-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.delete-file-btn:hover {
  background: #dc2626;
}

.upload-loader {
  margin-top: 15px;
  text-align: center;
  color: #4f46e5;
  font-weight: 500;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  margin: 0 auto 8px;
  animation: spin 1s linear infinite;
}

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

.note {
  text-align: center;
  margin-top: 20px;
  color: #6b7280;
  font-size: 14px;
}

@media (max-width: 1024px) {
  .editor-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  .main-editor {
    order: 1;
  }

  .thumbnails-scroll {
    max-height: 200px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }

  .thumbnail-item {
    display: inline-block;
    max-width: 100px;
    margin-right: 12px;
    vertical-align: top;
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .toolbar {
    gap: 8px;
    padding: 12px;
  }

  .tool-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .tool-btn span {
    display: none;
  }

  .properties-dropdown {
    width: 90vw;
    max-width: none;
  }

  .property-row {
    gap: 10px;
  }

  .sidebar {
    order: 1;
  }

  .main-editor {
    order: 2;
  }

  .cta-button i {
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .property-item input[type="number"],
  .property-item select {
    min-width: 60px;
  }
}

/* Custom Modal Alert */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.custom-modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.custom-modal-overlay.active .custom-modal {
  transform: scale(1);
}

.custom-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.custom-modal-icon.warning {
  background-color: #fef3c7;
  color: #f59e0b;
}

.custom-modal-icon.danger {
  background-color: #fee2e2;
  color: #ef4444;
}

.custom-modal-icon.success {
  background-color: #d1fae5;
  color: #10b981;
}

.custom-modal-icon.info {
  background-color: #dbeafe;
  color: #3b82f6;
}

.custom-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.custom-modal-message {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.custom-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.custom-modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  min-width: 80px;
}

.custom-modal-btn:hover {
  transform: translateY(-1px);
}

.custom-modal-btn:active {
  transform: translateY(0);
}

.custom-modal-btn.btn-cancel {
  background-color: #f3f4f6;
  color: #374151;
}

.custom-modal-btn.btn-cancel:hover {
  background-color: #e5e7eb;
}

.custom-modal-btn.btn-confirm {
  background-color: #ef4444;
  color: white;
}

.custom-modal-btn.btn-confirm:hover {
  background-color: #dc2626;
}

.custom-modal-btn.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.custom-modal-btn.btn-primary:hover {
  background-color: #2563eb;
}

/* Mobile responsiveness */
/* Custom Modal Alert */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.custom-modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.custom-modal-overlay.active .custom-modal {
  transform: scale(1);
}

.custom-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.custom-modal-icon.warning {
  background-color: #fef3c7;
  color: #f59e0b;
}

.custom-modal-icon.danger {
  background-color: #fee2e2;
  color: #ef4444;
}

.custom-modal-icon.success {
  background-color: #d1fae5;
  color: #10b981;
}

.custom-modal-icon.info {
  background-color: #dbeafe;
  color: #3b82f6;
}

.custom-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.custom-modal-message {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.custom-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.custom-modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  min-width: 80px;
}

.custom-modal-btn:hover {
  transform: translateY(-1px);
}

.custom-modal-btn:active {
  transform: translateY(0);
}

.custom-modal-btn.btn-cancel {
  background-color: #f3f4f6;
  color: #374151;
}

.custom-modal-btn.btn-cancel:hover {
  background-color: #e5e7eb;
}

.custom-modal-btn.btn-confirm {
  background-color: #ef4444;
  color: white;
}

.custom-modal-btn.btn-confirm:hover {
  background-color: #dc2626;
}

.custom-modal-btn.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.custom-modal-btn.btn-primary:hover {
  background-color: #2563eb;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .custom-modal {
    padding: 20px;
    max-width: 340px;
  }

  .custom-modal-title {
    font-size: 16px;
  }

  .custom-modal-message {
    font-size: 13px;
  }

  .custom-modal-buttons {
    flex-direction: column-reverse;
  }

  .custom-modal-btn {
    width: 100%;
  }
}
