/* ─────────────────────────────────────────────────────────────
   Clyffe — Design system component styles (shared by all web apps)
   Consumed via _content/Clyffe.DesignSystem/clyffe-components.css,
   linked after clyffe-tokens.css. Uses tokens only — no raw values.
   ───────────────────────────────────────────────────────────── */

/* ── Utilities ── */
.cursor-pointer {
    cursor: pointer;
}

/* ── Detail pane (non-modal slide-in from the right) ── */
.clyffe-detail-pane {
    position: fixed;
    /* Clear the app bar: it is a fixed, opaque strip that wins the paint order
       against this pane regardless of z-index, so overlapping it hides the
       pane's own header. */
    top: var(--appbar-height, 48px);
    right: 0;
    bottom: 0;
    width: var(--clyffe-detail-pane-width, min(600px, 92vw));
    z-index: 1350;
    display: none;
    flex-direction: column;
    background: var(--surface-card);
    border-left: 1px solid var(--border-strong);
    box-shadow: var(--shadow-overlay);
    overflow: hidden;
}

.clyffe-detail-pane.open {
    display: flex;
    animation: clyffe-detail-pane-in var(--duration-panel) var(--ease-out);
}

@keyframes clyffe-detail-pane-in {
    from {
        transform: translateX(48px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.clyffe-detail-pane-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-hairline);
    background: var(--surface-sunken);
}

.clyffe-detail-pane-heading {
    flex: 1;
    min-width: 0;
}

.clyffe-detail-pane-title {
    font-family: var(--font-display);
    font-size: var(--text-h1-size);
    font-weight: var(--weight-display);
    line-height: var(--leading-heading);
    color: var(--text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clyffe-detail-pane-subtitle {
    margin-top: var(--space-1);
    font-size: var(--text-caption-size);
    color: var(--text-muted);
}

.clyffe-detail-pane-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.clyffe-detail-pane-close {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-micro);
}

.clyffe-detail-pane-close:hover {
    background: var(--navy-05);
    color: var(--ink);
}

.clyffe-detail-pane-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.clyffe-detail-pane-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-hairline);
    background: var(--surface-card);
}

/* ── Empty state (calm, quiet — no alarm styling) ── */
.clyffe-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
}

.clyffe-empty-state-icon {
    color: var(--navy-40);
}

.clyffe-empty-state-title {
    font-family: var(--font-display);
    font-size: var(--text-h2-size);
    font-weight: var(--weight-display-medium);
    color: var(--text-heading);
}

.clyffe-empty-state-description {
    max-width: 420px;
    font-size: var(--text-body-size);
    line-height: var(--leading-body);
    color: var(--text-body);
}

.clyffe-empty-state-actions {
    margin-top: var(--space-2);
    display: flex;
    gap: var(--space-2);
}

/* ── Page transition (subtle fade on navigation — nothing snaps) ──
   Opacity only, deliberately: animating transform makes the wrapper the containing
   block for position: fixed descendants, which clipped the detail panes to the page
   content instead of the viewport. */

.clyffe-page-transition {
    animation: clyffe-page-enter var(--duration-panel) var(--ease-out) both;
}

@keyframes clyffe-page-enter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Skeleton loading (skeletons over spinners; navy-to-cream pulse) ── */

.clyffe-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2) 0;
}

.clyffe-skeleton-row {
    height: 40px;
    border-radius: var(--radius-xs);
    background: linear-gradient(90deg, var(--navy-05), var(--parchment-50), var(--navy-05));
    background-size: 200% 100%;
    animation: clyffe-skeleton-pulse 1.6s var(--ease-in-out) infinite;
}

@keyframes clyffe-skeleton-pulse {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clyffe-page-transition {
        animation: none;
    }

    .clyffe-skeleton-row {
        animation: none;
        background: var(--navy-05);
    }
}
