/* The layout around the MudBlazor components: spacing, widths and a few sizes. MudBlazor draws the components
   themselves with its own defaults and the theme's colours (DesignSystem/Theme/PtTheme.cs); nothing here restyles
   them. Only --pt-* variables; logical properties throughout, so the same rules work right-to-left. */

/* ── Menus: the chosen theme, which a MudMenuItem does not mark itself ─────── */

.mud-menu-item.is-selected,
.mud-menu-item.is-selected .mud-icon-root {
    color: var(--pt-accent);
    font-weight: 500;
}

/* ── App bar ───────────────────────────────────────────────────────────────── */

.pt-appbar-title {
    min-width: 0;
    padding-inline: var(--pt-space-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-skip-link {
    position: fixed;
    inset-inline-start: var(--pt-space-2);
    top: -48px;
    z-index: 1400;
    padding: var(--pt-space-2) var(--pt-space-4);
    border-radius: var(--pt-radius-sm);
    background: var(--pt-accent);
    color: var(--pt-on-accent);
}

.pt-skip-link:focus {
    top: var(--pt-space-2);
}

/* ── Navigation drawer ─────────────────────────────────────────────────────── */

.pt-rail-item.is-disabled {
    opacity: 0.45;
}

/* The menu button only where the drawer slides over the page. */
@media (min-width: 960px) {
    .pt-menu-button {
        display: none !important;
    }
}

.pt-shell-content {
    outline: none;
}

/* ── Signed-out pages ──────────────────────────────────────────────────────── */

.pt-auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.pt-auth-container {
    padding-block: var(--pt-space-8);
}

.pt-auth-card {
    padding: var(--pt-space-8) var(--pt-space-6);
}

@media (max-width: 599.98px) {
    .pt-auth-card {
        padding: var(--pt-space-6) var(--pt-space-4);
    }
}

.pt-form {
    display: flex;
    flex-direction: column;
    gap: var(--pt-space-4);
}

/* ── Pages and sections ────────────────────────────────────────────────────── */

.pt-page {
    padding: var(--pt-space-8) var(--pt-space-6) var(--pt-space-12);
}

@media (max-width: 599.98px) {
    .pt-page {
        padding: var(--pt-space-6) var(--pt-space-4) var(--pt-space-10);
    }
}

.pt-page-heading {
    flex: 1;
    min-width: 0;
}

.pt-page-title {
    outline: none;
}

.pt-page-body {
    margin-top: var(--pt-space-6);
}

.pt-section {
    padding: var(--pt-space-6);
}

@media (max-width: 599.98px) {
    .pt-section {
        padding: var(--pt-space-4);
    }
}

.pt-section-body {
    margin-top: var(--pt-space-4);
}

.pt-text {
    margin: 0;
}

.pt-link {
    min-width: 0;
    overflow-wrap: anywhere;
}

.pt-loading {
    padding: var(--pt-space-12) var(--pt-space-4);
}

/* ── Centered messages ─────────────────────────────────────────────────────── */

.pt-message {
    padding: var(--pt-space-10) var(--pt-space-6);
    text-align: center;
}

.pt-message-icon.mud-icon-root {
    width: 48px;
    height: 48px;
}

.pt-message-text {
    max-width: 480px;
}

/* ── Menus ─────────────────────────────────────────────────────────────────── */

.pt-menu-heading {
    display: block;
    padding: var(--pt-space-2) var(--pt-space-4) var(--pt-space-1);
}

.pt-swatches {
    display: grid;
    grid-template-columns: repeat(6, 32px);
    gap: var(--pt-space-2);
    padding: var(--pt-space-2) var(--pt-space-4) var(--pt-space-3);
}

.pt-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--swatch);
    color: #FFFFFF;
    cursor: pointer;
}

.pt-swatch.is-selected {
    border-color: var(--pt-text);
}

.pt-menu-profile {
    padding: var(--pt-space-3) var(--pt-space-4);
}

/* ── Chooser: where a viewer picks the masjid or place for this screen ─────── */

.pt-chooser {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pt-chooser-panel {
    padding-block: var(--pt-space-6);
}

/* The search with "Near me" beside it. */
.pt-search-near {
    display: flex;
    align-items: center;
    gap: var(--pt-space-2);
}

.pt-search-near > .mud-input-control {
    flex: 1;
}

.pt-search-near .pt-choice-chip {
    flex: none;
}

.pt-chip-progress {
    width: 18px !important;
    height: 18px !important;
}

.pt-list-card {
    overflow: hidden;
}

.pt-list-avatar img {
    width: 100%;
    height: 100%;
}

.pt-list-text {
    flex: 1;
    min-width: 0;
}

/* ── Screen-reader-only text ───────────────────────────────────────────────── */

.pt-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Forms on the admin and owner pages ──────────────────────────────────── */

.pt-button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--pt-space-3);
}

.pt-file-button {
    margin: 0;
}

/* Radio buttons one under the other. */
.pt-radio-list.mud-input-control .mud-radio-group {
    display: flex;
    flex-flow: column nowrap;
    align-items: flex-start;
}

.pt-button-progress {
    margin-inline-end: var(--pt-space-2);
}

/* A text that must wrap anywhere rather than widen its column (a long email). */
.pt-min-w-0 {
    min-width: 0;
}

.pt-min-w-0 .mud-typography {
    overflow-wrap: anywhere;
}

/* ── Choice chips: the status filter and the main colour ───────────────────── */

.pt-choice-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-inline-end: var(--pt-space-2);
    border-radius: 50%;
    background: var(--swatch);
    vertical-align: middle;
}

/* A text slide's background colour: a round swatch, a ring and a check when chosen. */
.pt-color-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--swatch);
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.pt-color-dot.is-selected {
    outline: 2px solid var(--pt-accent);
    outline-offset: 2px;
}

/* Material 3 segmented button (the news bar's speed). */
.pt-segmented {
    align-self: flex-start;
}

.pt-temporary-password {
    margin: 0;
    font: 400 var(--pt-type-headline-small) ui-monospace, Consolas, monospace;
    user-select: all;
}

/* ── Data tables (PtDataTable on MudTable; cards on phones) ─────────────────── */

.pt-table .is-numeric {
    text-align: end;
    white-space: nowrap;
}

.pt-table .is-row {
    position: relative;
}

.pt-row-link {
    color: inherit;
    text-decoration: none;
}

/* The row's link covers the whole row; controls in a cell sit above it. */
.pt-row-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.pt-table .is-control {
    position: relative;
    z-index: 1;
    width: 1%;
    white-space: nowrap;
}

.pt-cell {
    display: block;
}

.pt-cell-main {
    display: flex;
    align-items: center;
    gap: var(--pt-space-1);
    font-weight: 500;
}

.pt-cell-sub {
    display: block;
    font: 400 var(--pt-type-body-small) var(--pt-font);
    color: var(--pt-muted);
}

/* Phones: MudTable's cards; the first cell is the card's title. */
@media (max-width: 599.98px) {
    .pt-table .is-control {
        width: auto;
    }
}

.pt-pager {
    display: flex;
    justify-content: center;
    padding-top: var(--pt-space-4);
}

.pt-search-row[role="search"] {
    margin: var(--pt-space-4) 0;
}

/* ── Profile logo ──────────────────────────────────────────────────────────── */

.pt-logo.mud-avatar {
    flex: none;
    width: 72px;
    height: 72px;
}

.pt-logo img {
    width: 100%;
    height: 100%;
}

.pt-logo .mud-icon-root {
    width: 32px;
    height: 32px;
}

/* ── Slides ────────────────────────────────────────────────────────────────── */

.pt-slide-card {
    padding: var(--pt-space-3);
}

.pt-slide-thumb {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 54px;
    overflow: hidden;
    border-radius: var(--pt-radius-sm) !important;
    background: var(--pt-border);
    color: var(--pt-muted);
}

.pt-slide-thumb img {
    width: 100%;
    height: 100%;
}

.pt-slide-info {
    flex: 1;
    min-width: 160px;
}

.pt-slide-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-slide-review {
    align-self: flex-start;
}

/* ── Owner's media review ──────────────────────────────────────────────────── */

.pt-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--pt-space-3);
}

.pt-media-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pt-media-frame {
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pt-media-frame a,
.pt-media-frame img,
.pt-media-frame video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pt-media-note {
    overflow-wrap: anywhere;
}

/* ── News bar lines ────────────────────────────────────────────────────────── */

.pt-news-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ── Owner's masjid detail ─────────────────────────────────────────────────── */

.pt-history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--pt-space-3);
}

/* ── Owner's System page ───────────────────────────────────────────────────── */

.pt-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--pt-space-3);
}

.pt-stat {
    display: flex;
    flex-direction: column;
    gap: var(--pt-space-1);
    padding: var(--pt-space-3) var(--pt-space-4);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius-sm);
    min-width: 0;
}

.pt-stat-label,
.pt-stat-sub {
    color: var(--pt-muted);
    font-size: var(--pt-type-body-small);
}

.pt-stat-value {
    font-size: var(--pt-type-headline-small);
    font-weight: 600;
}

.pt-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--pt-space-1) var(--pt-space-4);
    margin: 0;
}

.pt-facts dt {
    color: var(--pt-muted);
}

.pt-facts dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pt-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--pt-space-1);
}

.pt-bar-row {
    display: grid;
    grid-template-columns: 6.5em 1fr 3em;
    align-items: center;
    gap: var(--pt-space-2);
}

.pt-bar-label {
    color: var(--pt-muted);
    font-size: var(--pt-type-body-small);
}

.pt-bar-track {
    height: 10px;
    border-radius: 5px;
    background: var(--pt-border);
    overflow: hidden;
}

.pt-bar {
    display: block;
    height: 100%;
    background: var(--pt-accent);
    border-radius: 5px;
}

.pt-bar-value {
    text-align: end;
}

.pt-changes {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0 var(--pt-space-2);
    margin: 0;
    max-height: 9em;
    overflow: auto;
    font-size: var(--pt-type-body-small);
}

.pt-changes dt {
    color: var(--pt-muted);
}

.pt-changes dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pt-paths {
    margin: 0;
    padding-inline-start: var(--pt-space-4);
    font-size: var(--pt-type-body-small);
    overflow-wrap: anywhere;
}

.pt-stack {
    margin: var(--pt-space-2) 0 0;
    padding: var(--pt-space-3);
    max-height: 24em;
    overflow: auto;
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius-sm);
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pt-activity-kind {
    max-width: 260px;
}

.pt-system-panel {
    padding-top: var(--pt-space-4);
}