/* CSS Variables for JIRA Dashboard - Light Mode */
:root {
  --primary-color: #0052CC;
  --primary-hover: #0065FF;
  --secondary-color: #F4F5F7;
  --accent-color: #FF5630;
  --success-color: #00875A;
  --warning-color: #FFAB00;
  --danger-color: #DE350B;

  --text-primary: #172B4D;
  --text-secondary: #6B778C;
  --text-disabled: #97A0AF;

  --bg-primary: #FFFFFF;
  --bg-secondary: #F4F5F7;
  --bg-tertiary: #EBECF0;
  --bg-body: #F0F2F5;

  --border-color: #DFE1E6;
  --border-radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;

  /* Loading overlay colors */
  --loading-overlay-bg: rgba(255, 255, 255, 0.9);
  --loading-spinner-primary: var(--primary-color);
  --loading-spinner-secondary: var(--bg-tertiary);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --primary-color: #2684FF;
  --primary-hover: #4C9AFF;
  --secondary-color: #2C333A;
  --accent-color: #FF7452;
  --success-color: #36B37E;
  --warning-color: #FFC400;
  --danger-color: #FF5630;

  --text-primary: #F4F5F7;
  --text-secondary: #9FADBC;
  --text-disabled: #6B778C;

  --bg-primary: #1D2125;
  --bg-secondary: #282E33;
  --bg-tertiary: #323940;
  --bg-body: #161A1D;

  --border-color: #38414A;
  --border-radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.5);

  /* Loading overlay colors for dark mode */
  --loading-overlay-bg: rgba(22, 26, 29, 0.95);
  --loading-spinner-primary: var(--primary-color);
  --loading-spinner-secondary: var(--bg-tertiary);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-color: #2684FF;
    --primary-hover: #4C9AFF;
    --secondary-color: #2C333A;
    --accent-color: #FF7452;
    --success-color: #36B37E;
    --warning-color: #FFC400;
    --danger-color: #FF5630;

    --text-primary: #F4F5F7;
    --text-secondary: #9FADBC;
    --text-disabled: #6B778C;

    --bg-primary: #1D2125;
    --bg-secondary: #282E33;
    --bg-tertiary: #323940;
    --bg-body: #161A1D;

    --border-color: #38414A;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.5);

    --loading-overlay-bg: rgba(22, 26, 29, 0.95);
    --loading-spinner-primary: var(--primary-color);
    --loading-spinner-secondary: var(--bg-tertiary);
  }
}

/* Header Styles for Issues and Search Results */
.issues-header, .search-header {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.issues-header h3, .search-header h3 {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  margin-bottom: 8px;
}

.jql-info {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
}

.jql-info code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
}

/* Info Message Styles */
.info-message {
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin: 20px 0;
  text-align: center;
}

.info-message h3 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: var(--font-size-lg);
}

.info-message p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 32px;
  height: 32px;
}

.app-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--primary-color);
}

.status-section {
  display: flex;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--warning-color);
  transition: background-color 0.3s ease;
}

.status-dot.connected {
  background-color: var(--success-color);
}

.status-dot.error {
  background-color: var(--danger-color);
}

/* Main Content */
.main-content {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Three Column Layout */
.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr 460px;
  gap: 24px;
  padding: 24px;
  width: 100%;
  height: 100vh;
  background: transparent;
  box-sizing: border-box;
}

/* Sidebar Styles */
.sidebar {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-content {
  padding: 24px;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 4px;
  letter-spacing: 0.5px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.sidebar-action:hover {
  background: var(--bg-secondary);
  transform: translateX(2px);
}

.sidebar-action.active {
  background: var(--primary-color);
  color: white;
}

.action-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.action-text {
  flex: 1;
}

.sidebar-empty {
  padding: 20px 10px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.sidebar-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-disabled);
}

/* Center Panel */
.center-panel {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Chat Panel */
.chat-panel {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.section-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

.refresh-button {
  padding: 8px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-button:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* WebUI Grid */
.webui-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.webui-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.webui-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-button {
  padding: 12px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
}

.action-button:hover {
  background: var(--primary-hover);
}

/* System Status */
.system-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.status-value {
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-secondary);
}

.status-value.ready {
  background: var(--success-color);
  color: white;
}

.status-value.error {
  background: var(--danger-color);
  color: white;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Forms */
.search-form,
.create-form {
  background: var(--bg-primary);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.search-input-group,
.chat-input-group {
  display: flex;
  gap: 12px;
}

.search-input,
.chat-input,
.form-input,
.form-textarea,
.form-select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  transition: border-color 0.2s ease;
}

.search-input:focus,
.chat-input:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-button,
.chat-send-button,
.submit-button {
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-button:hover,
.chat-send-button:hover,
.submit-button:hover {
  background: var(--primary-hover);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Search Results */
.search-results {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  min-height: 200px;
}

/* Chat Component Styles */
.chat-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chat-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 5px 0 0 0;
}

.chat-status {
  display: flex;
  align-items: center;
}

.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-secondary);
}

.chat-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: fadeInUp 0.3s ease;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ai-message .message-avatar {
  background: var(--success-color);
}

.user-message .message-avatar {
  background: var(--primary-color);
}

.message-content {
  flex: 1;
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
  background: var(--primary-color);
  color: white;
}

.message-text {
  line-height: 1.5;
  margin-bottom: 4px;
}

.message-time {
  font-size: var(--font-size-xs);
  color: var(--text-disabled);
  opacity: 0.7;
}

.user-message .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.typing-indicator .typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.chat-input-area {
  padding: 20px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: flex-start;
  flex-direction: row;  /* Force horizontal layout */
}

.quick-action-btn {
  padding: 6px 10px;  /* Smaller padding */
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 12px;  /* Smaller font */
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;  /* Prevent text wrapping */
  flex-shrink: 0;  /* Prevent shrinking */
}

.quick-action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.quick-action-btn.narrow {
  padding: 6px 10px;
  font-size: 12px;
}

.chat-form {
  display: flex;
  flex-direction: column;
}

.chat-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 4px 4px 4px 16px;
  transition: border-color 0.2s ease;
  gap: 8px;
}

.chat-input-group:focus-within {
  border-color: var(--primary-color);
}

.chat-input {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  resize: none;
  min-height: 32px;
  max-height: 120px;
  line-height: 1.5;
  outline: none;
}

.chat-input::placeholder {
  color: var(--text-secondary);
}

.chat-send-button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.chat-send-button:disabled {
  background: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.6;
}

.chat-send-button svg {
  width: 20px;
  height: 20px;
}

.chat-send-button .loading-icon.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Results Panel Styles */
.results-header {
  padding: 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.results-tabs {
  display: flex;
  gap: 4px;
}

.results-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.results-tab.active,
.results-tab:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.results-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.results-tab-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px;
  overflow-y: auto;
  display: none;
}

.results-tab-content.active {
  display: block;
}

.welcome-message {
  text-align: center;
  max-width: 500px;
  margin: 60px auto;
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.welcome-message h3 {
  font-size: var(--font-size-xl);
  margin-bottom: 16px;
  color: var(--text-primary);
}

.welcome-message p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.welcome-suggestions {
  text-align: left;
  background: var(--bg-primary);
  padding: 20px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.welcome-suggestions h4 {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.welcome-suggestions ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.welcome-suggestions li {
  padding: 8px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
}

.welcome-suggestions li:last-child {
  border-bottom: none;
}

.results-summary {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.results-summary.success {
  border-color: var(--success-color);
  background: rgba(0, 135, 90, 0.05);
}

.results-summary.error {
  border-color: var(--danger-color);
  background: rgba(222, 53, 11, 0.05);
}

.results-summary h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.summary-stats {
  display: flex;
  gap: 24px;
  margin: 16px 0;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.query-info,
.jql-info {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 8px;
}

.jql-info code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
}

.issues-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.issues-list,
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.show-more {
  text-align: center;
  padding: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

.detailed-issue-card,
.detailed-project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  transition: all 0.2s ease;
}

.detailed-issue-card:hover,
.detailed-project-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.issue-main,
.project-main {
  min-width: 0;
}

.issue-sidebar,
.project-sidebar {
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-field,
.project-field {
  font-size: var(--font-size-sm);
}

.issue-field label,
.project-field label {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.created-issue-card,
.chat-response-card,
.error-card,
.unknown-response-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
}

.assistant-message {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.assistant-message .message-content {
  color: var(--text-primary);
  line-height: 1.6;
}

.issue-key {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.issue-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary-color);
  text-decoration: none;
}

.issue-link:hover {
  text-decoration: underline;
}

.issue-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-row {
  display: flex;
  gap: 12px;
}

.detail-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 80px;
}

.detail-value {
  color: var(--text-primary);
}

.response-content {
  line-height: 1.6;
  color: var(--text-primary);
}

.error-message {
  color: var(--danger-color);
  font-weight: 500;
}

.raw-data-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.raw-data-container h3 {
  padding: 16px 20px;
  margin: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-base);
  font-weight: 600;
}

.raw-data-content {
  padding: 20px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.no-details {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-style: italic;
}

.details-header {
  margin-bottom: 24px;
}

.details-header h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--loading-overlay-bg);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.loading-overlay.visible {
  display: flex;
}

.loading-state {
  text-align: center;
  padding: 40px;
}

.loading-state .loading-spinner {
  margin-bottom: 16px;
}

.loading-state .loading-text {
  color: var(--text-secondary);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--loading-spinner-secondary);
  border-top: 4px solid var(--loading-spinner-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

/* Cards and Items */
.issue-card,
.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  transition: all 0.2s ease;
}

.issue-card:hover,
.project-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.issue-title,
.project-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.issue-meta,
.project-meta {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.issue-description,
.project-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Priority and Status Indicators */
.priority-high {
  color: var(--danger-color);
}

.priority-medium {
  color: var(--warning-color);
}

.priority-low {
  color: var(--success-color);
}

.status-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.status-todo {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.status-progress {
  background: var(--primary-color);
  color: white;
}

.status-done {
  background: var(--success-color);
  color: white;
}

/* Placeholder Text */
.placeholder-text {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 48px 24px;
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-tertiary);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
}

.activity-text {
  flex: 1;
  font-size: var(--font-size-sm);
}

.activity-time {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1200px) {
  /* Hide sidebar on tablets, show chat and results */
  .main-layout {
    grid-template-columns: 1fr 400px;
  }
  
  .sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Stack layout on mobile */
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  
  .sidebar {
    display: none;
  }
  
  .center-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .chat-panel {
    max-height: 50vh;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Performance Stats Styling */
.performance-stats-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.performance-stats-container h3 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
}

.stat-card h4 {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.stat-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.stat-label {
  color: var(--text-secondary);
}

.stat-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: 'Monaco', 'Courier New', monospace;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
  background: var(--bg-secondary);
}

.theme-icon {
  color: var(--text-primary);
  transition: opacity 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-disabled);
}