/* Slides Editor Styles - Matching editor.css structure */

body {
  overflow: hidden;
  height: 100vh;
}

#presentationTitle {
  min-width: 200px;
  border: 1px dashed transparent;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
}

#presentationTitle:focus {
  outline: none;
  border-color: var(--primary);
  background: color-mix(in hsl, var(--primary) 8%, var(--surface));
}

.formatbar {
  overflow-x: auto;
  scrollbar-width: thin;
}

.tool-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: color-mix(in hsl, var(--primary) 10%, var(--surface));
  transform: translateY(-1px);
}

.tool-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.color-picker {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Main slides container */
.slides-container {
  position: fixed;
  top: 125px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--bg);
  overflow: hidden;
}

/* Slides sidebar */
.slides-sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.slides-sidebar::-webkit-scrollbar {
  width: 8px;
}

.slides-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.slides-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.slides-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.slides-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.slide-thumbnail {
  position: relative;
  background: white;
  border: 2px solid var(--border);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-thumbnail:hover {
  border-color: var(--primary);
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slide-thumbnail.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in hsl, var(--primary) 30%, transparent);
  transform: scale(1.0);
}

.slide-thumbnail-content {
  width: 100%;
  height: 100%;
  transform-origin: top left;
  pointer-events: none;
}

.slide-number {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Canvas area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  overflow: auto;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}

.slide-canvas {
  position: relative;
  width: 960px;
  height: 540px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.slide-canvas:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.canvas-info {
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Slide elements */
.slide-element {
  position: absolute;
  cursor: move;
  user-select: none;
  transition: outline 0.15s ease;
}

.slide-element.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.slide-element:hover:not(.selected) {
  outline: 2px solid color-mix(in hsl, var(--primary) 50%, transparent);
  outline-offset: 2px;
}

.slide-element.text-box {
  padding: 12px;
  min-width: 100px;
  min-height: 50px;
  background: transparent;
  border: 1px dashed transparent;
  transition: border-color 0.15s ease;
}

.slide-element.text-box.selected {
  border-color: var(--primary);
}

.slide-element.text-box[contenteditable="true"] {
  outline: 2px solid var(--primary);
  cursor: text;
  background: rgba(255, 255, 255, 0.95);
}

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

.slide-element.shape-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape {
  width: 100%;
  height: 100%;
}

.shape.rectangle {
  background: var(--primary);
  border-radius: 4px;
}

.shape.circle {
  background: var(--secondary);
  border-radius: 50%;
}

.shape.triangle {
  width: 0;
  height: 0;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-bottom: 100px solid var(--success);
}

.shape.line {
  height: 4px;
  background: var(--text);
  width: 100%;
}

/* Resize handles */
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 50%;
  z-index: 10;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.resize-handle:hover {
  transform: scale(1.3);
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.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; }

/* Presentation mode */
.presentation-overlay {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.presentation-overlay[hidden] {
  display: none !important;
}

.presentation-controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  padding: 14px 28px;
  border-radius: 16px;
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.presentation-controls:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: translateX(-50%) translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.presentation-controls .icon-btn {
  color: white;
  transition: all 0.2s ease;
}

.presentation-controls .icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

#presentSlideCounter {
  font-size: 14px;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

.present-canvas {
  width: 90vw;
  height: 50.625vw;
  max-height: 90vh;
  max-width: 160vh;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* Shape modal */
.modal-card.small {
  width: 400px;
  max-height: 500px;
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.shape-option {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.shape-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.shape-preview {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-preview.rectangle {
  width: 80px;
  height: 60px;
  background: var(--primary);
  border-radius: 4px;
}

.shape-preview.circle {
  width: 70px;
  height: 70px;
  background: var(--secondary);
  border-radius: 50%;
}

.shape-preview.triangle {
  width: 0;
  height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 70px solid var(--success);
}

.shape-preview.line {
  width: 80px;
  height: 4px;
  background: var(--text);
}

.shape-option span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* File dropdown */
.dropdown-menu.wide {
  min-width: 220px;
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Layout modal */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.layout-option {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.layout-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.layout-preview {
  width: 100px;
  height: 70px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layout-preview.blank {
  background: white;
}

.layout-preview.title {
  justify-content: center;
  align-items: center;
}

.layout-preview .title-bar {
  width: 60%;
  height: 12px;
  background: var(--primary);
  border-radius: 2px;
}

.layout-preview .subtitle-bar {
  width: 40%;
  height: 8px;
  background: var(--muted);
  border-radius: 2px;
  margin-top: 4px;
}

.layout-preview .title-bar-small {
  width: 100%;
  height: 10px;
  background: var(--primary);
  border-radius: 2px;
}

.layout-preview .content-area {
  flex: 1;
  background: var(--border);
  border-radius: 2px;
}

.layout-preview .columns {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.layout-preview .col {
  background: var(--border);
  border-radius: 2px;
}

.layout-option span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .slide-canvas {
    width: 800px;
    height: 450px;
  }
}

@media (max-width: 900px) {
  .slides-sidebar {
    width: 180px;
  }
  
  .slide-canvas {
    width: 640px;
    height: 360px;
  }
}

@media (max-width: 768px) {
  .slides-container {
    flex-direction: column;
  }
  
  .slides-sidebar {
    width: 100%;
    height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .slides-list {
    flex-direction: row;
    overflow-x: auto;
  }
  
  .slide-thumbnail {
    min-width: 160px;
  }
}
