/**
 * PORT2040 AI — Executive Copilot Styles
 * Sovereign Glassmorphism Theme (Maroon #8A1538, Gold #D4AF37, Cyan #38bdf8, Green #00e676)
 */

:root {
  --bg-primary: #070d18;
  --bg-surface: rgba(14, 23, 38, 0.85);
  --bg-surface-elevated: rgba(20, 32, 51, 0.95);
  --border: rgba(255, 255, 255, 0.1);
  --border-focus: #D4AF37;
  --text-primary: #f0f4f8;
  --text-secondary: #8fa3bf;
  --text-muted: #536b88;
  --qa-maroon: #8A1538;
  --qa-gold: #D4AF37;
  --br-green: #00e676;
  --accent-cyan: #38bdf8;
  --accent-purple: #c084fc;
  --accent-amber: #ffb703;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.copilot-body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
}

.copilot-layout-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  min-height: calc(100vh - 60px);
}

@media (max-width: 1024px) {
  .copilot-layout-container {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.copilot-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.copilot-sidebar-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.copilot-sidebar-title {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.engine-status-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-category-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

.sidebar-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-prompt-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-prompt-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
}

/* Main Chat Application */
.copilot-main-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.copilot-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.95);
  flex-wrap: wrap;
  gap: 10px;
}

.copilot-header h1 {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-badge {
  font-size: 11px;
  background: linear-gradient(135deg, var(--qa-maroon), var(--qa-gold));
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 800;
  border: 1px solid var(--qa-gold);
}

/* Chat Messages */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
  max-height: calc(100vh - 280px);
}

.chat-message {
  max-width: 88%;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-sender {
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-message {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.user-message .message-sender {
  color: #e0f2fe;
}

.bot-message {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-left: 3px solid var(--qa-gold);
}

.bot-message .message-sender {
  color: var(--qa-gold);
}

.message-content h2, .message-content h3 {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin: 8px 0 4px;
}

.message-content strong {
  color: #ffffff;
}

.message-content ul, .message-content ol {
  margin: 6px 0;
  padding-left: 18px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11px;
}

.message-content th, .message-content td {
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-content th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--qa-gold);
}

.message-content a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 700;
}

.message-content a:hover {
  text-decoration: underline;
}

/* Prompt Chips Bar */
.prompt-chips-bar {
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
}

.prompt-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-chip:hover {
  border-color: var(--qa-gold);
  color: var(--qa-gold);
  background: rgba(212, 175, 55, 0.1);
}

/* Input Bar */
.chat-input-bar {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chat-input-bar input {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--qa-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.chat-input-bar button {
  background: linear-gradient(135deg, var(--qa-maroon), var(--qa-gold));
  color: #ffffff;
  border: 1px solid var(--qa-gold);
  border-radius: 8px;
  padding: 0 22px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-input-bar button:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* Loading Dots */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--qa-gold);
  animation: typingBounce 1s infinite alternate;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  from { opacity: 0.3; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-4px); }
}
