/* NotebookLM Slide Editor v2 - Custom Styles */

:root {
  --primary: #aa0000;
  --primary-dark: #880000;
  --primary-light: #cc3333;
}

/* Drop Zone */
#drop-zone.dragover {
  border-color: var(--primary);
  background-color: rgba(170, 0, 0, 0.05);
  transform: scale(1.01);
}

#drop-zone {
  transition: all 0.2s ease;
}

/* Progress */
.progress-item .status-icon .fa-check-circle {
  color: #10b981;
}

.progress-item .status-icon .fa-spinner {
  color: var(--primary);
}

.progress-bar {
  transition: width 0.3s ease;
}

/* Canvas container */
#canvas-container {
  position: relative;
  user-select: none;
}

#bg-canvas {
  display: block;
}

/* Elements layer */
#elements-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Slide element */
.slide-element {
  position: absolute;
  cursor: move;
  pointer-events: auto;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease;
  border-radius: 2px;
}

.slide-element:hover {
  outline: 2px dashed rgba(170, 0, 0, 0.5);
}

.slide-element.selected {
  outline: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(170, 0, 0, 0.2);
}

/* Resize handles */
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border: 2px solid white;
  border-radius: 2px;
  z-index: 100;
  pointer-events: auto;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.resize-handle.n { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.e { top: 50%; right: -5px; transform: translateY(-50%); cursor: e-resize; }
.resize-handle.w { top: 50%; left: -5px; transform: translateY(-50%); cursor: w-resize; }

/* Text element */
.slide-element.text-element {
  background: transparent;
  min-width: 30px;
  min-height: 20px;
}

.slide-element.text-element .text-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
  padding: 2px 4px;
}

.slide-element.text-element.editing {
  outline: 2px solid #3b82f6;
  background: rgba(255, 255, 255, 0.95);
}

.slide-element.text-element.editing .text-content {
  cursor: text;
}

/* Image element */
.slide-element.image-element {
  background-color: transparent;
  overflow: hidden;
}

.slide-element.image-element .element-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 9px;
  padding: 2px 4px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.slide-element.image-element:hover .element-label,
.slide-element.image-element.selected .element-label {
  opacity: 1;
}

/* Thumbnail */
.thumbnail {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.thumbnail:hover {
  border-color: rgba(170, 0, 0, 0.5);
}

.thumbnail.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(170, 0, 0, 0.3);
}

.thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

.thumbnail .slide-num {
  font-size: 10px;
  color: #666;
  text-align: center;
  padding: 2px;
  background: #f3f4f6;
}

/* Properties panel */
#properties-panel {
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
}

#properties-panel .prop-group {
  margin-bottom: 16px;
}

#properties-panel .prop-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
}

#properties-panel input[type="text"],
#properties-panel input[type="number"],
#properties-panel select,
#properties-panel textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

#properties-panel input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}

#properties-panel textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 9999;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.info { background: #3b82f6; }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay .spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #fff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 1200px) {
  #canvas-container {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
  }
  
  #bg-canvas {
    width: 100%;
    height: auto;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
