/* Stack Prompts Panel Styling */

.stack-prompts-panel {
  padding: 20px;
  background: var(--bg-secondary, #1a1d23);
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stack-prompts-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color, #2d3139);
}

.stack-prompts-panel .panel-header h3 {
  margin: 0 0 5px 0;
  color: var(--text-primary, #e4e6eb);
  font-size: 1.5rem;
}

.stack-prompts-panel .panel-header i {
  margin-right: 10px;
  color: var(--bs-primary, #0d6efd);
}

.config-mode-badge {
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-mode-badge.default-mode {
  background: var(--bs-secondary, #6c757d);
  color: white;
}

.config-mode-badge.user-mode {
  background: var(--bs-primary, #0d6efd);
  color: white;
}

.selectors-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.selectors-row .form-group {
  margin-bottom: 0;
}

.selectors-row label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text-secondary, #b0b3b8);
  font-size: 0.9rem;
}

.selectors-row .form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary, #242831);
  border: 1px solid var(--border-color, #2d3139);
  border-radius: 6px;
  color: var(--text-primary, #e4e6eb);
  font-size: 0.95rem;
}

.selectors-row .form-control:focus {
  outline: none;
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.selectors-row .form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.editor-container {
  flex: 1;
  min-height: 500px;
  background: var(--bg-primary, #0d1117);
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color, #2d3139);
}

.editor-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 500px;
  color: var(--text-muted, #8b949e);
}

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

.editor-placeholder p {
  font-size: 1.1rem;
  margin: 0;
}

/* Prompt Editor Tabs */

.prompt-editor {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.prompt-editor .nav-tabs {
  background: var(--bg-tertiary, #242831);
  border-bottom: 2px solid var(--border-color, #2d3139);
  padding: 0 10px;
  margin: 0;
  flex-shrink: 0;
}

.prompt-editor .nav-item {
  margin-bottom: 0;
}

.prompt-editor .nav-link {
  color: var(--text-secondary, #b0b3b8);
  border: none;
  padding: 12px 20px;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.prompt-editor .nav-link:hover {
  color: var(--text-primary, #e4e6eb);
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border-bottom-color: var(--bs-primary, #0d6efd);
}

.prompt-editor .nav-link.active {
  color: var(--bs-primary, #0d6efd);
  background: var(--bg-primary, #0d1117);
  border-bottom-color: var(--bs-primary, #0d6efd);
}

.prompt-editor .nav-link i {
  margin-right: 8px;
}

.prompt-editor .tab-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 450px;
}

.prompt-editor .tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
  visibility: hidden;
  opacity: 0;
}

.prompt-editor .tab-pane.active {
  visibility: visible;
  opacity: 1;
  z-index: 1;
}

/* Action Buttons */

.action-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.action-buttons .btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.action-buttons .btn i {
  font-size: 0.9rem;
}

.action-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Prompt Preview Modal */

.prompt-preview-content {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 6px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 600px;
  overflow-y: auto;
  margin: 0;
}

/* Responsive Design */

@media (max-width: 768px) {
  .selectors-row {
    grid-template-columns: 1fr;
  }

  .stack-prompts-panel .panel-header {
    flex-direction: column;
    gap: 15px;
  }

  .config-mode-badge {
    align-self: flex-start;
  }

  .action-buttons {
    justify-content: stretch;
  }

  .action-buttons .btn {
    flex: 1;
    justify-content: center;
  }

  .prompt-editor .nav-link {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}

/* Dark Mode Enhancements */

body[data-theme="dark"] .stack-prompts-panel {
  --bg-primary: var(--bg-primary, #0a0a0a);
  --bg-secondary: #151515;
  --bg-tertiary: #1f1f1f;
  --bg-hover: var(--hover-bg, #252525);
  --text-primary: var(--text-primary, #f5f5f5);
  --text-secondary: var(--text-secondary, #a3a3a3);
  --text-muted: var(--text-muted, #737373);
  --border-color: var(--border, #2a2a2a);
}

/* Custom Scrollbar for Preview */

.prompt-preview-content::-webkit-scrollbar {
  width: 10px;
}

.prompt-preview-content::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 6px;
}

.prompt-preview-content::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 6px;
}

.prompt-preview-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Alert Customization in Modal */

.modal-body .alert {
  border-radius: 6px;
  margin-bottom: 15px;
}

.modal-body .alert-info {
  background-color: rgba(13, 110, 253, 0.1);
  border-color: rgba(13, 110, 253, 0.3);
  color: #0d6efd;
}

/* Monaco Editor Integration */

.prompt-editor .monaco-editor {
  border-radius: 0 0 6px 6px;
}
