/* ── MudBlazor AppBar height overrides ──────────────────────────── */
/* MudBlazor reduces toolbar height on small screens — force consistent height */
.mud-appbar .mud-toolbar-appbar { height: var(--mud-appbar-height) !important; }
.mud-main-content { padding-top: var(--mud-appbar-height, 64px) !important; }
/* Prevent oversized gutter jump at 600px */
.mud-appbar .mud-toolbar-gutters { padding-left: 16px !important; padding-right: 16px !important; }

/* ── Mobile / PWA ────────────────────────────────────────────────── */
html, body { overscroll-behavior-y: contain; }

/* ── Pull-to-Refresh indicator ───────────────────────────────────── */
.ptr-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 9999;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-surface, #fff);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    pointer-events: none;
}
@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}
.ptr-spinning svg {
    animation: ptr-spin 0.8s linear infinite;
}

/* ── Swipe-Reveal Cards ──────────────────────────────────────────── */
.swipe-reveal-wrap {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--mud-palette-divider);
}
.swipe-reveal-left,
.swipe-reveal-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: stretch;
    opacity: 0;
    transition: opacity 0.15s;
}
.swipe-reveal-left  { left: 0; }
.swipe-reveal-right { right: 0; }
.swipe-reveal-left.visible,
.swipe-reveal-right.visible { opacity: 1; }

.swipe-card-slide {
    background: var(--mud-palette-surface);
    position: relative;
    z-index: 1;
}
.swipe-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
    cursor: pointer;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.swipe-action-btn:active { filter: brightness(0.9); }
.swipe-action-edit      { background: #1976d2; }
.swipe-action-delete    { background: #d32f2f; }
.swipe-action-create    { background: #388e3c; }
.swipe-action-duplicate { background: #1976d2; }
.swipe-action-done      { background: #388e3c; }

/* ── Status colours for reminder cards ──────────────────────────── */
/* Subtle background tint only; OK = default surface (no emphasis) */
.reminder-card-missing .mud-paper  { background-color: rgba(211, 47, 47, 0.10) !important; }
.reminder-card-upcoming .mud-paper { background-color: rgba(255, 213, 0, 0.20) !important; }

/* ── Logs + Reminders page ───────────────────────────────────────── */
.logs-page, .reminders-page, .changes-page { padding: 16px 16px 0; }
@media (min-width: 600px) {
    .logs-page, .reminders-page, .changes-page { max-width: 680px; margin: 0 auto; }
}
.log-item--selected .mud-paper { background-color: rgba(26, 76, 139, 0.12) !important; }

/* ── Settings sub-page slide-in animation ────────────────────────── */
@keyframes slideRightToLeftPage {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.settings-subpage {
    animation: slideRightToLeftPage 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* ── Done-button bar ─────────────────────────────────────────────── */
.done-bar {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    z-index: 800;
    padding: 8px 16px;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-divider);
    box-shadow: 0 -2px 8px rgba(0,0,0,.10);
}

/* ── Subtask list inside dialog ─────────────────────────────────── */
.subtask-list { padding: 0; list-style: none; margin: 0; }
.subtask-row  { display: flex; align-items: center; gap: 4px; padding: 2px 0; }

/* Drag handle: muted, only it starts a reorder; touch-action:none stops the
   page from scrolling while dragging on touch devices. */
.subtask-drag-handle {
    display: flex;
    align-items: center;
    touch-action: none;
    cursor: grab;
    color: var(--mud-palette-text-disabled);
}
.subtask-drag-handle:active { cursor: grabbing; }
.subtask-row.reorder-dragging {
    opacity: 0.85;
    background: var(--mud-palette-action-default-hover);
    border-radius: 8px;
}

/* ── Right-side detail panel (tablet + desktop ≥600px) ──────────── */
.detail-panel {
    display: none;
    position: fixed;
    right: 0;
    top: var(--mud-appbar-height, 64px);
    height: calc(100dvh - var(--mud-appbar-height, 64px));
    width: 420px;
    flex-direction: column;
    background: var(--mud-palette-surface);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
    z-index: 1200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}
.detail-panel--open { transform: translateX(0); }
@media (min-width: 600px) {
    .detail-panel { display: flex; }
}
.detail-panel-header {
    display: flex;
    align-items: center;
    padding: 8px 8px 8px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
    min-height: 52px;
}
.detail-panel-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}
.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-divider) transparent;
}
.detail-panel-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
}
