/* components.css — shared small UI bits */

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop[hidden] {
  display: none !important;
}
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}
.modal-body {
  padding: 0.5rem 0;
  overflow-y: auto;
}
.contact-list .chat-conv-item {
  border-bottom: 1px solid var(--border-color);
}

/* App-specific overrides & extras — design-system.css is the foundation */

/* Sidebar active indicator */
.nav-link.active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Topbar search (optional future) */
.topbar-search {
  position: relative;
  max-width: 280px;
  flex: 1;
}
.topbar-search input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2.2rem;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}
.topbar-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Inline form actions in tables */
.table-actions form {
  display: inline;
}

/* Notification dot on icon */
.icon-with-badge {
  position: relative;
}
.icon-with-badge .dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* Smooth theme transition */
html {
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
body,
.card,
.sidebar,
.topbar,
.stat-card,
.form-control,
.btn {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* Nav badge live update */
.nav-link .badge.live-unread {
  transition: transform 0.2s ease;
}
.nav-link .badge.live-unread.bump {
  transform: scale(1.15);
}
