/**
 * Premium workspace micro-interactions — subtle, GPU-friendly.
 * Scoped to authenticated shell (body.tb-workspace-premium).
 */

/* ---- Buttons (app shell) ---- */
body.tb-workspace-premium .app-content .btn {
  transition:
    transform 0.14s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
  will-change: transform;
}

body.tb-workspace-premium .app-content .btn:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

body.tb-workspace-premium .app-content .btn:active {
  transform: scale(0.985);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

body.tb-workspace-premium .app-content .btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

/* ---- Horizontal module nav ---- */
body.tb-workspace-premium .tb-showcase-topnav-link {
  position: relative;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.25s ease;
}

body.tb-workspace-premium .tb-showcase-topnav-link::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #f59f28;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

body.tb-workspace-premium .tb-showcase-topnav-link:hover::after {
  transform: scaleX(0.45);
  opacity: 0.85;
}

body.tb-workspace-premium .tb-showcase-topnav-link.is-active::after {
  transform: scaleX(1);
  opacity: 1;
}

body.tb-workspace-premium .tb-showcase-topnav-link.is-active {
  border-bottom-color: transparent;
}

/* ---- Sidebar links ---- */
body.tb-workspace-premium .shell .sidebar .side-nav a {
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

body.tb-workspace-premium .shell .sidebar .side-nav a:active {
  transform: translateX(1px);
}

/* ---- Action Centre queue ---- */
body.tb-workspace-premium .app-content .table tbody tr {
  transition:
    background-color 0.18s ease,
    box-shadow 0.2s ease;
}

body.tb-workspace-premium .app-content .table tbody tr:hover {
  background-color: rgba(241, 245, 249, 0.95);
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.35);
}

body.tb-workspace-premium .app-content .tb-rec-card.tb-ac-mobile-card {
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    border-color 0.2s ease;
}

body.tb-workspace-premium .app-content .tb-rec-card.tb-ac-mobile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body.tb-workspace-premium .app-content .tb-rec-card.tb-ac-mobile-card:active {
  transform: translateY(0);
  transition-duration: 0.08s;
}

body.tb-workspace-premium .app-content .badge.tb-badge-sev {
  transition:
    transform 0.16s ease,
    box-shadow 0.2s ease;
}

body.tb-workspace-premium .app-content .table tbody tr:hover .badge.tb-badge-sev {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* ---- Hero metrics (Action Centre) ---- */
body.tb-workspace-premium .app-content .tb-hero-metric {
  transition: transform 0.18s ease;
}

body.tb-workspace-premium .app-content .tb-hero-metric:hover {
  transform: translateY(-2px);
}

body.tb-workspace-premium .app-content .tb-hero-card {
  transition: box-shadow 0.22s ease, border-color 0.2s ease;
}

/* ---- Form controls in panels ---- */
body.tb-workspace-premium .app-content .card.panel .input,
body.tb-workspace-premium .app-content .card.panel select.input {
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

body.tb-workspace-premium .app-content .card.panel .input:focus,
body.tb-workspace-premium .app-content .card.panel select.input:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ---- prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  body.tb-workspace-premium .app-content .btn,
  body.tb-workspace-premium .tb-showcase-topnav-link,
  body.tb-workspace-premium .tb-showcase-topnav-link::after,
  body.tb-workspace-premium .shell .sidebar .side-nav a,
  body.tb-workspace-premium .app-content .table tbody tr,
  body.tb-workspace-premium .app-content .tb-rec-card.tb-ac-mobile-card,
  body.tb-workspace-premium .app-content .badge.tb-badge-sev,
  body.tb-workspace-premium .app-content .tb-hero-metric,
  body.tb-workspace-premium .app-content .tb-hero-card,
  body.tb-workspace-premium .app-content .card.panel .input,
  body.tb-workspace-premium .app-content .card.panel select.input {
    transition: none !important;
    animation: none !important;
  }

  body.tb-workspace-premium .app-content .btn:active,
  body.tb-workspace-premium .shell .sidebar .side-nav a:active,
  body.tb-workspace-premium .app-content .tb-rec-card.tb-ac-mobile-card:active {
    transform: none !important;
  }

  body.tb-workspace-premium .tb-showcase-topnav-link::after {
    transform: none !important;
    opacity: 0 !important;
  }

  body.tb-workspace-premium .tb-showcase-topnav-link.is-active::after {
    opacity: 1 !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
  }
}
