/* convoStyles.css - Multi AI Forum Styles with Night/Day Mode */

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

:root {
  --bg: #0a0a0f;
  --card: #16161d;
  --surface: #1e1e2d;
  --border: #2a2a35;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --openai: #10a37f;
  --claude: #d97757;
  --grok: #9333ea;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

body[data-theme="day"] {
  --bg: #ffffff;
  --card: #f5f5f7;
  --surface: #ffffff;
  --border: #d1d1d6;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* Header */
.header {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

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

.menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: var(--border);
  color: var(--text);
}

.header img {
  height: 48px;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

body[data-theme="day"] .header img {
  filter: brightness(0) invert(0);
}

.header-text {
  flex: 1;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.header-controls {
  display: flex;
  gap: 8px;
}

.theme-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* Prompt Box */
.prompt-box {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.prompt-box h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.prompt-box textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  resize: vertical;
  margin-bottom: 16px;
  background: var(--surface);
  color: var(--text);
  transition: all 0.3s ease;
}

.prompt-box textarea:focus {
  outline: none;
  border-color: var(--text-muted);
}

.prompt-box textarea::placeholder {
  color: var(--text-muted);
}

/* History Dropdown */
.history-dropdown {
  position: relative;
  display: inline-block;
}

.history-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.history-btn:hover {
  background: var(--border);
}

.history-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  min-width: 280px;
  max-width: 400px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
}

.history-menu.show {
  display: block;
}

.history-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  transition: all 0.2s;
}

.history-item:hover {
  background: var(--surface);
}

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

.history-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Send Controls */
.send-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 12px;
}

.left-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.right-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.right-controls select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  min-width: 160px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.right-controls select:focus {
  outline: none;
  border-color: var(--text-muted);
}

/* AI Checkboxes */
.ai-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}

.ai-checkbox:hover {
  background: var(--card);
}

.ai-checkbox.openai.checked {
  border-color: var(--openai);
  background: rgba(16, 163, 127, 0.1);
}

.ai-checkbox.claude.checked {
  border-color: var(--claude);
  background: rgba(217, 119, 87, 0.1);
}

.ai-checkbox.grok.checked {
  border-color: var(--grok);
  background: rgba(147, 51, 234, 0.1);
}

.ai-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--openai);
}

.ai-checkbox.claude input[type="checkbox"] {
  accent-color: var(--claude);
}

.ai-checkbox.grok input[type="checkbox"] {
  accent-color: var(--grok);
}

.ai-checkbox label {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  color: var(--text);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-family: inherit;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.send {
  background: var(--success);
  color: #fff;
  font-size: 15px;
  padding: 12px 32px;
}

.btn.send:hover {
  background: #059669;
}

.btn.stop {
  background: var(--danger);
  color: #fff;
  font-size: 15px;
  padding: 12px 32px;
}

.btn.stop:hover {
  background: #dc2626;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: var(--border);
}

.status {
  color: var(--text-muted);
  font-size: 13px;
  display: block;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

/* Chat Grid */
.chats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .chats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .chats {
    grid-template-columns: 1fr;
  }
  
  .send-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .left-controls {
    justify-content: center;
    width: 100%;
  }
  
  .right-controls {
    justify-content: center;
    width: 100%;
  }
}

/* Chat Box */
.chat-box {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.chat-header {
  padding: 16px 20px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: all 0.3s ease;
}

.chat-header.openai {
  background: rgba(16, 163, 127, 0.15);
  color: var(--openai);
}

.chat-header.claude {
  background: rgba(217, 119, 87, 0.15);
  color: var(--claude);
}

.chat-header.grok {
  background: rgba(147, 51, 234, 0.15);
  color: var(--grok);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.scroll-down-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.scroll-down-btn:hover {
  background: var(--border);
  color: var(--text);
  transform: translateY(1px);
}

.scroll-up-btn {
  text-align: center;
  padding: 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.2s;
  font-weight: 500;
}

.scroll-up-btn:hover {
  background: var(--card);
  color: var(--text);
}

/* Messages */
.messages {
  min-height: 200px;
  padding: 20px;
  background: var(--bg);
  transition: all 0.3s ease;
}

.msg {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  max-width: 90%;
  word-wrap: break-word;
  line-height: 1.6;
  position: relative;
  transition: all 0.3s ease;
}

.msg.user {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-left: auto;
}

.msg.assistant {
  background: var(--card);
  border: 1px solid var(--border);
}

.msg.acknowledgment {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 13px;
  opacity: 0.85;
  font-style: italic;
}

.msg .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-weight: 600;
}

.msg.assistant:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--border);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border-color: var(--success);
}

/* Message Content Formatting */
.msg ul,
.msg ol {
  margin: 10px 0;
  padding-left: 24px;
}

.msg li {
  margin: 6px 0;
}

.msg ul {
  list-style-type: disc;
}

.msg ol {
  list-style-type: decimal;
}

.msg p {
  margin: 10px 0;
}

.msg h1,
.msg h2,
.msg h3,
.msg h4 {
  margin: 14px 0 10px;
  font-weight: 700;
}

.msg strong {
  font-weight: 700;
  color: var(--text);
}

.msg em {
  font-style: italic;
}

.msg code {
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  border: 1px solid var(--border);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .shell {
    padding: 12px 10px;
  }
  
  .header {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
  
  .header-controls {
    align-self: flex-end;
  }
  
  .header h1 {
    font-size: 20px;
  }
  
  .header img {
    height: 36px;
  }
  
  .prompt-box {
    padding: 16px 18px;
  }
  
  .messages {
    padding: 16px;
  }
  
  .msg {
    max-width: 95%;
    padding: 12px;
  }
  
  .ai-checkbox {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .btn {
    padding: 10px 20px;
  }
}

/* Scrollbar Styling */
.history-menu::-webkit-scrollbar {
  width: 8px;
}

.history-menu::-webkit-scrollbar-track {
  background: var(--bg);
}

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

.history-menu::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}