/* =========================================
   CODEY ONLINE – LIGHT / BLUE THEME
   ========================================= */

:root {
  --bg: #f5f7fb;
  --bg-alt: #eef2f9;
  --panel: #ffffff;
  --panel-soft: #f3f6fd;
  --panel-strong: #dbe4f5;

  --text: #07111f;
  --muted: #6b7280;
  --border: #d1d9e6;
  --border-soft: rgba(187, 200, 224, 0.9);

  --accent: #61aeee;
  --accent-soft: rgba(97, 174, 238, 0.18);
  --accent-2: #2f74c8;

  --danger: #d94a4a;
  --success: #27c794;

  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-pill: 12px; /* geen echte pill meer */
}

/* ---------- BASIS ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 0% 0%, rgba(97, 174, 238, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(47, 116, 200, 0.20), transparent 55%),
    var(--bg);
  color: var(--text);
}

/* ---------- SCROLLBALKEN ---------- */

#chat-box::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
.serial-output-box::-webkit-scrollbar {
  width: 8px;
}

#chat-box::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb,
.serial-output-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

#chat-box::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track,
.serial-output-box::-webkit-scrollbar-track {
  background: transparent;
}

.chat-list,
#chat-box,
.serial-output-box {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

/* =========================================
   HEADER
   ========================================= */

#app-header {
  flex-shrink: 0;
  width: 100%;
  background: linear-gradient(90deg, #61aeee, rgba(47, 116, 200, 0.26));
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.2);
  border-bottom: 1px solid rgba(97, 174, 238, 0.6);
  position: relative;
  z-index: 20;
}

.app-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  height: 22px;
  width: auto;
  display: block;
  padding-left: 4px;
  padding-top: 2px;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 4px;
  color: #3b78b2;
}

/* accent in titel indien gewenst */
/*
.brand-title span {
  color: var(--accent);
}
*/

/* =========================================
   LAYOUT
   ========================================= */

.chat-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ---------- SIDEBAR ---------- */

.sidebar {
  width: 280px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(97, 174, 238, 0.18), transparent 60%),
    var(--bg-alt);
  border-right: 1px solid rgba(97, 174, 238, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 10px 0 26px rgba(15, 23, 42, 0.15);
}

.sidebar-controls {
  padding: 14px;
  border-bottom: 1px solid rgba(97, 174, 238, 0.18);
}

/* New Chat */

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(97, 174, 238, 0.9);
  background:
    radial-gradient(circle at 0 0, rgba(97, 174, 238, 0.26), transparent 60%),
    linear-gradient(135deg, #8cc6ff, #61aeee);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.25);
}

/* Chatlijst */

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-item {
  display: block;
  padding: 9px 11px;
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #ffffff;
  border: 1px solid transparent;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.chat-item:hover {
  background:
    radial-gradient(circle at 0 0, rgba(97, 174, 238, 0.14), transparent 60%),
    #f9fbff;
  color: var(--text);
  border-color: rgba(97, 174, 238, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 0 8px rgba(97, 174, 238, 0.2);
}

.chat-item.active {
  background:
    radial-gradient(circle at 0 0, rgba(97, 174, 238, 0.2), transparent 60%),
    #ffffff;
  color: #031521;
  font-weight: 600;
  border-color: rgba(97, 174, 238, 0.95);
  box-shadow:
    0 0 0 1px rgba(97, 174, 238, 0.7),
    0 0 14px rgba(97, 174, 238, 0.25);
}

.chat-title {
  display: block;
  font-size: 13px;
}

.chat-date {
  display: block;
  font-size: 11px;
  color: #9aa3bd;
  margin-top: 2px;
}

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

.sidebar-footer {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid rgba(97, 174, 238, 0.18);
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-link {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.logout-link {
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 8px;
  transition: all 0.16s ease;
  font-size: 12px;
}

.logout-link:hover {
  color: var(--danger);
  background: rgba(217, 74, 74, 0.06);
}

/* ---------- CHAT PANEL ---------- */

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0, rgba(97, 174, 238, 0.2), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(47, 116, 200, 0.2), transparent 70%),
    var(--bg);
}

#chat-container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 18px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* chat box wrapper */

#chat-box {
  flex: 1;
  background: linear-gradient(180deg, #ffffff, #f3f6fd);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 18px 18px 16px;
  overflow-y: auto;
  margin: 14px auto 10px;
  max-width: 900px;
  box-shadow:
    0 0 0 1px rgba(209, 217, 230, 0.7),
    0 18px 36px rgba(15, 23, 42, 0.18);
}

/* ---------- WELCOME ---------- */

.welcome-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.welcome-message h1 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- MESSAGES ---------- */

.message {
  margin: 0 0 14px 0;
  padding: 0;
  line-height: 1.55;
  font-size: 14px;
  animation: msg-in 0.24s ease-out;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* user */

.message.user {
  text-align: right;
}

.message.user p {
  display: inline-block;
  background: linear-gradient(135deg, #2f74c8, #61aeee);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 12px 12px 4px 12px;
  max-width: min(80%, 560px);
  word-wrap: break-word;
  border: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.24);
}

.message.user .user-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  max-width: 280px;
  display: inline-block;
  line-height: 0;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(97, 174, 238, 0.7),
    0 12px 24px rgba(15, 23, 42, 0.22);
}

.message.user .user-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
}

.message.user .user-image-wrapper.scanning::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(97, 174, 238, 0.8),
    transparent
  );
  box-shadow: 0 0 10px rgba(97, 174, 238, 0.9);
  animation: scan-animation-fixed 2s infinite ease-in-out;
}

@keyframes scan-animation-fixed {
  0% { top: 0; }
  50% { top: calc(100% - 3px); }
  100% { top: 0; }
}

/* ai */

.message.ai {
  max-width: 100%;
}

.message.ai p {
  margin: 8px 0;
}

.message.ai ul,
.message.ai ol {
  margin: 8px 0 8px 22px;
}

.message.ai h1,
.message.ai h2,
.message.ai h3 {
  margin: 14px 0 8px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.message.ai a {
  color: #2f74c8;
  text-decoration: none;
  position: relative;
}

.message.ai a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(97, 174, 238, 0.25),
    rgba(97, 174, 238, 1)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.16s ease;
}

.message.ai a:hover::after {
  transform: scaleX(1);
}

.message.ai table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.message.ai table th,
.message.ai table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 13px;
}

.message.ai blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: #e7f2ff;
  color: var(--muted);
  border-radius: var(--radius-md);
}

.message.ai code {
  background: #f3f6fd;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

/* ---------- CODEBLOCKS ---------- */

.message.ai pre {
  position: relative;
  background:
    radial-gradient(circle at top, rgba(97, 174, 238, 0.18), transparent 70%),
    #0b1020;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 14px 12px 12px;
  overflow: auto;
  white-space: pre;
}

.message.ai pre code {
  background: transparent;
  padding: 0;
}

.code-controls {
  display: flex;
  gap: 6px;
  position: absolute;
  top: 8px;
  right: 8px;
}

.copy-button,
.compile-button,
.upload-button {
  border-radius: var(--radius-md);
  border: 1px solid rgba(97, 174, 238, 0.7);
  background: #e3f1ff;
  color: var(--text);
  padding: 5px 9px;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  box-shadow: none;
  transition: background 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.copy-button:hover,
.compile-button:hover,
.upload-button:hover {
  background: #d6e9ff;
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.upload-button {
  background: linear-gradient(135deg, #8cc6ff, #61aeee);
  color: #061625;
}

.upload-button:disabled {
  background: #c4cfdf;
  border-color: #c4cfdf;
  cursor: not-allowed;
}

/* compile status */

.compile-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 8px 12px;
  background: #f3f6fd;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  display: none;
  white-space: pre-wrap;
  color: var(--muted);
}

.compile-status.compiling {
  display: block;
  color: var(--accent);
}

.compile-status.error {
  display: block;
  color: var(--danger);
}

.compile-status.success {
  display: block;
  color: var(--success);
}

/* ---------- IMAGE PREVIEW ---------- */

#image-preview-container {
  flex-shrink: 0;
  position: relative;
  max-width: 900px;
  width: calc(100% - 32px);
  margin: 0 auto;
  background: var(--panel);
  border-radius: var(--radius-lg);
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border: 1px solid transparent;
  transform: scale(0.96);
  transition: all 0.26s cubic-bezier(0.25, 1, 0.3, 1.2);
}

#image-preview-container.visible {
  opacity: 1;
  max-height: 220px;
  padding-top: 8px;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-color: var(--border-soft);
  transform: scale(1);
}

#image-preview {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-md);
}

#remove-image-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle, #61aeee, #2f74c8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
}

/* ---------- INPUT ---------- */

#input-container {
  flex-shrink: 0;
  padding: 8px 0 10px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  position: relative;
}

#user-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  overflow-y: hidden;
  min-height: 48px;
  box-shadow: 0 0 0 1px #e1e6f2;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#user-input::placeholder {
  color: #9ca3b8;
}

#user-input:focus {
  border-color: rgba(97, 174, 238, 0.95);
  box-shadow:
    0 0 0 1px rgba(97, 174, 238, 0.7),
    0 0 16px rgba(97, 174, 238, 0.25);
  background: #ffffff;
}

/* mic */

#mic-button {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  align-self: end;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
  box-shadow: none;
}

#mic-button:hover {
  background: #f3f6fd;
  color: var(--text);
  border-color: rgba(97, 174, 238, 0.55);
}

#mic-button.recording {
  background: #7d1823;
  color: #ffffff;
  border-color: #d94a4a;
  box-shadow: 0 0 14px rgba(217, 74, 74, 0.6);
}

/* SEND */

#send-button {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(97, 174, 238, 0.8);
  background: linear-gradient(135deg, #8cc6ff, #61aeee);
  color: #061625;
  cursor: pointer;
  font-weight: 600;
  align-self: end;
  min-height: 48px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

#send-button:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
}

#send-button:disabled {
  background: #c4cfdf;
  border-color: #c4cfdf;
  color: #e5e7f3;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- CURSOR ---------- */

.blinking-cursor {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 1px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- AUTH ---------- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid rgba(97, 174, 238, 0.65);
  border-radius: 18px;
  padding: 24px 30px 22px;
  box-shadow:
    0 0 0 1px rgba(97, 174, 238, 0.45),
    0 24px 52px rgba(15, 23, 42, 0.18);
}

.auth-container h1 {
  text-align: center;
  font-size: 20px;
  margin: 0 0 22px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-error,
.auth-success {
  padding: 10px 11px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid;
}

.auth-error {
  background: rgba(217, 74, 74, 0.06);
  border-color: var(--danger);
  color: var(--danger);
}

.auth-success {
  background: rgba(97, 174, 238, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(97, 174, 238, 0.95);
  box-shadow:
    0 0 0 1px rgba(97, 174, 238, 0.7),
    0 0 16px rgba(97, 174, 238, 0.25);
  background: #ffffff;
}

.auth-button {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #8cc6ff, #61aeee);
  color: #061625;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.auth-button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.26);
}

.auth-links {
  margin-top: 20px;
  font-size: 13px;
  text-align: center;
}

.auth-links a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  margin-top: 6px;
}

.auth-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.social-login {
  margin-top: 20px;
  text-align: center;
}

.social-login p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.social-btn {
  display: block;
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 8px;
  transition: filter 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.social-btn.google {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d4d4d8;
}

.social-btn.facebook {
  background: #1877f2;
  color: #ffffff;
  border: 1px solid #2563eb;
}

.social-btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
}

/* ---------- SERIAL MONITOR PANEL ---------- */

.serial-monitor-panel {
  width: 350px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 0 0, rgba(97, 174, 238, 0.16), transparent 60%),
    #f3f6fd;
  border-left: 1px solid rgba(97, 174, 238, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  box-shadow: -10px 0 24px rgba(15, 23, 42, 0.15);
}

.serial-monitor-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(97, 174, 238, 0.35);
  background: linear-gradient(90deg, rgba(97, 174, 238, 0.12), #ffffff);
  flex-shrink: 0;
}

.serial-monitor-header h3 {
  margin: 0;
  font-size: 13px;
  margin-right: auto;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #061625;
}

/* board-select + connect */

#board-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#board-select,
#serial-baud-rate {
  background: #ffffff;
  color: var(--text);
  border: 0px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  font-size: 13px;
}

.serial-monitor-header button {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.serial-monitor-header button:hover {
  background: #f3f6fd;
  border-color: rgba(97, 174, 238, 0.45);
}

#port-status {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

#port-status.connected {
  color: var(--success);
  font-weight: 600;
}

/* CONNECT / DISCONNECT */

#connect-port-btn {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

#connect-port-btn:hover {
  background-color: #4c93dd;
}

#connect-port-btn.connected-state {
  background-color: #c53a3a;
  border-color: #c53a3a;
  color: #ffffff;
}

#connect-port-btn.connected-state:hover {
  background-color: #a72f2f;
}

/* terminal */

.serial-output-box {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  background:
    radial-gradient(circle at top, rgba(97, 174, 238, 0.18), transparent 70%),
    #0b1020;
  color: #bdf5ff;
  position: relative;
}

/* scanline overlays verwijderd – geen ::before / ::after meer */

.serial-output-box .log-msg,
.serial-output-box .serial-out,
.serial-output-box .serial-in {
  color: inherit;
}

.serial-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid rgba(97, 174, 238, 0.18);
  background: var(--panel);
  flex-shrink: 0;
}

.serial-input-container input {
  flex: 1;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 13px;
}

/* TX knop */

#serial-send-btn {
  background: var(--accent);
  color: #061625;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 14px;
  margin-left: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

#serial-send-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.26);
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
  .serial-monitor-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .chat-layout {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(97, 174, 238, 0.18);
  }

  .chat-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 16px;
  }

  .chat-item {
    flex-shrink: 0;
    width: 160px;
    margin-bottom: 0;
    margin-right: 8px;
  }

  .sidebar-footer {
    padding: 12px 16px;
  }

  .sidebar-controls {
    padding: 12px 16px;
  }

  .chat-panel {
    height: auto;
  }

  #input-container {
    padding-inline: 8px;
  }

  #user-input,
  #mic-button,
  #send-button {
    min-height: 44px;
    padding-block: 10px;
  }

  #mic-button {
    padding-inline: 12px;
  }
}

/* auth scroll behaviour */

body.auth-page {
  overflow-y: auto;
  height: auto;
}

/* auth logo */

.auth-logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  width: 300px;
  height: auto;
}
