/* Material Design Base - 8dp grid system */
:root {
    font-size: 62.5%;
    --spacing-unit: 0.8rem; /* 8px base unit */
}

/* AppBar - Seamless with page (no elevation) */
.mud-appbar {
    box-shadow: none;
}

    .mud-appbar svg {
        color: var(--mud-palette-primary);
    }

/* Tabs - Material Design */
.mud-tab.mud-tab-active {
    font-weight: 600;
    color: var(--mud-palette-primary);
}

*.mud-tabs-panels .mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol {
    color: var(--mud-palette-primary) !important;
    font-weight: 600;
    font-variant: all-small-caps;
}

/* Data Grid Headers - Material Design */
.mud-table-root .mud-table-head .mud-table-cell {
    color: var(--mud-palette-primary);
    font-weight: 600;
    line-height: 2.4rem;
    font-size: 1.3rem;
    font-variant: all-small-caps;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    border-bottom: 2px solid var(--mud-palette-primary);
}

.mud-toolbar .mud-menu svg {
    fill: var(--mud-palette-primary);
}

/* Table Container */
.mud-table-container {
    max-height: fit-content;
    height: fit-content;
    scrollbar-color: var(--mud-palette-secondary) var(--mud-palette-white);
    scrollbar-width: thin;
    width: unset !important;
}

.mud-table-head .mud-table-row svg {
    fill: var(--mud-palette-primary);
}

/* Pagination - Material Design Colors */
.mud-table-pagination-caption:nth-child(2) {
    color: rgba(0, 0, 0, 0.60);
}

.mud-table-pagination-toolbar svg {
    color: var(--mud-palette-primary);
}

.mud-table-pagination-toolbar {
    background: #FFFFFF;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
}

/* Links - Material Design */
.mud-link .mud-link-underline-hover {
    font-size: 1.3rem;
    transition: color 0.2s ease-in-out;
}

.mud-link:hover {
    color: var(--mud-palette-tertiary);
}

/* Data Grid Content - Material Design Typography */
.mud-table-cell {
    font-size: 1.4rem;
    line-height: 2.0rem;
    color: rgba(0, 0, 0, 0.87);
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
}

.mud-data-grid {
    font-size: 1.4rem;
}

    /* Data Grid Cells - ensure proper text color */
    .mud-data-grid .mud-table-cell {
        color: rgba(0, 0, 0, 0.87);
    }

    .mud-data-grid tbody .mud-table-cell {
        color: rgba(0, 0, 0, 0.87);
    }

/* Toolbar - Sticky Positioning */
.mud-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #FFFFFF;
}

/* Drawer - Material Design */
.mud-drawer {
    box-shadow: 0px 8px 10px -5px rgba(0,0,0,0.2), 0px 16px 24px 2px rgba(0,0,0,0.14), 0px 6px 30px 5px rgba(0,0,0,0.12);
}

.mud-drawer-header {
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
}

/* Expanded Row Details */
.expandable-row-details-text {
    font-size: 1.3rem;
    line-height: 2.0rem;
    color: rgba(0, 0, 0, 0.87);
}

/* Dividers - Material Design */
.mud-divider {
    border-color: rgba(0, 0, 0, 0.12);
}

/* Elevation Classes */
.elevation-0 {
    box-shadow: none;
}

.elevation-1 {
    box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
}

.elevation-2 {
    box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
}

.elevation-4 {
    box-shadow: 0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12);
}

.elevation-8 {
    box-shadow: 0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12);
}

/* Spacing Utilities - 8dp Grid */
.pa-1 {
    padding: var(--spacing-unit);
}

.pa-2 {
    padding: calc(var(--spacing-unit) * 2);
}

.pa-3 {
    padding: calc(var(--spacing-unit) * 3);
}

.ma-1 {
    margin: var(--spacing-unit);
}

.ma-2 {
    margin: calc(var(--spacing-unit) * 2);
}

.ma-3 {
    margin: calc(var(--spacing-unit) * 3);
}

/* Indeterminate Progress Circle */
.pure-material-progress-circular {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    border: none;
    border-radius: 50%;
    padding: 0.25em;
    width: 4.8rem;
    height: 4.8rem;
    color: var(--mud-palette-primary);
    background-color: transparent;
    font-size: 16px;
    overflow: hidden;
}

    .pure-material-progress-circular::-webkit-progress-bar {
        background-color: transparent;
    }

    .pure-material-progress-circular:indeterminate {
        -webkit-mask-image: linear-gradient(transparent 50%, black 50%), linear-gradient(to right, transparent 50%, black 50%);
        mask-image: linear-gradient(transparent 50%, black 50%), linear-gradient(to right, transparent 50%, black 50%);
        animation: pure-material-progress-circular 6s infinite cubic-bezier(0.3, 0.6, 1, 1);
    }

    :-ms-lang(x), .pure-material-progress-circular:indeterminate {
        animation: none;
    }

        .pure-material-progress-circular:indeterminate::before,
        .pure-material-progress-circular:indeterminate::-webkit-progress-value {
            content: "";
            display: block;
            box-sizing: border-box;
            margin-bottom: 0.25em;
            border: solid 0.25em transparent;
            border-top-color: currentColor;
            border-radius: 50%;
            width: 100% !important;
            height: 100%;
            background-color: transparent;
            animation: pure-material-progress-circular-pseudo 0.75s infinite linear alternate;
        }

        .pure-material-progress-circular:indeterminate::-moz-progress-bar {
            box-sizing: border-box;
            border: solid 0.25em transparent;
            border-top-color: currentColor;
            border-radius: 50%;
            width: 100%;
            height: 100%;
            background-color: transparent;
            animation: pure-material-progress-circular-pseudo 0.75s infinite linear alternate;
        }

        .pure-material-progress-circular:indeterminate::-ms-fill {
            animation-name: -ms-ring;
        }

@keyframes pure-material-progress-circular {
    0% {
        transform: rotate(0deg);
    }

    12.5% {
        transform: rotate(180deg);
        animation-timing-function: linear;
    }

    25% {
        transform: rotate(630deg);
    }

    37.5% {
        transform: rotate(810deg);
        animation-timing-function: linear;
    }

    50% {
        transform: rotate(1260deg);
    }

    62.5% {
        transform: rotate(1440deg);
        animation-timing-function: linear;
    }

    75% {
        transform: rotate(1890deg);
    }

    87.5% {
        transform: rotate(2070deg);
        animation-timing-function: linear;
    }

    100% {
        transform: rotate(2520deg);
    }
}

@keyframes pure-material-progress-circular-pseudo {
    0% {
        transform: rotate(-30deg);
    }

    29.4% {
        border-left-color: transparent;
    }

    29.41% {
        border-left-color: currentColor;
    }

    64.7% {
        border-bottom-color: transparent;
    }

    64.71% {
        border-bottom-color: currentColor;
    }

    100% {
        border-left-color: currentColor;
        border-bottom-color: currentColor;
        transform: rotate(225deg);
    }
}

/* Accessibility - Focus States */
*:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Transitions - Material Motion */
/*.mud-button, .mud-icon-button, .mud-chip {
    transition: background-color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.1s cubic-bezier(0.4, 0.0, 0.2, 1);
}*/

/* ========================================
   Skeleton Screen Loading States
   ======================================== */

.skeleton-container {
    width: 100%;
    min-height: 100vh;
    background: #FAFAFA;
}

.skeleton-appbar {
    display: flex;
    align-items: center;
    height: 64px;
    background: #FFFFFF;
    padding: 0 calc(var(--spacing-unit) * 2);
    gap: calc(var(--spacing-unit) * 2);
}

.skeleton-title {
    width: 200px;
    height: 24px;
    background: linear-gradient(90deg, #E0E0E0 25%, #F5F5F5 50%, #E0E0E0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(90deg, #E0E0E0 25%, #F5F5F5 50%, #E0E0E0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 50%;
}

.skeleton-search {
    width: 250px;
    height: 40px;
    background: linear-gradient(90deg, #E0E0E0 25%, #F5F5F5 50%, #E0E0E0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-grid {
    margin: calc(var(--spacing-unit) * 2);
    background: #FFFFFF;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
}

.skeleton-grid-header {
    display: flex;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    border-bottom: 2px solid #00427C;
    background: #FAFAFA;
}

.skeleton-header-cell {
    padding: 0 var(--spacing-unit);
    height: 20px;
    background: linear-gradient(90deg, #C5CAE9 25%, #E8EAF6 50%, #C5CAE9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-right: calc(var(--spacing-unit) / 2);
}

.skeleton-grid-row {
    display: flex;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.skeleton-cell {
    padding: 0 var(--spacing-unit);
    display: flex;
    align-items: center;
    margin-right: calc(var(--spacing-unit) / 2);
}

.skeleton-box {
    width: 16px;
    height: 16px;
    background: linear-gradient(90deg, #E0E0E0 25%, #F5F5F5 50%, #E0E0E0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px;
}

.skeleton-circle {
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, #E0E0E0 25%, #F5F5F5 50%, #E0E0E0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 50%;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #E0E0E0 25%, #F5F5F5 50%, #E0E0E0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-loading-indicator {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 1100;
}

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

    100% {
        background-position: 200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.content-loaded {
    animation: fadeIn 0.3s ease-in;
}

/* Responsive Spacing */
@media (max-width: 600px) {
    :root {
        --spacing-unit: 0.4rem; /* 4px for mobile */
    }

    .mud-appbar {
        height: 56px;
    }

    .skeleton-appbar {
        height: 56px;
    }

    .skeleton-search {
        width: 150px;
    }

    .skeleton-grid {
        margin: var(--spacing-unit);
    }

    .skeleton-loading-indicator {
        top: 56px;
    }
}
/* Activity Details Bottom Sheet */
.activity-details-sheet .mud-drawer-content {
    max-height: 60vh;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
}

.details-sheet-container {
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.details-sheet-header {
    padding: 16px 24px;
    background: #FAFAFA;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.details-sheet-header .header-stack {
        gap: 16px;
        flex-wrap: nowrap !important;
        margin-bottom: 16px;
    }

    .details-sheet-header .header-left {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
 }

    .details-sheet-header .header-text {
        flex: 1 1 auto;
      min-width: 0;
    overflow: hidden;
    }

    .details-sheet-header .header-right {
        flex: 0 0 auto;
        gap: 8px;
    }

/* Header Quick Details Row */
.header-quick-details {
    padding-top: 12px;
 border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.quick-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-wrap: nowrap;
}

.quick-detail-label {
    font-weight: 500;
    white-space: nowrap;
}

.quick-detail-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    word-break: break-word;
    font-weight: 500;
}

    .quick-detail-link:hover {
        text-decoration: underline;
    }

.details-sheet-title {
    color: rgba(0, 0, 0, 0.87);
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.details-sheet-content {
    padding: 24px;
    overflow: hidden; /* Changed from overflow-y: auto to prevent scrolling */
    flex: 1;
    min-height: 0; /* Important for flex shrinking */
    display: flex;
    flex-direction: column;
}

/* Make MudGrid flex container */
.details-sheet-content .mud-grid {
    flex: 1;
    min-height: 0;
    display: flex;
}

/* Make MudItem flex items */
.details-sheet-content .mud-grid-item {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.details-card {
    background: #FAFAFA;
    border-radius: 8px;
    padding: 16px;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    min-height: 0;
}

/* Ensure MudStack within details-card stretches */
.details-card > .mud-stack {
  flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden; /* Prevent stack from scrolling */
}

/* Ensure inner MudStack items in description card don't prevent scrolling */
.details-card .mud-stack > .mud-stack-item {
    min-height: 0;
}

/* Make sure the description-box parent in the stack can shrink */
.details-card .mud-stack > .mud-stack-item:has(.description-box) {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden;
}

.details-section-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
 margin-bottom: 8px;
    flex-shrink: 0; /* Don't let title shrink */
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #FFFFFF;
    border-radius: 4px;
margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

    .detail-row:last-child {
 margin-bottom: 0;
    }

.detail-label {
    font-weight: 500;
    white-space: nowrap;
}

.detail-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    word-break: break-word;
}

.description-box {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 16px;
    overflow-y: auto !important;
    overflow-x: hidden;
    flex: 1 1 0 !important; /* Changed to flex-basis 0 for better scrolling */
    min-height: 0 !important;
    max-height: 100%; /* Constrain to parent */
    height: 100%; /* Explicitly set height */
}

.description-text {
    color: rgba(0, 0, 0, 0.87);
    line-height: 1.6;
    word-break: break-word;
    display: block; /* Ensure it's a block element */
}

/* Target the MudPaper wrapper around description-box */
.details-card .mud-paper.description-box {
    overflow-y: auto !important;
}

@media (max-width: 960px) {
    .activity-details-sheet .mud-drawer-content {
        max-height: 70vh;
    }

    .details-sheet-header,
    .details-sheet-content {
        padding: 20px;
    }

    .header-quick-details {
  flex-direction: column;
        align-items: stretch !important;
 }

    .quick-detail-item {
    width: 100%;
    }
}

@media (max-width: 600px) {
    .activity-details-sheet .mud-drawer-content {
        max-height: 85vh;
    }

    .details-sheet-header,
    .details-sheet-content {
        padding: 16px;
    }

        .details-sheet-header .header-stack {
            flex-direction: column;
         align-items: flex-start !important;
 gap: 12px;
   }

    .header-quick-details {
        flex-direction: column;
align-items: stretch !important;
   padding-top: 12px;
    }

 .quick-detail-item {
        width: 100%;
     flex-wrap: wrap;
    }

    .quick-detail-label {
        font-size: 1.2rem;
    }
}

/* Date picker calendar icon positioning */
div.mud-input-adornment.mud-input-adornment-end {
    padding: 5px !important;
    margin-left: -10px !important;
}
/* Search Highlighting - Material Design */
.mud-highlighter mark {
    background-color: #FFF59D; /* Material Yellow 200 */
    color: rgba(0, 0, 0, 0.87);
    font-weight: 500;
    padding: 0 2px;
    border-radius: 2px;
}

/* Flex Utility Classes for Activity Details Sheet */
.flex-1 {
    flex: 1;
    min-height: 0;
}

.flex-auto {
    flex: 1 1 auto;
    min-height: 0;
}
