/* HADAFIN Phase 24b - reusable UI component layer (token-based).
   Opt-in only: styles apply when you use `hf-*` classes / data attributes. */

.hf-card {
  background: var(--hf-color-surface-0);
  border: 1px solid var(--hf-color-border);
  border-radius: var(--hf-radius-lg);
  box-shadow: var(--hf-shadow-sm);
}

/* Glass card: slightly translucent surface with backdrop blur.
   Works in both themes because tokens are overridden in `design-tokens.css`. */
.hf-card--glass {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(10px);
}

html[data-theme="dark"] .hf-card--glass,
body.theme-dark .hf-card--glass,
body[data-theme="dark"] .hf-card--glass {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
}

.hf-card--soft {
  background: var(--hf-color-surface-1);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: var(--hf-shadow-sm);
}

/* -----------------------------
   Empty state
------------------------------ */
.hf-empty-state {
  width: 100%;
  padding: var(--hf-space-6);
  border-radius: var(--hf-radius-lg);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: var(--hf-color-surface-1);
  display: flex;
  flex-direction: column;
  gap: var(--hf-space-3);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hf-empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.20);
}

.hf-empty-state__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--hf-color-text);
}

.hf-empty-state__message {
  font-size: 12px;
  color: var(--hf-color-muted);
}

.hf-empty-state__cta {
  display: inline-flex;
}

/* -----------------------------
   Loading skeleton
------------------------------ */
.hf-skeleton {
  display: inline-block;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.18) 0%,
    rgba(148, 163, 184, 0.32) 45%,
    rgba(148, 163, 184, 0.18) 100%
  );
  background-size: 200% 100%;
  animation: hf-skeleton-shimmer 1.15s ease-in-out infinite;
}

@keyframes hf-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* -----------------------------
   DataGrid (opt-in)
------------------------------ */
.hf-datagrid {
  width: 100%;
}

.hf-datagrid__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--hf-space-3);
  padding: var(--hf-space-3);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.hf-datagrid__pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--hf-space-2);
  padding: var(--hf-space-3);
}

.hf-datagrid__btn {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--hf-color-surface-0);
  color: var(--hf-color-text);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.hf-datagrid__btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.hf-datagrid__empty-row td {
  padding: var(--hf-space-6);
}

/* -----------------------------
   Modal / Drawer / Toast / Tabs
   (minimal styles; JS drives behavior)
------------------------------ */
.hf-modal,
.hf-drawer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}

.hf-modal.is-open,
.hf-drawer.is-open {
  display: block;
}

.hf-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.hf-modal__panel {
  position: relative;
  margin: 5vh auto;
  max-width: 720px;
  border-radius: var(--hf-radius-lg);
  box-shadow: var(--hf-shadow-md);
  background: var(--hf-color-surface-0);
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.hf-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  border-radius: var(--hf-radius-lg) 0 0 var(--hf-radius-lg);
  box-shadow: var(--hf-shadow-md);
  background: var(--hf-color-surface-0);
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: auto;
}

.hf-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.hf-toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--hf-shadow-md);
  padding: 12px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] .hf-toast {
  background: rgba(15, 23, 42, 0.88);
}

.hf-tabs [data-hf-tab-content] {
  display: none;
}

.hf-tabs [data-hf-tab-content].is-active {
  display: block;
}

