/* ──────────────────────────────────────────────────────────────────────────
   TenFootTen Admin — shared styling
   Applied globally via index.html so every admin page gets a consistent,
   tight, scannable look without per-page changes.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Brand palette tweaks ─────────────────────────────────────────────────
   Override a few MudBlazor CSS variables so all admin pages share a tighter,
   slightly cooler look. Adjust here once instead of per-page. */
:root {
    --tf-admin-row-alt: rgba(0, 0, 0, 0.025);
    --tf-admin-row-hover: rgba(25, 118, 210, 0.08);
    --tf-admin-header-bg: var(--mud-palette-surface);
    --tf-admin-header-fg: var(--mud-palette-text-primary);
    --tf-admin-border: rgba(0, 0, 0, 0.08);
}

/* ── MudPaper containers ──────────────────────────────────────────────────
   Slightly softer corners + a subtle border so cards feel framed rather
   than floating. */
.mud-paper {
    border: 1px solid var(--tf-admin-border);
}

/* ── Page heading block ───────────────────────────────────────────────────
   Used by the AdminPageHeader component for consistent title + intro. */
.tf-admin-page-header {
    border-bottom: 1px solid var(--tf-admin-border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.tf-admin-page-header h1,
.tf-admin-page-header h2,
.tf-admin-page-header h3,
.tf-admin-page-header h4 {
    margin: 0 0 0.25rem 0;
}

/* ── Toolbar row above tables ─────────────────────────────────────────── */
.tf-admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tf-admin-toolbar .mud-input-control {
    min-width: 220px;
}

/* ── Tighter, more scannable MudTable ───────────────────────────────────── */
.mud-table-root {
    border-radius: 6px;
    overflow: hidden;
}

/* Header cells: small caps, slightly bolder, tinted background */
.mud-table-head .mud-table-cell {
    background: var(--tf-admin-header-bg) !important;
    color: var(--tf-admin-header-fg) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
    border-bottom: 2px solid var(--tf-admin-border) !important;
}

/* Body cells: tighter vertical padding for higher information density */
.mud-table-body .mud-table-cell {
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    font-size: 0.88rem;
    vertical-align: middle;
}

/* Striped rows — slightly stronger than MudBlazor default */
.mud-table-root.mud-table-bordered .mud-table-body .mud-table-row:nth-of-type(even) {
    background: var(--tf-admin-row-alt);
}

/* Hover */
.mud-table-root .mud-table-body .mud-table-row:hover {
    background: var(--tf-admin-row-hover) !important;
    cursor: default;
}

/* Action column — consistent spacing for icon buttons */
.tf-admin-actions {
    white-space: nowrap;
}

.tf-admin-actions .mud-icon-button {
    padding: 4px;
}

/* ── Count chips for parent → child navigation ────────────────────────── */
.tf-admin-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--mud-palette-primary);
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    line-height: 1.4;
    transition: filter 120ms ease;
}

.tf-admin-count-chip:hover {
    filter: brightness(1.1);
    text-decoration: none;
}

.tf-admin-count-chip.tf-admin-count-zero {
    background: var(--mud-palette-action-disabled-background);
    color: var(--mud-palette-text-secondary);
    cursor: default;
}

.tf-admin-count-chip .mud-icon-root {
    font-size: 0.95rem;
}

/* ── Tip / instruction alerts above tables ────────────────────────────── */
.tf-admin-tip {
    margin-bottom: 1rem;
}

/* ── Compact search toolbar inside MudTable ───────────────────────────── */
.mud-table-toolbar {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    background: var(--tf-admin-header-bg);
    border-bottom: 1px solid var(--tf-admin-border);
}

/* ── Empty-state alerts ───────────────────────────────────────────────── */
.tf-admin-empty {
    margin-top: 0.75rem;
}

/* Experience cards are shared by the client-hosted and standalone admin apps. */
.tf-admin-exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
    align-items: stretch;
}

.tf-admin-exp-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 100%;
    min-width: 0;
    border-radius: 10px;
}

.tf-admin-exp-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.5rem;
}

.tf-admin-exp-card-title {
    min-width: 0;
}

.tf-admin-exp-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-admin-exp-desc,
.tf-admin-exp-host {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tf-admin-exp-host {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--mud-palette-text-secondary);
}

.tf-admin-exp-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tf-admin-exp-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.tf-admin-exp-flag-on {
    background: rgba(61, 203, 108, 0.16);
    color: #1b7a3d;
    border: 1px solid rgba(61, 203, 108, 0.35);
}

.tf-admin-exp-flag-off {
    background: rgba(0, 0, 0, 0.04);
    color: var(--mud-palette-text-disabled);
    border: 1px solid var(--tf-admin-border);
}

.tf-admin-exp-actions {
    margin-top: auto;
    padding-top: 0.25rem;
    border-top: 1px solid var(--tf-admin-border);
}

@media (min-width: 1200px) {
    .tf-admin-exp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
