/**
 * ReviCare Design System — Base CSS
 *
 * Component styles that can't be expressed in Tailwind utility classes.
 * Import after Tailwind: <link rel="stylesheet" href="/static/rc-base.css">
 *
 * Convention: all custom classes prefixed with `rc-` to avoid collisions.
 */

/* ── Foundations ── */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* ── Sidebar ── */

.rc-sidebar {
  background: linear-gradient(175deg, #03314b 0%, #044a6e 50%, #048BA8 100%);
  position: relative;
  box-shadow:
    4px 0 24px rgba(3, 49, 75, 0.25),
    1px 0 0 rgba(255, 255, 255, 0.04) inset;
  z-index: 10;
}

/* Noise texture overlay */
.rc-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Right edge glow line */
.rc-sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(154, 196, 248, 0.15) 0%,
    rgba(4, 139, 168, 0.1) 50%,
    rgba(34, 201, 147, 0.08) 100%
  );
  pointer-events: none;
}

/* ── Navigation items ── */

.rc-nav-item {
  transition: all 0.15s ease;
  position: relative;
}

.rc-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rc-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
}

.rc-nav-item.active::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
}

/* ── Badges ── */

.rc-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

/* ── Status indicators ── */

.rc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Progress bar ── */

.rc-progress-track {
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.rc-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Interactive elements ── */

.rc-row-hover {
  transition: background 0.12s ease;
}

.rc-card-hover {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rc-card-hover:hover {
  transform: translateY(-2px);
}

/* Focus ring — teal glow */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 143, 112, 0.15);
}

/* All interactive elements get smooth transitions */
button, a, input, select {
  transition: all 0.15s ease;
}

/* ── Keyboard shortcuts ── */

kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Buttons ── (used in dock_chat, assistant_test, future pages) */

.rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.rc-btn-primary {
  /* WCAG AA: white on #22c993 = 2.06:1 fails. Use teal-700 (#15735a) for
     ~5.5:1, hover lifts to teal-600 (#1a8f70) for visual feedback. The
     "rc-teal" brand signal stays #22c993 elsewhere (icons, accents). */
  background: #15735a;
  color: #ffffff;
  border-color: #15735a;
}

.rc-btn-primary:hover:not(:disabled) {
  background: #1a8f70;
  border-color: #1a8f70;
}

.rc-btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

/* ── Meta text ── (timestamps, J-counts, status lines, captions) */

.rc-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: rgb(100, 116, 139);  /* slate-500 */
  font-weight: 400;
}

/* Dark mode: fade for muted contrast */
.dark .rc-meta {
  color: rgb(148, 163, 184);  /* slate-400 */
}
