/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Console page layout */
.console-container {
  display: flex;
  min-height: 100vh;
  background: #f5f5f5;
}

/* Top Header */
.console-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.console-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.console-logo {
  font-size: 16px;
  font-weight: 600;
  color: #1890ff;
  white-space: nowrap;
}

.console-env-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.console-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.console-search {
  width: 300px;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-size: 14px;
}

.console-header-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.console-icon-button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}

.console-icon-button:hover {
  background: #f5f5f5;
  color: #333;
}

/* Left Sidebar */
.console-sidebar {
  position: fixed;
  left: 0;
  top: 56px;
  bottom: 0;
  width: 200px;
  background: #fff;
  border-right: 1px solid #e5e5e5;
  overflow-y: auto;
  z-index: 999;
}

.console-sidebar-nav {
  list-style: none;
  padding: 16px 0;
}

.console-sidebar-item {
  margin-bottom: 4px;
}

.console-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.console-sidebar-link:hover {
  background: #f5f5f5;
  color: #1890ff;
}

.console-sidebar-link.active {
  background: #e6f7ff;
  color: #1890ff;
  font-weight: 500;
}

.console-sidebar-link.disabled {
  color: #d9d9d9;
  cursor: not-allowed;
  opacity: 0.5;
}

.console-sidebar-link.disabled:hover {
  background: transparent;
  color: #d9d9d9;
}

.console-sidebar-link.active.disabled {
  background: #f5f5f5;
  color: #d9d9d9;
  border-right: none;
}

.console-sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.console-sidebar-icon i {
  font-size: 16px;
  color: inherit;
}

/* Main Content */
.console-content {
  margin-left: 200px;
  margin-top: 56px;
  padding: 24px;
  min-height: calc(100vh - 56px);
  width: calc(100% - 200px);
  background: #f5f5f5;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* AI Dev Entry Button */
.ai-dev-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.12) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  color: #3b82f6;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  position: relative;
  overflow: visible;
}

/* Red dot indicator for new AI feature */
.ai-dev-button::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #ff4d4f;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.3);
  z-index: 10;
  pointer-events: none;
}

.ai-dev-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.ai-dev-button:hover::before {
  left: 100%;
}

.ai-dev-button:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.ai-dev-button-left {
  display: flex;
  align-items: center;
}

.ai-dev-button-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.ai-dev-button.expanded .ai-dev-button-arrow {
  transform: rotate(180deg);
}

.ai-dev-button.expanded {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  color: #ffffff;
}

/* AI Dev Panel Overlay */
.ai-dev-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
  animation: fadeIn 0.2s ease;
}

.ai-dev-overlay.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* AI Dev Panel */
.ai-dev-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.ai-dev-panel.show {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Panel Header */
.ai-dev-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.ai-dev-panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.ai-dev-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}

.ai-dev-panel-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Panel Body */
.ai-dev-panel-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* IDE Selector */
.ide-selector {
  margin-bottom: 1.5rem;
}

.ide-selector-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ide-selector-label {
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
}

.ide-selector-dropdown {
  position: relative;
  display: inline-block;
}

.ide-selector-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 200px;
}

.ide-selector-trigger:hover {
  background: #f5f5f5;
}

.ide-selector-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: none;
  max-height: 400px;
  overflow-y: auto;
}

.ide-selector-menu.show {
  display: block;
}

.ide-selector-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.ide-selector-item:hover {
  background: #f5f5f5;
}

.ide-selector-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.ide-selector-trigger img.ide-selector-item-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.ide-selector-item-info {
  flex: 1;
}

.ide-selector-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.ide-selector-item-platform {
  font-size: 0.75rem;
  color: #999;
}

/* Prompt Editor */
.prompt-editor {
  margin-top: 1.5rem;
}

.prompt-editor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.prompt-editor-label-text {
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
}

.prompt-editor-actions {
  display: flex;
  gap: 0.5rem;
}

.prompt-editor-button {
  padding: 0.375rem 0.75rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
}

.prompt-editor-button:hover {
  background: #f5f5f5;
  border-color: #d9d9d9;
}

.prompt-editor-button.primary {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.prompt-editor-button.primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.prompt-editor-textarea {
  width: 100%;
  min-height: 200px;
  padding: 0.875rem;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  line-height: 1.6;
  resize: vertical;
  background: #fff;
}

.prompt-editor-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* MCP Config Steps */
.mcp-config-steps {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
}

.mcp-config-steps-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #333;
}

.mcp-config-step {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.mcp-config-step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.mcp-config-step-title {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #666;
}

.mcp-config-step-content {
  font-size: 0.8125rem;
  color: #999;
  line-height: 1.6;
}

.mcp-config-code {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #f5f5f5;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  overflow-x: auto;
}

.mcp-config-copy-button {
  margin-top: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.mcp-config-copy-button:hover {
  background: #2563eb;
}

/* Page specific styles */
.page-section {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.page-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.table-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
}

.function-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.function-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
}

.auth-quick-start {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-language-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-language-option {
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-language-option:hover {
  border-color: #1890ff;
}

.auth-language-option.active {
  background: #e6f7ff;
  color: #1890ff;
  border-color: #1890ff;
}

.auth-code-example {
  margin-top: 16px;
  padding: 16px;
  background: #f5f5f5;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8125rem;
  overflow-x: auto;
}

.log-item {
  padding: 12px;
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  border-radius: 4px;
  margin-bottom: 12px;
}

.log-item.error {
  background: #f8d7da;
  border-left-color: #dc3545;
}

.log-item-time {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 4px;
}

.log-item-message {
  font-size: 0.875rem;
  color: #333;
}

