/* =====================================================================
   HOMECARE — Application shell & navigation (M00 PART 02)
   Mobile shell: header, scrollable main region, fixed bottom tab bar.
   Reusable page container + placeholder styles.
   Respects safe-area insets; content never hides behind the tab bar.
   ===================================================================== */

/* ---- Document shell layout ---- */
html,
body {
  height: 100%;
}
body {
  overflow: hidden; /* the shell manages its own scrolling */
}

.hc-header[hidden],
.hc-tabbar[hidden] {
  display: none !important;
}

.hc-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--hc-app-max-width);
  height: 100dvh;
  margin-inline: auto;
  background: var(--hc-bg-app);
  overflow: hidden;
}

/* ---- Header (top app bar) ---- */
.hc-header {
  flex: 0 0 auto;
  position: relative;
  z-index: var(--hc-z-header);
  background: var(--hc-bg-surface);
  border-bottom: 1px solid var(--hc-border);
  box-shadow: var(--hc-shadow-sm);
  padding-top: env(safe-area-inset-top);
}
.hc-header__bar {
  display: flex;
  align-items: center;
  gap: var(--hc-space-3);
  min-height: var(--hc-header-height);
  padding-inline: var(--hc-space-4);
}
/* Left slot: brand / future back action */
.hc-header__left {
  flex: 0 1 auto;
  min-width: 0;
}
/* Center title */
.hc-header__title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: var(--hc-font-size-md);
  font-weight: var(--hc-font-weight-semibold);
  color: var(--hc-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Right slot: future contextual action */
.hc-header__right {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.hc-header .hc-wordmark__name {
  font-size: var(--hc-font-size-sm);
}

/* ---- Main region (scroll container) ---- */
.hc-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--hc-space-5) var(--hc-space-4) var(--hc-space-8);
  /* Space is also reserved via the flex layout so content is never
     hidden behind the bottom tab bar. */
}
.hc-main:focus {
  outline: none;
}
.hc-main:focus-visible {
  box-shadow: none; /* main is a landmark, not a control */
}

/* ---- Reusable page container ---- */
.hc-page {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
}

/* ---- Placeholder page ---- */
.hc-placeholder {
  align-items: center;
  text-align: center;
  padding-top: var(--hc-space-12);
}
.hc-placeholder__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--hc-radius-xl);
  background: var(--hc-color-accent-weak);
  color: var(--hc-color-primary);
  margin-bottom: var(--hc-space-2);
}
.hc-placeholder__title {
  font-size: var(--hc-font-size-xl);
}
.hc-placeholder__title:focus {
  outline: none;
}
.hc-placeholder__note {
  max-width: 34ch;
}
.hc-placeholder__tag {
  margin-top: var(--hc-space-1);
}

/* ---- Bottom tab bar ---- */
.hc-tabbar {
  flex: 0 0 auto;
  position: relative;
  z-index: var(--hc-z-nav);
  background: var(--hc-bg-surface);
  border-top: 1px solid var(--hc-border);
  box-shadow: 0 -2px 12px rgba(10, 35, 66, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.hc-tabbar__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--hc-bottom-nav-height);
}

/* Operational workspaces use only their implemented destinations rather
   than reserving the five customer-tab columns. */
.hc-tabbar--compact .hc-tabbar__list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hc-tabbar--single .hc-tabbar__list {
  grid-template-columns: minmax(0, 1fr);
}
.hc-tabbar--single .hc-tab {
  flex-direction: row;
  justify-content: flex-start;
  gap: var(--hc-space-2);
  padding-inline: var(--hc-space-4);
}
.hc-tabbar--single .hc-tab__icon {
  width: 36px;
}
.hc-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--hc-touch-target);
  height: 100%;
  padding: 0 var(--hc-space-1);
  color: var(--hc-text-muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--hc-duration-fast) var(--hc-ease-standard);
}
.hc-tab__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 26px;
  border-radius: var(--hc-radius-pill);
  transition: background var(--hc-duration-fast) var(--hc-ease-standard);
}
.hc-tab__label {
  font-size: var(--hc-font-size-xs);
  font-weight: var(--hc-font-weight-medium);
  line-height: 1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hover / focus / active states */
.hc-tab:hover {
  color: var(--hc-text-base);
}
.hc-tab:focus-visible {
  outline: none;
  box-shadow: var(--hc-focus-ring);
  border-radius: var(--hc-radius-md);
}

/* Selected state follows the current route (aria-current="page") */
.hc-tab[aria-current="page"] {
  color: var(--hc-color-primary-strong);
}
.hc-tab[aria-current="page"] .hc-tab__icon {
  background: var(--hc-color-accent-weak);
}
.hc-tab[aria-current="page"] .hc-tab__label {
  font-weight: var(--hc-font-weight-semibold);
}

/* ---- Reduced motion: drop transitions on the shell chrome ---- */
@media (prefers-reduced-motion: reduce) {
  .hc-tab,
  .hc-tab__icon {
    transition: none;
  }
}
