html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden
}

:root {
  --slide-base-width: 1280px;
  --slide-base-height: 720px;
  --slide-scale: 1;
  --primary-color: #4285f4;
  --danger-color: #dc3545;
  --panel-width: 300px;
  --container-scale: 0.5;
  --presentation-scale: 1;
  --aspect-ratio: calc(16 / 9);
}

#app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #2f2f2f;
  color: #fff;
  height: 60px;
  box-sizing: border-box
}

.toolbar-group {
  display: flex;
  gap: 0.5rem;
  align-items: center
}

#formattingToolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
  justify-content: center
}

#app-toolbar button,
#app-toolbar select,
#app-toolbar input[type="color"] {
  margin: 0;
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 4px
}

#app-toolbar button {
  background: #444;
  color: #fff;
  cursor: pointer
}

#app-toolbar button:hover {
  background: #666
}

#app-toolbar .primary-btn {
  background: #4285f4;
  padding: 0.5rem 1rem;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center
}

#app-toolbar .primary-btn:hover {
  background: #5294ff
}

#app-toolbar .danger-btn {
  background: #dc3545;
  padding: 0.5rem 1rem;
  font-weight: bold
}

#app-toolbar .danger-btn:hover {
  background: #e25563
}

#editor-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
  position: relative;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  box-sizing: border-box;
}

#slide-browser {
  width: 200px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #f5f5f5;
  border-right: 1px solid #ddd;
  flex-shrink: 0;
  z-index: 1;
}

#thumbnails-container {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 10px;
  width: calc(100% - 10px)
}

.slide-thumbnail {
  width: 160px;
  height: 90px;
  border: 1px solid #ccc;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s
}

.slide-thumbnail:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15)
}

.slide-thumbnail.active {
  border: 2px solid #4285f4
}

.slide-thumbnail.dragging {
  opacity: 0.7;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 10
}

.drag-over-indicator {
  width: 160px;
  height: 5px;
  background: #4285f4;
  margin: 5px 0;
  border-radius: 2px
}

.slide-thumbnail-content {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden
}

.slide-thumbnail-content .slide {
  transform: scale(0.125);
  transform-origin: top left;
  width: 800%;
  height: 800%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1 !important;
  transition: none !important;
  animation: none !important;
  display: block !important
}

.slide-thumbnail-delete {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(220, 53, 69, 0.8);
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2
}

.slide-thumbnail:hover .slide-thumbnail-delete {
  opacity: 1
}

main#slideContainer {
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #1a1a1a;
}

#slide-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#slide-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--slide-base-width);
  height: var(--slide-base-height);
  transform: translate(-50%, -50%) scale(var(--container-scale, 0.5));
  transform-origin: center center;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#slide-canvas-scaler {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: top left;
  aspect-ratio: 16 / 9;
}

.presenting #slide-canvas {
  position: fixed;
  top: 50%;
  left: 50%;
  width: var(--slide-base-width);
  height: var(--slide-base-height);
  transform: translate(-50%, -50%) scale(var(--presentation-scale, 1));
  z-index: 1000;
  background: #fff;
  padding: 0;
  margin: 0;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden
}

.presenting #editor-container,
.presenting main#slideContainer {
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent
}

.presenting .slide {
  width: 100%;
  height: 100%;
  padding: 2rem;
  margin: 0;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  transition: none;
}

.slide {
  opacity: 0;
  transition: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 2rem;
  overflow: hidden;
  outline: 0;
  cursor: text
}

.slide.active {
  opacity: 1
}

/* Remove transition animation classes */
.slide.transition-next, .slide.transition-prev {
  /* No transitions */
}

/* Remove unnecessary animations */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(1)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

.slide[contenteditable="true"] {
  transition: none;
  animation: none
}

.slide-hidden {
  display: none !important
}

#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  height: 40px;
  box-sizing: border-box;
  border-top: 1px solid #ddd;
  flex-shrink: 0
}

#zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  margin-right: auto
}

#zoom-level {
  font-size: 14px;
  min-width: 45px;
  text-align: center
}

#zoom-controls button {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: bold
}

#zoom-controls button:hover {
  background: #e5e5e5
}

#slide-counter {
  font-size: 14px;
  color: #555
}

.slide h1,
.slide h2,
.slide h3,
.slide p {
  margin: 0 0 1rem
}

.presenting #app-toolbar,
.presenting #slide-browser,
.presenting #status-bar {
  display: none
}

.presenting {
  overflow: hidden;
  background: #000
}

.exit-presentation {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 1001;
  transition: opacity 0.6s ease
}

.exit-presentation:hover {
  background: rgba(0, 0, 0, 0.7);
  opacity: 1 !important
}

.exit-presentation.fade-out {
  opacity: 0
}

body.presenting:hover .exit-presentation.fade-out {
  opacity: 0.7
}

.template-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000
}

.template-modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3)
}

.template-modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  text-align: center
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px
}

.template-option {
  cursor: pointer;
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s
}

.template-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1)
}

.template-preview {
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.template-preview.empty-template {
  color: #666;
  font-size: 18px;
}

.template-name {
  padding: 10px;
  text-align: center;
  font-weight: bold;
  border-top: 1px solid #eee
}

.split-button {
  position: relative;
  display: inline-flex;
  align-items: center
}

.split-button .caret {
  margin-left: 5px;
  font-size: 10px;
  cursor: pointer
}

.slide-type-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
  z-index: 100;
  min-width: 220px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0
}

.slide-type-option {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s;
  border-left: 3px solid transparent
}

.slide-type-option:hover {
  background: #f0f7ff;
  border-left-color: var(--primary-color)
}

.slide-type-title {
  font-weight: bold;
  margin-bottom: 3px;
  color: #333
}

.slide-type-desc {
  font-size: 12px;
  color: #666
}

.slide h1,
.slide h2,
.slide h3,
.slide li,
.slide div {
  min-height: 1.5em
}

.slide .content-block {
  border: 1px dashed rgba(0, 0, 0, 0.2);
  padding: 5px;
  margin-bottom: 1rem;
  min-height: 1.5em
}

.slide .content-block p {
  margin: 0.5em 0;
  min-height: 1.5em
}

.slide .content-block p:first-child {
  margin-top: 0
}

.slide .content-block p:last-child {
  margin-bottom: 0
}

.slide[contenteditable="true"] h1,
.slide[contenteditable="true"] h2,
.slide[contenteditable="true"] h3,
.slide[contenteditable="true"] ul,
.slide[contenteditable="true"] ol,
.slide[contenteditable="true"] div:not(.slide):not(.content-block) {
  border: 1px dashed rgba(0, 0, 0, 0.2);
  padding: 5px;
  min-height: 1.5em;
  position: relative
}

.slide[contenteditable="true"]>p:not(.content-block p) {
  border: 1px dashed rgba(0, 0, 0, 0.2);
  padding: 5px;
  min-height: 1.5em
}

.slide[contenteditable="true"] * {
  position: relative
}

.slide[contenteditable="true"] *:focus,
.slide[contenteditable="true"] .content-block:focus {
  outline: 2px solid #4285f4;
  border-color: transparent
}

.slide [data-placeholder]:empty:before {
  content: attr(data-placeholder);
  color: #aaa;
  font-style: italic;
  pointer-events: none
}

.slide[contenteditable="true"] h1:empty,
.slide[contenteditable="true"] h2:empty,
.slide[contenteditable="true"] h3:empty,
.slide[contenteditable="true"] .content-block:empty {
  min-height: 1.5em;
  display: block
}

.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000
}

.image-modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 80%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3)
}

.image-modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333
}

.image-modal-content input[type="file"] {
  margin: 15px 0;
  width: 100%
}

.storage-options {
  margin: 15px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px
}

.storage-options p {
  margin-top: 0;
  font-weight: bold
}

.storage-options label {
  display: block;
  margin: 8px 0
}

.info-box {
  padding: 10px;
  background: #fffde7;
  border-left: 4px solid #ffc107;
  margin: 15px 0;
  font-size: 0.9em;
  color: #5d4037
}

.button-container {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px
}

.button-container button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer
}

.button-container .primary-btn {
  background: #4285f4;
  color: #fff
}

.image-container {
  margin: 15px 0;
  display: inline-block;
  max-width: 100%;
  position: relative
}

.image-container img {
  display: block;
  max-width: 100%;
  height: auto
}

.slide[contenteditable="true"] .image-container {
  border: 1px dashed rgba(0, 0, 0, 0.2);
  padding: 5px;
  cursor: pointer
}

.slide[contenteditable="true"] .image-container:hover {
  border-color: #4285f4
}

.loading-indicator {
  padding: 20px;
  text-align: center;
  color: #666;
  background: #f5f5f5;
  border-radius: 4px
}

body.presenting {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  height: 100vh;
  width: 100vw
}

.slide-thumbnail:focus {
  outline: 2px solid #4285f4;
  outline-offset: 1px;
  box-shadow: 0 0 8px rgba(66, 133, 244, 0.6);
  transform: translateY(-2px)
}

.slide-thumbnail:focus-visible {
  outline: 2px solid #4285f4;
  outline-offset: 1px;
  box-shadow: 0 0 8px rgba(66, 133, 244, 0.6);
  transform: translateY(-2px)
}

.formatting-control {
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem
}

.formatting-btn {
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  min-width: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s
}

.formatting-btn:hover {
  background: #666
}

.formatting-btn.active {
  background: #4285f4
}

.save-btn {
  display: none;
  background: #4285f4;
  margin-left: 10px
}

.save-btn:hover {
  background: #5294ff
}

#boldBtn,
#italicBtn,
#underlineBtn {
  font-family: Arial, sans-serif
}

#boldBtn {
  font-weight: bold
}

#italicBtn {
  font-style: italic
}

#underlineBtn {
  text-decoration: underline
}

.icon-btn {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  margin-right: 10px;
  line-height: 1
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px
}

.side-panel {
  position: fixed;
  top: 0;
  left: -350px;
  width: var(--panel-width);
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  z-index: 3000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.side-panel.open {
  left: 0
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #2f2f2f;
  color: #fff;
  border-bottom: 1px solid #444
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: normal
}

.close-btn {
  background: transparent none;
  background: none;
  cursor: pointer;
  background: none;
  cursor: pointer;
  background: none;
  cursor: pointer;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column
}

.project-actions {
  padding: 15px 20px;
  border-bottom: 1px solid #eee
}

.action-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  font-size: 14px
}

.action-btn:hover {
  background: #5294ff
}

.project-list-header {
  padding: 10px 20px;
  font-size: 14px;
  color: #777;
  font-weight: bold;
  background: #f5f5f5
}

.projects-list {
  flex: 1;
  overflow-y: auto
}

.project-item {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
  position: relative
}

.project-item:hover {
  background: #f9f9f9
}

.project-item.active {
  background: rgba(66, 133, 244, 0.1);
  border-left: 3px solid
}

.project-title {
  font-weight: bold;
  margin-bottom: 5px;
  padding-right: 40px
}

.project-date {
  font-size: 12px;
  color: #777
}

.project-actions-menu {
  position: absolute;
  left: 15px;
  right: auto;
  top: 100%;
  margin-top: -10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 3100;
  min-width: 160px;
  display: none;
  flex-direction: column;
  padding: 5px 0
}

.project-actions-menu.open {
  display: flex
}

.project-action-btn {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 10px 15px;
  font-size: 14px;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border-radius: 0;
  transition: background-color 0.2s
}

.project-action-btn:hover {
  color: var(--primary-color);
  background-color: rgba(66, 133, 244, 0.1)
}

.project-action-btn.delete:hover {
  color: var(--danger-color);
  background-color: rgba(220, 53, 69, 0.1)
}

.project-action-btn .action-icon {
  margin-right: 8px;
  font-size: 16px
}

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

.modal.open {
  display: flex
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 4100
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px
}

.modal-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  margin-bottom: 20px;
  box-sizing: border-box
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px
}

.modal-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer
}

.modal-btn.primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color)
}

.modal-btn.danger {
  background: var(--danger-color);
  color: #fff;
  border-color: var(--danger-color)
}

.panel-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2900
}

.panel-overlay.open {
  display: block
}

.versions-dropdown {
  position: absolute;
  right: 20px;
  top: 45px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 3100;
  width: 200px;
  display: none
}

.versions-dropdown.open {
  display: block
}

.version-item {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer
}

.version-item:hover {
  background: #f5f5f5
}

.version-date {
  font-size: 12px;
  color: #777
}

.version-number {
  float: right;
  font-size: 12px;
  color: #777;
  background: #f0f0f0;
  padding: 2px 5px;
  border-radius: 3px
}

.enhanced-modal .modal-content {
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  z-index: 4100
}

.enhanced-modal h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333
}

.enhanced-modal h3 {
  margin: 15px 0 10px;
  color: #444
}

.project-name-section {
  margin-bottom: 20px
}

.project-name-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold
}

.template-section {
  margin: 20px 0
}

.template-option.active {
  border-color: var(--primary-color);
  box-shadow: 0 5px 15px rgba(66, 133, 244, 0.2)
}

.enhanced-modal .modal-actions {
  margin-top: 30px
}

.slide-template-container {
  display: none;
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden
}

.template-slide {
  width: var(--slide-base-width);
  height: var(--slide-base-height);
  position: relative;
  overflow: hidden
}

.template-slide-thumbnail {
  width: 160px;
  height: 90px;
  border: 1px solid #e9c46a;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #f5f0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px
}

.template-slide-thumbnail:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15)
}

.template-slide-thumbnail .slide-thumbnail-content {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden
}

.template-slide-label {
  position: absolute;
  top: 0;
  left: 0;
  background: #e9c46a;
  color: #433a21;
  font-size: 10px;
  padding: 2px 5px;
  border-bottom-right-radius: 4px;
  font-weight: bold;
  z-index: 2
}

.template-slides-section {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  position: relative
}

.template-slides-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px;
  background: #f8f8f8;
  border-radius: 4px
}

.template-slides-title {
  font-weight: bold;
  color: #666;
  font-size: 12px
}

.template-slides-toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 12px
}

.template-slides-content {
  overflow: hidden;
  transition: max-height 0.3s ease
}

.enhanced-dropdown {
  width: 650px !important;
  max-width: 90vw;
  max-height: 75vh;
  overflow-y: auto;
  padding: 0;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.dropdown-header {
  font-weight: bold;
  margin-bottom: 16px;
  color: #333;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}

.dropdown-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 20px !important;
  padding: 15px !important;
  margin-bottom: 15px;
}

.slide-preview-option {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  background: #fff
}

.slide-preview-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(66, 133, 244, 0.2);
  border-color: var(--primary-color)
}

.slide-preview-visual {
  height: 80px;
  position: relative;
  overflow: hidden;
  background: #f8f8f8
}

.slide-preview-title {
  font-weight: bold;
  padding: 8px 10px;
  font-size: 12px;
  color: #333;
  text-align: center;
  border-top: 1px solid #f0f0f0
}

.slide-preview-desc {
  font-size: 11px;
  padding: 0 10px 8px;
  color: #666;
  text-align: center
}

.preview-title {
  height: 12px;
  background: #666;
  width: 70%;
  margin: 20px auto 10px;
  border-radius: 2px
}

.preview-subtitle {
  height: 6px;
  background: #999;
  width: 50%;
  margin: 0 auto;
  border-radius: 2px
}

.preview-heading {
  height: 8px;
  background: #666;
  width: 60%;
  margin: 12px 10px 10px;
  border-radius: 2px
}

.preview-paragraph {
  height: 4px;
  background: #999;
  width: 90%;
  margin: 8px 10px;
  border-radius: 2px
}

.preview-short {
  width: 70%
}

#main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative
}

#chat-panel {
  width: 350px;
  background-color: #f9f9f9;
  border-left: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow: hidden
}

#chat-panel.collapsed {
  transform: translateX(100%);
  width: 0
}

.chat-header {
  background: #222;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10
}

.chat-header h3 {
  margin: 0;
  font-size: 16px
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-action-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

#chatThread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth
}

#chatInputBar {
  display: flex;
  border-top: 1px solid #ccc;
  background-color: #f9f9f9;
  flex-direction: column;
  position: relative
}

#chatInput {
  flex: 1;
  padding: 14px 56px 14px 14px;
  border: none;
  outline: 0;
  font-size: 15px;
  resize: none;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5
}

#modelSelect {
  padding: 8px;
  border-radius: 4px;
  margin: 8px;
  align-self: flex-start;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  color: #333;
  font-size: 14px
}

#modelSelect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f0f0f0;
  border-color: #ddd
}

#sendBtn {
  background-color: #0084ff;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer
}

#sendBtn:hover {
  background-color: #0073e6;
  transform: translateY(-1px)
}

.chat-message {
  display: flex;
  margin-bottom: 16px;
  flex-direction: column;
  max-width: 85%
}

.user-message {
  align-self: flex-end;
  margin-left: auto
}

.ai-message {
  align-self: flex-start;
  margin-right: auto
}

.message-bubble {
  padding: 12px 32px 16px 16px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.4;
  position: relative
}

.user-bubble {
  background-color: #0084ff;
  color: #fff;
  border-top-right-radius: 4px
}

.ai-bubble {
  background-color: #e5e5ea;
  color: #333;
  border-top-left-radius: 4px
}

.message-sender {
  font-size: 12px;
  margin-bottom: 4px;
  color: #666;
  padding-left: 4px
}

.prompt-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px auto;
  max-width: 95%
}

.prompt-pill {
  background-color: #e9f5ff;
  border: 1px solid #b8dcff;
  color: #0084ff;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-grow: 1;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05)
}

.prompt-pill:hover {
  background-color: #d0e8ff;
  border-color: #0084ff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1)
}

.loading-spinner {
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 16px auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid #0084ff;
  animation: spin 1s linear infinite
}

@keyframes spin {
  0% {
    transform: rotate(0deg)
  }

  100% {
    transform: rotate(360deg)
  }
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto
}

#chatToggleBtn {
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center
}

#chatToggleBtn:hover {
  background-color: #5294ff
}

@media (max-width:1024px) {
  #chat-panel {
    width: 300px
  }
}

@media (max-width:768px) {
  #chat-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 80%;
    max-width: 350px;
    z-index: 100
  }
}

#content-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden
}

.message-content {
  position: relative;
  width: 100%
}

.truncated-content,
.full-content {
  white-space: pre-wrap;
  max-width: 100%;
  overflow-wrap: break-word
}

.toggle-content-btn {
  background: none;
  border: none;
  color: #0084ff;
  cursor: pointer;
  padding: 4px 0;
  font-size: 13px;
  margin-top: 8px;
  text-align: left;
  font-weight: 500;
  transition: opacity 0.2s;
  display: block;
  width: auto;
  margin-left: 0;
  text-decoration: underline
}

.toggle-content-btn:hover {
  opacity: 0.8;
  font-weight: bold
}

.ai-bubble .toggle-content-btn {
  color: #0a74da
}

.copy-message-container {
  position: absolute;
  top: 4px;
  right: 4px;
  opacity: 0;
  transition: opacity 0.2s
}

.message-bubble:hover .copy-message-container {
  opacity: 1
}

.copy-message-btn {
  background: rgba(255, 255, 255, 0.3) none;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s
}

.user-bubble .copy-message-btn {
  color: rgba(255, 255, 255, 0.9)
}

.ai-bubble .copy-message-btn {
  color: rgba(0, 0, 0, 0.7);
  background-color: rgba(0, 0, 0, 0.05)
}

.copy-message-btn:hover {
  background-color: rgba(255, 255, 255, 0.5)
}

.ai-bubble .copy-message-btn:hover {
  background-color: rgba(0, 0, 0, 0.1)
}

.copy-message-btn.copied {
  background-color: rgba(39, 174, 96, 0.3);
  color: #27ae60
}

.message-actions {
  margin-top: 6px
}

.revert-button {
  background: none;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s
}

.user-bubble .toggle-content-btn {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  font-weight: 500;
  opacity: 0.9
}

.user-bubble .toggle-content-btn:hover {
  opacity: 1;
  font-weight: bold
}

.project-actions-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 4px;
  transition: background-color 0.2s
}

.project-actions-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05)
}

@keyframes spin {
  0% {
    transform: rotate(0deg)
  }

  100% {
    transform: rotate(360deg)
  }
}

@media (max-width:1024px) {
  #chat-panel {
    width: 300px
  }
}

@media (max-width:768px) {
  #chat-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 80%;
    max-width: 350px;
    z-index: 100
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg)
  }

  100% {
    transform: rotate(360deg)
  }
}

@media (max-width:1024px) {
  #chat-panel {
    width: 300px
  }
}

@media (max-width:768px) {
  #chat-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 80%;
    max-width: 350px;
    z-index: 100
  }
}

/* Utility Buttons */
.utility-btn {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  margin: 0 2px;
  padding: 4px 8px;
  transition: all 0.2s ease;
}

.utility-btn:hover {
  background-color: #e0e0e0;
  border-color: #999;
}

.utility-btn:active {
  background-color: #d0d0d0;
  transform: translateY(1px);
}

/* Position the preview content absolutely inside the container */
.slide-preview-content {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
}

/* Style the slide inside the preview content */
.slide-preview-content .slide {
  transform: scale(0.2) !important;
  transform-origin: top left !important;
  width: 500% !important;
  height: 500% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  opacity: 1 !important;
  transition: none !important;
  animation: none !important;
  display: block !important;
  visibility: visible !important;
}

/* Override hidden class for preview slides */
.slide-preview-content .slide.slide-hidden,
.slide-preview-visual .slide.slide-hidden,
.slide-preview-visual .slide.slide-hidden * {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure slide preview visual has proper 16:9 aspect ratio height */
.slide-preview-visual {
  position: relative;
  overflow: hidden;
  background: #f8f8f8;
  border: 1px solid #ddd;
  /* Make height match 16:9 aspect ratio based on width */
  height: 0 !important;
  padding-top: 56.25% !important; /* 9/16 = 0.5625 = 56.25% */
}

/* Make all text visible in previews */
.slide-preview-visual h1,
.slide-preview-visual h2,
.slide-preview-visual h3,
.slide-preview-visual p,
.slide-preview-visual div,
.slide-preview-visual li {
  color: inherit !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Improve dropdown preview grid spacing and layout */
.dropdown-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 20px !important;
  padding: 15px !important;
  margin-bottom: 15px;
}

/* Enhance slide preview option styling */
.slide-preview-option {
  overflow: hidden;
  background: white;
  border-radius: 6px;
  border: 1px solid #ddd;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  margin-bottom: 0 !important;
}

.slide-preview-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(66, 133, 244, 0.2);
  border-color: var(--primary-color, #4285f4);
}

/* Style for the title below the preview */
.slide-preview-title {
  padding: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-align: center;
  border-top: 1px solid #eee;
}

/* Template suggestion container and link styles */
.template-suggestion-container {
  padding: 20px;
  margin-top: 15px;
  border-top: 1px solid #eee;
  text-align: center;
}

.template-suggestion-link {
  display: inline-block;
  color: #4285f4;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 6px;
  background-color: #f0f7ff;
  border: 1px solid #d0e3ff;
  transition: all 0.2s ease;
  font-weight: 500;
}

.template-suggestion-link:hover {
  background-color: #e0f0ff;
  color: #2c6bdf;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(66, 133, 244, 0.2);
  transform: translateY(-2px);
}