/* Wrapper for both action bar and gen palette */
.gen-palette-wrapper {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 66%;
  max-width: 900px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gen-palette {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  z-index: 2; /* Above action bar */
}

.gen-palette-container {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transition: border-radius 0.2s ease-out; /* Animate border-radius change */
}

/* Remove top border-radius when action bar is visible */
.gen-palette-wrapper:has(.contextual-action-bar:not(.hidden)) .gen-palette-container {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

[data-theme="dark"] .gen-palette-container {
  background: #1a1a1a;
  border: 2px solid #444;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

.gen-palette-tabs {
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  border-right: 1px solid #e0e0e0;
}

[data-theme="dark"] .gen-palette-tabs {
  background: #0d0d0d;
  border-right: 2px solid #404040;
}

.gen-palette-tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 12px;
  color: #666;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 80px;
}

[data-theme="dark"] .gen-palette-tab {
  border-bottom: 1px solid #404040;
  color: #888;
}

.gen-palette-tab:last-child {
  border-bottom: none;
}

.gen-palette-tab:hover {
  background: #e8eaed;
  color: #333;
}

[data-theme="dark"] .gen-palette-tab:hover {
  background: #2a2a2a;
  color: #aaa;
}

.gen-palette-tab.active {
  background: #ffffff;
  color: #4a9eff;
  border-right: 3px solid #4a9eff;
}

[data-theme="dark"] .gen-palette-tab.active {
  background: #1a1a1a;
  color: #4a9eff;
  border-right: 3px solid #4a9eff;
}

.gen-palette-tab i {
  font-size: 18px;
}

.gen-palette-content {
  flex: 1;
  min-width: 0;
}

.gen-palette-view {
  padding: 12px 16px;
  height: 100%;
}

.gen-palette-view.hidden {
  display: none;
}

.gen-palette-view-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
}

.gen-palette-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.gen-palette-shot-controls {
  display: flex;
  gap: 12px;
  align-items: end;
}

.gen-palette-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gen-palette-dropdown-label {
  font-size: 10px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-left: 2px;
  margin-bottom: 0;
}

[data-theme="dark"] .gen-palette-dropdown-label {
  color: #888;
}

.gen-palette-select {
  background: #f8f9fa;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 6px 24px 6px 8px;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
  min-width: 80px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .gen-palette-select {
  background: #0d0d0d;
  border: 1px solid #333;
  color: #ccc;
}

.gen-palette-select:focus {
  outline: none;
  border-color: #4a9eff;
}

.gen-palette-dropdown .dropdown-arrow {
  position: absolute;
  right: 7px;
  top: 70%;
  transform: translateY(-50%);
  color: #999;
  font-size: 10px;
  pointer-events: none;
}

[data-theme="dark"] .gen-palette-dropdown .dropdown-arrow {
  color: #666;
}

.gen-palette-prompt-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gen-palette-prompt-label {
  font-size: 10px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-left: 2px;
  margin-bottom: 0;
}

[data-theme="dark"] .gen-palette-prompt-label {
  color: #888;
}

.gen-palette-prompt-label.modified {
  color: #ff9500;
}

.gen-palette-prompt {
  width: 100%;
  background: #f8f9fa;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  min-height: 60px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .gen-palette-prompt {
  background: #0d0d0d;
  border: 1px solid #333;
  color: #ccc;
}

.gen-palette-prompt:focus {
  outline: none;
  border-color: #4a9eff;
  background: #ffffff;
}

[data-theme="dark"] .gen-palette-prompt:focus {
  background: #111;
  border-color: #4a9eff;
}

.gen-palette-prompt::placeholder {
  color: #999;
  font-style: italic;
}

[data-theme="dark"] .gen-palette-prompt::placeholder {
  color: #666;
}

.gen-palette-dialogue-content {
  flex: 1;
  background: #f8f9fa;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

[data-theme="dark"] .gen-palette-dialogue-content {
  background: #0d0d0d;
  border: 1px solid #333;
  color: #888;
}

.gen-palette-actions {
  display: flex;
  gap: 8px;
}

.gen-palette-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .gen-palette-action-btn {
  border: 1px solid #444;
  color: #888;
}

.gen-palette-action-btn:hover {
  background: #e8eaed;
  border-color: #999;
  color: #333;
}

[data-theme="dark"] .gen-palette-action-btn:hover {
  background: #2a2a2a;
  border-color: #555;
  color: #aaa;
}

.gen-palette-action-btn i {
  font-size: 14px;
}


.gen-palette-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #4a9eff;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gen-palette-generate-btn:hover:not(:disabled) {
  background: #3a8eef;
}

.gen-palette-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gen-palette {
    width: 95%;
    bottom: 10px;
  }

  .gen-palette-container {
    flex-direction: column;
  }

  .gen-palette-tabs {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  [data-theme="dark"] .gen-palette-tabs {
    border-right: none;
    border-bottom: 1px solid #333;
  }

  .gen-palette-tab {
    flex: 1;
    border-right: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 12px 8px;
  }

  [data-theme="dark"] .gen-palette-tab {
    border-right: 1px solid #333;
  }

  .gen-palette-tab:last-child {
    border-right: none;
  }

  .gen-palette-tab.active {
    border-right: none;
    border-bottom: 2px solid #4a9eff;
  }

  .gen-palette-view {
    padding: 12px;
  }

  .gen-palette-bottom-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .gen-palette-shot-controls {
    justify-content: center;
  }

  .gen-palette-prompt {
    -webkit-line-clamp: 3;
  }

  .gen-palette-separator {
    height: 1px;
    width: 100%;
  }

  .gen-palette-asset-zone {
    width: 100%;
    min-height: 60px;
    padding: 12px;
  }

  .asset-zone-content {
    flex-direction: row;
    gap: 12px;
  }

  .asset-zone-content > i {
    font-size: 24px;
  }

  .asset-zone-icons {
    gap: 12px;
  }

  .asset-zone-icons i {
    font-size: 16px;
  }
}

/* Dialogue Tab Styles */
.dialogue-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #666;
  text-align: center;
}

[data-theme="dark"] .dialogue-placeholder {
  color: #999;
}

.dialogue-placeholder i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.dialogue-placeholder p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

[data-dialogue-text] {
  margin-bottom: 12px;
}

/* Asset Drop Zone */
.gen-palette-separator {
  width: 2px;
  background: #e0e0e0;
  flex-shrink: 0;
}

[data-theme="dark"] .gen-palette-separator {
  background: #404040;
}

.gen-palette-asset-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 93px;
  padding: 16px 8px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .gen-palette-asset-zone {
  background: #0d0d0d;
}

.gen-palette-asset-zone:hover {
  background: #e8eaed;
}

[data-theme="dark"] .gen-palette-asset-zone:hover {
  background: #161616;
}

.asset-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.asset-zone-content > i {
  font-size: 28px;
  color: #999;
  transition: color 0.2s ease;
}

[data-theme="dark"] .asset-zone-content > i {
  color: #666;
}

.gen-palette-asset-zone:hover .asset-zone-content > i {
  color: #4a9eff;
}

.asset-zone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-zone-title {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

[data-theme="dark"] .asset-zone-title {
  color: #888;
}

.asset-zone-icons {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.asset-zone-icons i {
  font-size: 14px;
  color: #999;
  transition: color 0.2s ease;
}

[data-theme="dark"] .asset-zone-icons i {
  color: #666;
}

.gen-palette-asset-zone:hover .asset-zone-icons i {
  color: #666;
}

[data-theme="dark"] .gen-palette-asset-zone:hover .asset-zone-icons i {
  color: #888;
}

/* Drag and drop state */
.gen-palette-asset-zone.drag-over {
  background: #e3f2fd;
  border: 2px dashed #4a9eff;
}

[data-theme="dark"] .gen-palette-asset-zone.drag-over {
  background: #1a2a3a;
  border: 2px dashed #4a9eff;
}

.gen-palette-asset-zone.drag-over .asset-zone-content > i {
  color: #4a9eff;
  transform: scale(1.1);
}
