/* Milestone 0B Task 6 — Enterprise product experience chrome */

/* —— Skip link —— */
.ss-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--ss-primary-800);
  color: #fff;
  border-radius: 0 0 var(--ss-radius-md) 0;
  font-weight: 600;
}
.ss-skip-link:focus {
  left: 0;
}

/* —— Progress bar —— */
.ss-progress-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}
.ss-progress-bar.is-active {
  opacity: 1;
}
.ss-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ss-primary-500), var(--ss-accent-500, #3d9b93));
  box-shadow: 0 0 8px rgba(61, 155, 147, 0.55);
  transition: width 240ms ease;
}

/* —— Connection / status chip —— */
.ss-conn-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ss-border-default);
  background: var(--ss-bg-surface);
  color: var(--ss-text-secondary);
}
.ss-conn-status.is-offline {
  display: inline-flex;
  color: var(--ss-danger-700, #9b1c1c);
  border-color: rgba(155, 28, 28, 0.25);
  background: rgba(155, 28, 28, 0.06);
}
.ss-conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* —— Header search / commands —— */
.ss-header-search {
  flex: 0 1 auto;
  max-width: 280px;
  min-width: 0;
  opacity: 1;
}
.ss-header-search .ss-search {
  opacity: 1;
}
.ss-header-search .ss-input {
  cursor: pointer;
  background: var(--ss-bg-muted);
}
.ss-header-kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--ss-border-default);
  background: var(--ss-bg-surface);
  color: var(--ss-text-muted);
  margin-left: 6px;
}
.ss-branch-preview-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ss-primary-700);
  background: rgba(27, 75, 115, 0.1);
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.2;
}
[data-bs-theme="dark"] .ss-branch-preview-badge {
  color: var(--ss-secondary-300, #9fd4cf);
  background: rgba(61, 155, 147, 0.18);
}

/* —— Branch switcher —— */
.ss-branch-menu .dropdown-item.active,
.ss-branch-menu .dropdown-item:active {
  background: rgba(27, 75, 115, 0.08);
  color: var(--ss-primary-900);
  font-weight: 600;
}
.ss-branch-pill {
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
  max-width: min(220px, 42vw);
}
.ss-branch-pill #ssBranchLabel,
.ss-branch-pill .text-truncate {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
}
@media (min-width: 768px) {
  .ss-branch-pill {
    max-width: 280px;
  }
}
.ss-branch-pill:hover,
.ss-branch-pill:focus-visible {
  background: var(--ss-bg-muted);
  border-color: var(--ss-border-focus);
  outline: none;
}

/* —— Notification panel —— */
.ss-notif-panel {
  width: min(380px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}
.ss-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ss-border-subtle);
}
.ss-notif-panel-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}
.ss-notif-list {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ss-notif-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ss-border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background 120ms ease;
}
.ss-notif-item:hover {
  background: var(--ss-bg-muted);
}
.ss-notif-item.is-unread {
  background: rgba(61, 155, 147, 0.06);
}
.ss-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
}
.ss-notif-item-body {
  font-size: 12px;
  color: var(--ss-text-secondary);
  margin: 0;
}
.ss-notif-item-time {
  font-size: 11px;
  color: var(--ss-text-muted);
  margin-top: 4px;
}
.ss-notif-panel-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--ss-border-subtle);
  text-align: center;
}
.ss-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ss-danger-600, #c0392b);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--ss-bg-surface);
}

/* —— Command palette —— */
.ss-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  backdrop-filter: blur(2px);
}
.ss-palette {
  width: min(560px, 100%);
  background: var(--ss-bg-surface);
  border: 1px solid var(--ss-border-default);
  border-radius: var(--ss-radius-lg);
  box-shadow: var(--ss-shadow-lg);
  overflow: hidden;
}
.ss-palette-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ss-border-subtle);
  padding: 16px 18px;
  font-size: 16px;
  background: transparent;
  color: var(--ss-text-primary);
  outline: none;
}
.ss-palette-list {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
}
.ss-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--ss-radius-md);
  color: var(--ss-text-primary);
  font-size: 14px;
}
.ss-palette-item.is-active,
.ss-palette-item:hover {
  background: rgba(27, 75, 115, 0.08);
}
.ss-palette-item kbd {
  margin-left: auto;
  font-size: 11px;
  color: var(--ss-text-muted);
}
.ss-palette-empty {
  padding: 24px;
  text-align: center;
  color: var(--ss-text-secondary);
  font-size: 14px;
}
.ss-palette-foot {
  display: flex;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--ss-border-subtle);
  font-size: 11px;
  color: var(--ss-text-muted);
}

/* —— Session warning —— */
.ss-session-banner {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 1070;
  width: min(360px, calc(100vw - 32px));
  background: var(--ss-bg-surface);
  border: 1px solid var(--ss-border-default);
  border-radius: var(--ss-radius-lg);
  box-shadow: var(--ss-shadow-lg);
  padding: 16px;
}
.ss-session-banner h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
}
.ss-session-banner p {
  font-size: 13px;
  color: var(--ss-text-secondary);
  margin: 0 0 12px;
}

/* —— Help panel —— */
.ss-help-panel .ss-shortcut-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ss-border-subtle);
  font-size: 13px;
}
.ss-help-panel kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--ss-border-default);
  background: var(--ss-bg-muted);
}

/* —— Sidebar favorites / recents —— */
.ss-nav-utility {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 8px 12px;
  margin-top: auto;
}
.ss-nav-utility-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 4px 10px 6px;
}
.ss-nav-utility .ss-nav-link {
  font-size: 13px;
}
.ss-nav-pin {
  opacity: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  padding: 0 4px;
  line-height: 1;
}
.ss-nav-link:hover .ss-nav-pin,
.ss-nav-link:focus-within .ss-nav-pin,
.ss-nav-pin.is-pinned {
  opacity: 1;
}
.ss-nav-pin:hover {
  color: #fff;
}
.ss-sidebar.is-collapsed .ss-nav-utility-title,
.ss-sidebar.is-collapsed .ss-nav-pin {
  display: none;
}

/* —— Scrollbars —— */
.ss-sidebar-scroll,
.ss-notif-list,
.ss-palette-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* —— Content enter —— */
.ss-content-enter {
  animation: ssContentIn 220ms ease both;
}
@keyframes ssContentIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-content-enter,
  .ss-progress-bar-fill,
  .ss-branch-pill,
  .ss-notif-item {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Support FAB —— */
.ss-support-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1060;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--ss-border-default);
  background: var(--ss-bg-surface);
  color: var(--ss-primary-800);
  box-shadow: var(--ss-shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.ss-support-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--ss-shadow-lg);
}
.ss-support-fab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ss-focus-ring);
}

/* —— Nav / pagination / danger / toast —— */
.ss-nav-section.is-demo {
  color: rgba(212, 181, 106, 0.85);
}

.ss-nav-section.is-demo::after {
  content: " UI preview";
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
}

.ss-nav-link.is-disabled,
.ss-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.ss-pagination-wrap .pagination {
  justify-content: flex-end;
  margin-bottom: 0;
}
.ss-danger-zone {
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: var(--ss-radius-lg, 12px);
  padding: 16px;
  background: rgba(185, 28, 28, 0.04);
}
[data-bs-theme="dark"] .ss-danger-zone {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.06);
}
.ss-toast.swal2-popup,
.swal2-popup.ss-toast {
  font-family: "Source Sans 3", system-ui, sans-serif;
  border: 1px solid var(--ss-border-default);
  border-radius: var(--ss-radius-md, 8px);
  box-shadow: var(--ss-shadow-md);
}
.ss-toast-title {
  font-size: 14px !important;
  font-weight: 600 !important;
}

@media print {
  .ss-support-fab,
  .ss-progress-bar,
  #ssSessionWarn {
    display: none !important;
  }
}
