/* C-Net AI - Google Gemini Dark Midnight Theme & ChatGPT Layout */

:root {
  --bg-main: #131314;
  --bg-sidebar: #1e1f20;
  --bg-surface: #282a2c;
  --bg-surface-elevated: #1e1f20;
  --bg-hover: #333538;
  --bg-active: #3c4043;
  --border-color: #2b2d30;
  --border-subtle: #242628;
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-muted: #8e918f;
  --accent-cnet: #4b90ff;
  --accent-cnet-hover: #3b80ef;
  --code-bg: #0e1217;
  --code-text: #e6edf3;
  --prompt-box-border: #3c4043;
  --prompt-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-main: #ffffff;
  --bg-sidebar: #f9f9f9;
  --bg-surface: #f4f4f4;
  --bg-surface-elevated: #ffffff;
  --bg-hover: #ececec;
  --bg-active: #e2e2e2;
  --border-color: #e5e5e5;
  --border-subtle: #f0f0f0;
  --text-primary: #0d0d0d;
  --text-secondary: #5d5d5d;
  --text-muted: #8e8e8e;
  --accent-cnet: #0077c8;
  --accent-cnet-hover: #005fa0;
  --code-bg: #1e1e1e;
  --code-text: #ececec;
  --prompt-box-border: #e3e3e3;
  --prompt-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: background-color 0.2s, color 0.2s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #333538;
  border-radius: 9999px;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d4d4d8;
}
::-webkit-scrollbar-thumb:hover {
  background: #4b4d52;
}

/* Dual Pill Switch (Chat vs Work) */
.dual-pill-container {
  background: var(--bg-surface-elevated);
  padding: 3px;
  border-radius: 9999px;
  display: inline-flex;
  border: 1px solid var(--border-color);
}
.dual-pill-btn {
  padding: 6px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.2s ease;
  color: var(--text-muted);
  cursor: pointer;
}
.dual-pill-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--prompt-box-border);
}

/* Model Chips */
.model-chip {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.model-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--prompt-box-border);
}
.model-chip.active {
  background: #1a273e;
  color: #60a5fa;
  border-color: #3b82f6;
  font-weight: 600;
}

/* Voice Waveform button in prompt */
.voice-wave-btn {
  background: #ffffff;
  color: #131314;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background-color 0.2s;
  cursor: pointer;
}
.voice-wave-btn:hover {
  transform: scale(1.05);
  background: #e3e3e3;
}

/* Waveform Bars Animation */
.wave-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}
.wave-bar {
  width: 2.5px;
  background-color: currentColor;
  border-radius: 2px;
  height: 6px;
  animation: waveAnim 1s ease-in-out infinite;
}
.wave-bar:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.wave-bar:nth-child(3) { height: 8px; animation-delay: 0.3s; }
.wave-bar:nth-child(4) { height: 14px; animation-delay: 0.45s; }

@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.2); }
}

/* Speech Recognition Recording Pulse */
.mic-recording {
  color: #ef4444 !important;
  animation: micPulse 1s infinite alternate;
}
@keyframes micPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.5)); }
  100% { transform: scale(1.2); filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9)); }
}

/* Action Pills below prompt box */
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.action-pill:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--prompt-box-border);
}

/* Feature suggestion cards (Matching Capture1.JPG) */
.work-suggestion-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}
.work-suggestion-card:hover {
  border-color: var(--accent-cnet);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Markdown styling in messages */
.prose-custom {
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 0.95rem;
}
.prose-custom p {
  margin-bottom: 0.85em;
}
.prose-custom p:last-child {
  margin-bottom: 0;
}
.prose-custom h1, .prose-custom h2, .prose-custom h3, .prose-custom h4 {
  color: var(--text-primary);
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 600;
}
.prose-custom ul, .prose-custom ol {
  margin-left: 1.5em;
  margin-bottom: 0.85em;
}
.prose-custom li {
  margin-bottom: 0.35em;
}
.prose-custom blockquote {
  border-left: 3px solid var(--accent-cnet);
  padding-left: 12px;
  color: var(--text-secondary);
  margin: 1em 0;
}
.prose-custom a {
  color: #60a5fa;
  text-decoration: underline;
}
.prose-custom code:not(pre code) {
  background: var(--bg-surface);
  color: #fca5a5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}
.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.prose-custom th, .prose-custom td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}
.prose-custom th {
  background: var(--bg-surface-elevated);
}

/* Code Block with Header Bar */
.code-block-wrapper {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid #30363d;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #161b22;
  padding: 6px 14px;
  font-size: 0.78rem;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
}
.code-header button {
  background: transparent;
  border: none;
  color: #c9d1d9;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: all 0.2s;
}
.code-header button:hover {
  background: #21262d;
  color: #ffffff;
}
.code-block-wrapper pre {
  padding: 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Thinking accordion for DeepSeek R1 / Reasoning */
.thinking-container {
  background: rgba(168, 85, 247, 0.08);
  border-left: 3px solid #a855f7;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 10px 0 16px 0;
  font-size: 0.9rem;
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c084fc;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.thinking-content {
  margin-top: 8px;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Streaming Blinking Cursor */
@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}
.cursor-blink {
  display: inline-block;
  width: 7px;
  height: 15px;
  background-color: var(--accent-cnet);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

/* Settings Modal Tabs */
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.settings-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.settings-nav-item.active {
  background: var(--bg-surface);
  color: var(--accent-cnet);
  font-weight: 600;
}
