/* Custom styles for AssociationGroupHubPro */
/* All styles use free/open-source resources */

/* ============================================ */
/* TYPOGRAPHY ADJUSTMENTS */
/* ============================================ */

/* Reduced heading sizes for Inter font */
.mud-typography-h1 {
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

.mud-typography-h2 {
    font-size: 1.875rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

.mud-typography-h3 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

.mud-typography-h4 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

.mud-typography-h5 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
}

.mud-typography-h6 {
    font-size: 1rem !important;
    font-weight: 600 !important;
}

.mud-typography-subtitle1 {
    font-weight: 500 !important;
}

.mud-typography-subtitle2 {
    font-weight: 500 !important;
}

/* Button text - no uppercase */
.mud-button-label {
    text-transform: none !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
}

/* ============================================ */
/* GLOBAL ENHANCEMENTS */
/* ============================================ */

/* Smooth transitions for all interactive elements */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Selection color */
::selection {
    background-color: rgba(232, 93, 4, 0.2);
    color: inherit;
}

/* ============================================ */
/* GRADIENT BUTTONS */
/* ============================================ */

/* Primary filled buttons - gradient with glow */
.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, #E85D04 0%, #F48C06 100%) !important;
    box-shadow: 0 4px 14px rgba(232, 93, 4, 0.25) !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background: linear-gradient(135deg, #D54D00 0%, #E67D00 100%) !important;
    box-shadow: 0 6px 20px rgba(232, 93, 4, 0.35) !important;
    transform: translateY(-1px) !important;
}

.mud-button-filled.mud-button-filled-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.3) !important;
}

/* Dark mode primary buttons - brighter gradient */
.mud-theme-dark .mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, #F48C06 0%, #FFAB40 100%) !important;
    box-shadow: 0 4px 14px rgba(244, 140, 6, 0.3) !important;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-primary:hover {
    background: linear-gradient(135deg, #E67D00 0%, #FF9800 100%) !important;
    box-shadow: 0 6px 20px rgba(244, 140, 6, 0.4) !important;
}

/* Secondary/Info buttons - subtle shadow */
.mud-button-filled.mud-button-filled-secondary,
.mud-button-filled.mud-button-filled-info {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.mud-button-filled.mud-button-filled-secondary:hover,
.mud-button-filled.mud-button-filled-info:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-secondary,
.mud-theme-dark .mud-button-filled.mud-button-filled-info {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-secondary:hover,
.mud-theme-dark .mud-button-filled.mud-button-filled-info:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Success button gradient */
.mud-button-filled.mud-button-filled-success {
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%) !important;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25) !important;
}

.mud-button-filled.mud-button-filled-success:hover {
    background: linear-gradient(135deg, #256628 0%, #43A047 100%) !important;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.35) !important;
    transform: translateY(-1px) !important;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-success {
    background: linear-gradient(135deg, #43A047 0%, #66BB6A 100%) !important;
    box-shadow: 0 4px 14px rgba(67, 160, 71, 0.3) !important;
}

/* Error/Danger button gradient */
.mud-button-filled.mud-button-filled-error {
    background: linear-gradient(135deg, #C62828 0%, #EF5350 100%) !important;
    box-shadow: 0 4px 14px rgba(198, 40, 40, 0.25) !important;
}

.mud-button-filled.mud-button-filled-error:hover {
    background: linear-gradient(135deg, #B71C1C 0%, #E53935 100%) !important;
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.35) !important;
    transform: translateY(-1px) !important;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-error {
    background: linear-gradient(135deg, #E53935 0%, #EF5350 100%) !important;
    box-shadow: 0 4px 14px rgba(229, 57, 53, 0.3) !important;
}

/* Outlined buttons hover effect */
.mud-button-outlined {
    transition: all 0.3s ease !important;
}

.mud-button-outlined:hover {
    transform: translateY(-1px) !important;
}

/* ============================================ */
/* TABLE STYLING */
/* ============================================ */

/* Table container with rounded corners */
.mud-table {
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
}

/* Table header styling */
.mud-table-head {
    background: var(--mud-palette-background-grey) !important;
}

.mud-table-head th {
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--mud-palette-text-secondary) !important;
    border-bottom: 2px solid var(--mud-palette-lines-default) !important;
}

/* Row hover effect */
.mud-table-row:hover {
    background-color: rgba(232, 93, 4, 0.04) !important;
}

.mud-theme-dark .mud-table-row:hover {
    background-color: rgba(244, 140, 6, 0.08) !important;
}

/* Alternating row colors (subtle) */
.mud-table-body .mud-table-row:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.mud-theme-dark .mud-table-body .mud-table-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Table cell padding */
.mud-table-cell {
    padding: 12px 16px !important;
}

/* Remove default table borders, use subtle separators */
.mud-table-cell {
    border-bottom: 1px solid var(--mud-palette-lines-default) !important;
}

/* ============================================ */
/* PAGE HEADER STYLING */
/* ============================================ */

/* Page title with accent underline */
.page-header-title {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.page-header-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--mud-palette-primary) 0%, var(--mud-palette-primary-lighten) 100%);
    border-radius: 2px;
}

/* ListPageHeader component styling */
.list-page-header {
    margin-bottom: 24px;
}

.list-page-header h3,
.list-page-header h5,
.list-page-header .mud-typography-h3,
.list-page-header .mud-typography-h5 {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.list-page-header h3::after,
.list-page-header h5::after,
.list-page-header .mud-typography-h3::after,
.list-page-header .mud-typography-h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--mud-palette-primary) 0%, var(--mud-palette-primary-lighten) 100%);
    border-radius: 2px;
}

/* ============================================ */
/* CARD HOVER EFFECTS */
/* ============================================ */

/* Interactive cards - lift and glow on hover */
.card-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(232, 93, 4, 0.08) !important;
}

.mud-theme-dark .card-interactive:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(244, 140, 6, 0.1) !important;
}

/* Stat cards already have hover, enhance them */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.stat-card:hover {
    transform: translateY(-4px) !important;
}

/* Glass card hover enhancement */
.glass-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Clickable cards with cursor pointer */
.mud-paper[style*="cursor: pointer"]:hover,
.mud-card[style*="cursor: pointer"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* ============================================ */
/* CHIPS & BADGES ENHANCEMENT */
/* ============================================ */

/* Softer chip styling */
.mud-chip {
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
}

/* Success chips */
.mud-chip.mud-chip-filled.mud-success {
    background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%) !important;
}

/* Error chips */
.mud-chip.mud-chip-filled.mud-error {
    background: linear-gradient(135deg, #C62828 0%, #E53935 100%) !important;
}

/* Info chips */
.mud-chip.mud-chip-filled.mud-info {
    background: linear-gradient(135deg, #0277BD 0%, #039BE5 100%) !important;
}

/* Warning chips */
.mud-chip.mud-chip-filled.mud-warning {
    background: linear-gradient(135deg, #F57C00 0%, #FF9800 100%) !important;
}

/* ============================================ */
/* APPBAR STYLING */
/* ============================================ */

/* Light mode AppBar - no border needed with colored AppBar */
.mud-theme-dark .mud-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* ============================================ */
/* DRAWER / NAVIGATION */
/* ============================================ */

/* Light mode: Smooth drawer styling */
.mud-drawer {
    border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Light mode: Active link styling with accent color */
.mud-drawer a[aria-current="page"] {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.12) 0%, rgba(232, 93, 4, 0.06) 100%) !important;
    border-left: 3px solid #E85D04 !important;
    color: #E85D04 !important;
    font-weight: 500 !important;
}

.mud-drawer a[aria-current="page"] .mud-icon-root {
    color: #E85D04 !important;
}

/* Light mode: Hover effect */
.mud-drawer .mud-nav-link:hover:not([aria-current="page"]) {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

/* Dark mode: Drawer border */
.mud-theme-dark .mud-drawer {
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Dark mode: Default gray text */
.mud-theme-dark .mud-drawer .mud-nav-link {
    color: #CFD8DC !important;
}

/* Dark mode: Active links in orange */
.mud-theme-dark .mud-drawer a[aria-current="page"] {
    background: linear-gradient(135deg, rgba(244, 140, 6, 0.15) 0%, rgba(244, 140, 6, 0.08) 100%) !important;
    border-left: 3px solid #F48C06 !important;
    color: #F48C06 !important;
    font-weight: 500 !important;
}

/* Dark mode: Icons gray */
.mud-theme-dark .mud-drawer .mud-icon-root {
    color: #90A4AE !important;
}

/* Dark mode: Active icons orange */
.mud-theme-dark .mud-drawer a[aria-current="page"] .mud-icon-root {
    color: #F48C06 !important;
}

/* Dark mode: Hover effect */
.mud-theme-dark .mud-drawer .mud-nav-link:hover:not([aria-current="page"]) {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

/* ============================================ */
/* CARD ENHANCEMENTS */
/* ============================================ */

/* Cards with better borders and hover effects */
.mud-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.mud-card:hover {
    transform: translateY(-2px);
}

/* Dark mode: Cards need more visible borders and different background */
.mud-theme-dark .mud-card {
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background-color: #252538 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.mud-theme-dark .mud-card:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
    background-color: #2A2A40 !important;
}

/* Clickable cards */
.mud-card[style*="cursor: pointer"]:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.mud-theme-dark .mud-card[style*="cursor: pointer"]:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

/* ============================================ */
/* BUTTON ENHANCEMENTS */
/* ============================================ */

/* Filled buttons with subtle gradient */
.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, #E85D04 0%, #D45203 100%) !important;
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.25) !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background: linear-gradient(135deg, #F48C06 0%, #E85D04 100%) !important;
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.35) !important;
}

/* Dark mode primary buttons */
.mud-theme-dark .mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, #F48C06 0%, #E85D04 100%) !important;
    box-shadow: 0 2px 8px rgba(244, 140, 6, 0.3) !important;
}

.mud-theme-dark .mud-button-filled.mud-button-filled-primary:hover {
    background: linear-gradient(135deg, #FAA307 0%, #F48C06 100%) !important;
    box-shadow: 0 4px 12px rgba(244, 140, 6, 0.4) !important;
}

/* Outlined buttons */
.mud-button-outlined.mud-button-outlined-primary {
    border-width: 1.5px !important;
}

.mud-button-outlined.mud-button-outlined-primary:hover {
    background-color: rgba(232, 93, 4, 0.06) !important;
}

/* ============================================ */
/* CHIP ENHANCEMENTS */
/* ============================================ */

/* Slightly rounded chips */
.mud-chip {
    font-weight: 500 !important;
}

/* Success chip */
.mud-chip.mud-chip-color-success {
    background-color: rgba(46, 125, 50, 0.12) !important;
    color: #2E7D32 !important;
}

.app-dark .mud-chip.mud-chip-color-success {
    background-color: rgba(76, 175, 80, 0.7) !important;
    color: white !important;
}

/* Info chip */
.mud-chip.mud-chip-color-info {
    background-color: rgba(0, 150, 199, 0.12) !important;
    color: #0077B6 !important;
}

.app-dark .mud-chip.mud-chip-color-info {
    background-color: rgba(72, 202, 228, 0.7) !important;
    color: white !important;
}

/* Warning chip - dark mode */
.app-dark .mud-chip.mud-chip-color-warning {
    background-color: rgba(255, 167, 38, 0.7) !important;
    color: white !important;
}

/* Error chip - dark mode */
.app-dark .mud-chip.mud-chip-color-error {
    background-color: rgba(239, 83, 80, 0.7) !important;
    color: white !important;
}

/* Default chip - dark mode */
.app-dark .mud-chip.mud-chip-color-default {
    background-color: rgba(158, 158, 158, 0.5) !important;
    color: white !important;
}

/* Primary chip - dark mode */
.app-dark .mud-chip.mud-chip-color-primary {
    background-color: rgba(66, 165, 245, 0.7) !important;
    color: white !important;
}

/* Secondary chip - dark mode */
.app-dark .mud-chip.mud-chip-color-secondary {
    background-color: rgba(186, 104, 200, 0.7) !important;
    color: white !important;
}

/* Fix MudPagination list bullets (fixed in MudBlazor 8.1.0+, needed for 8.0.0) */
.mud-pagination {
    list-style: none !important;
    padding-left: 0 !important;
}

.mud-pagination li {
    list-style: none !important;
}

/* ============================================ */
/* TABLE ENHANCEMENTS */
/* ============================================ */

/* Better table styling */
.mud-table {
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-theme-dark .mud-table {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Table header */
.mud-table-head .mud-table-cell {
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
}

/* Table row hover */
.mud-table-row:hover {
    background-color: rgba(232, 93, 4, 0.04) !important;
}

.mud-theme-dark .mud-table-row:hover {
    background-color: rgba(244, 140, 6, 0.06) !important;
}

/* ============================================ */
/* INPUT ENHANCEMENTS */
/* ============================================ */

/* Input focus state */
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-width: 2px !important;
}

/* ============================================ */
/* DIALOG ENHANCEMENTS */
/* ============================================ */

/* Dialog backdrop with blur effect */
/* Only apply blur to dialog overlays, not autocomplete/popover overlays */
.mud-dialog-container > .mud-overlay {
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    transition: opacity 0.2s ease-out, backdrop-filter 0.2s ease-out !important;
}

/* Ensure popover overlays (autocomplete, select, etc.) don't have blur */
.mud-popover-provider .mud-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.mud-overlay-dark {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.mud-theme-dark .mud-overlay-dark {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Dialog entrance animation */
@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes dialogSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
}

/* Dialog with animation and better shadow */
.mud-dialog {
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    animation: dialogSlideIn 0.2s ease-out forwards !important;
    transform-origin: center center;
}

.mud-theme-dark .mud-dialog {
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(0, 0, 0, 0.3) !important;
}

/* Dialog content transitions */
.mud-dialog-content {
    transition: opacity 0.15s ease-out !important;
}

/* Dialog title */
.mud-dialog-title {
    font-weight: 600 !important;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    padding-bottom: 12px !important;
}

/* Dialog actions */
.mud-dialog-actions {
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    padding-top: 12px !important;
}

/* ============================================ */
/* PAPER ENHANCEMENTS */
/* ============================================ */

/* Papers with subtle borders */
.mud-paper {
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.mud-theme-dark .mud-paper {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background-color: #1A1A28 !important;
}

/* Elevated paper gets slightly lighter background for hierarchy */
.mud-theme-dark .mud-paper.mud-elevation-1,
.mud-theme-dark .mud-paper.mud-elevation-2,
.mud-theme-dark .mud-paper.mud-elevation-3 {
    background-color: #1E1E2E !important;
}

/* ============================================ */
/* ALERT ENHANCEMENTS */
/* ============================================ */

/* Rounded alerts */
.mud-alert {
    border-radius: 8px !important;
}

/* ============================================ */
/* TABS ENHANCEMENTS */
/* ============================================ */

/* Tab indicator */
.mud-tabs-toolbar .mud-tab-active {
    font-weight: 600 !important;
}

/* ============================================ */
/* PROGRESS INDICATORS */
/* ============================================ */

/* Progress bar styling */
.mud-progress-linear {
    border-radius: 4px !important;
    overflow: hidden;
}

/* ============================================ */
/* AVATAR ENHANCEMENTS */
/* ============================================ */

/* Avatar with subtle border */
.mud-avatar {
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mud-theme-dark .mud-avatar {
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ============================================ */
/* SCROLLBAR STYLING */
/* ============================================ */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.mud-theme-dark ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

.mud-theme-dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ============================================ */
/* DIVIDER ENHANCEMENTS */
/* ============================================ */

/* Subtle dividers */
.mud-divider {
    opacity: 0.6;
}

/* ============================================ */
/* TOOLTIP STYLING */
/* ============================================ */

/* Tooltip entrance animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mud-tooltip {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    animation: tooltipFadeIn 0.15s ease-out forwards !important;
    letter-spacing: 0.01em;
}

/* Light mode tooltip */
.mud-tooltip {
    background-color: #1a1a2e !important;
    color: #ffffff !important;
}

/* Dark mode tooltip - slightly lighter for contrast */
.mud-theme-dark .mud-tooltip {
    background-color: #2d2d3d !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

/* Tooltip arrow styling */
.mud-tooltip-arrow::before {
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.mud-theme-dark .mud-tooltip-arrow::before {
    box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.25) !important;
}

/* MudBlazor 8.0 fix: Hide tooltip/popover arrow artifacts */
.mud-tooltip-arrow,
.mud-tooltip-arrow::before,
.mud-tooltip-arrow::after {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
}

/* Hide popover elements when not open */
.mud-popover:not(.mud-popover-open) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ============================================ */
/* FIX DOUBLE SCROLLBAR IN MUDSELECT DROPDOWNS */
/* ============================================ */

/*
 * MudBlazor adds "overflow-y-auto" CLASS and "max-height: 300px" INLINE STYLE
 * to the popover element. The list inside also scrolls, causing double scrollbar.
 * Solution: Override the popover's overflow-y-auto class to not scroll,
 * and let only the inner list handle scrolling.
 */

/* Override the overflow-y-auto class on popover - make it not scroll */
.mud-popover.overflow-y-auto {
    overflow-y: hidden !important;
    overflow: hidden !important;
}

/* The list inside should be the ONLY scrolling element */
.mud-popover.overflow-y-auto > .mud-list {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
}

/* Scrollbar styling for the list */
.mud-popover.overflow-y-auto > .mud-list::-webkit-scrollbar {
    width: 8px !important;
}

.mud-popover.overflow-y-auto > .mud-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.mud-theme-dark .mud-popover.overflow-y-auto > .mud-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.25);
}

.mud-popover.overflow-y-auto > .mud-list::-webkit-scrollbar-track {
    background-color: transparent;
}

/* ============================================ */
/* SNACKBAR ENHANCEMENTS */
/* ============================================ */

.mud-snackbar {
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================ */
/* NAV GROUP STYLING */
/* ============================================ */

/* Nav group headers */
.mud-nav-group .mud-nav-link {
    font-weight: 500 !important;
}

/* Nested nav items indentation */
.mud-navmenu .mud-nav-group .mud-collapse-container .mud-nav-link {
    padding-left: 2.5rem !important;
}

/* ============================================ */
/* DRAWER SCROLL FIX */
/* ============================================ */

/* Ensure drawer content scrolls when it exceeds viewport height */
.mud-drawer-content {
    overflow-y: auto !important;
    max-height: 100% !important;
}

/* ============================================ */
/* MOBILE OPTIMIZATIONS */
/* ============================================ */

/* Mobile breakpoint (600px and below) */
@media (max-width: 600px) {
    /* Smaller cards on mobile */
    .mud-card {
        margin-bottom: 0.75rem;
    }

    /* Adjust dialog for mobile — near full-width, scrollable content */
    .mud-dialog {
        margin: 0.5rem !important;
        border-radius: 12px !important;
        max-height: calc(100vh - 1rem) !important;
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
    }

    .mud-dialog-content {
        max-height: calc(100vh - 11rem) !important;
        overflow-y: auto !important;
    }

    .mud-dialog-title {
        padding: 12px 16px !important;
    }

    .mud-dialog-actions {
        padding: 8px 16px !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Full-width buttons on mobile */
    .mud-button-root {
        min-height: 44px !important; /* Touch-friendly minimum */
    }

    /* Larger touch targets for icon buttons */
    .mud-icon-button {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Better table responsiveness */
    .mud-table {
        font-size: 0.875rem !important;
    }

    .mud-table-cell {
        padding: 8px 12px !important;
    }

    /* Stack action buttons vertically on mobile */
    .mud-td .mud-stack[style*="row"] {
        flex-wrap: wrap;
        gap: 4px !important;
    }

    /* Page header adjustments */
    .list-page-header {
        margin-bottom: 16px;
    }

    .list-page-header h3,
    .list-page-header .mud-typography-h3 {
        font-size: 1.25rem !important;
    }

    /* Stat cards - compact for 2-per-row on mobile */
    .stat-card {
        padding: 10px !important;
    }

    .stat-card .mud-typography-h5 {
        font-size: 1.15rem !important;
    }

    .stat-card .mud-typography-body2 {
        font-size: 0.7rem !important;
    }

    .stat-card .mud-icon-root.mud-svg-icon-size-large {
        font-size: 1.5rem !important;
        width: 1.5rem;
        height: 1.5rem;
    }

    /* Glass cards - less padding on mobile */
    .glass-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    /* Empty state adjustments */
    .empty-state {
        padding: 32px 16px;
    }

    .empty-state-icon {
        width: 64px;
        height: 64px;
    }

    .empty-state-icon .mud-icon-root {
        font-size: 32px;
    }

    .empty-state-title {
        font-size: 1.1rem;
    }

    .empty-state-description {
        font-size: 0.875rem;
    }

    /* Chip adjustments for mobile */
    .mud-chip {
        font-size: 0.75rem !important;
    }

    /* MudTable responsive card layout - prevent content overflow */
    .mud-table {
        overflow: hidden !important;
    }

    /* Hide MudBlazor's built-in sort select on mobile — touch event conflict
       causes the dropdown to close immediately after opening (mousedown opens,
       synthesized click after touchend toggles it closed). */
    .mud-table-smalldevices-sortselect {
        display: none !important;
    }

    .mud-table-container {
        overflow-x: hidden !important;
    }

    .mud-table-container table,
    .mud-table-container tbody,
    .mud-table-container tr {
        max-width: 100% !important;
    }

    .mud-table-container td.mud-table-cell {
        max-width: 100% !important;
        overflow: hidden !important;
        min-width: 0 !important;
    }

    .mud-table-container td.mud-table-cell::before {
        flex-shrink: 0 !important;
        font-weight: 600 !important;
    }

    /* Background on first cell of each card row to separate items */
    .mud-table-container tr.mud-table-row td.mud-table-cell:first-child {
        background-color: rgba(232, 93, 4, 0.10) !important;
    }

    /* Cells without DataLabel: align content to the left */
    .mud-table-container td.mud-table-cell:not([data-label]) {
        justify-content: flex-start !important;
    }

    .mud-table-container td.mud-table-cell > * {
        min-width: 0;
        flex-shrink: 1;
    }

    .mud-table-container td.mud-table-cell .mud-chip {
        max-width: 100%;
        overflow: hidden;
        flex-shrink: 1;
    }

    .mud-table-container td.mud-table-cell .mud-chip .mud-chip-content {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mud-table-container td.mud-table-cell .mud-stack {
        flex-wrap: wrap;
        min-width: 0;
    }

    .mud-table-container td.mud-table-cell .mud-typography {
        word-break: break-word;
        white-space: normal;
    }

    /* Hide specific table columns on mobile */
    .hide-on-mobile {
        display: none !important;
    }

    /* Form inputs - better touch experience */
    .mud-input-control {
        margin-bottom: 12px;
    }

    /* Pagination footer stacking */
    .pagination-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch !important;
    }

    /* Nav drawer overlay improvements */
    .mud-drawer-overlay {
        backdrop-filter: blur(4px);
    }
}

/* Tablet breakpoint (601px - 959px) */
@media (min-width: 601px) and (max-width: 959px) {
    /* Adjust grid layouts for tablets */
    .mud-grid-item-xs-12.mud-grid-item-sm-6.mud-grid-item-md-4 {
        flex-basis: 50% !important;
        max-width: 50% !important;
    }

    /* Dialog sizing */
    .mud-dialog {
        max-width: 90vw !important;
    }

    /* Table adjustments */
    .mud-table-cell {
        padding: 10px 14px !important;
    }
}

/* Large screen optimizations */
@media (min-width: 1400px) {
    /* Limit content width for readability */
    .page-content-wrapper {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* ============================================ */
/* STAT CARDS WITH COLORED ACCENTS */
/* ============================================ */

/* Base stat card styling */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.stat-card:hover {
    transform: translateY(-4px) !important;
}

/* Stat cards - using MudBlazor CSS variables for automatic dark/light mode */
/* Higher specificity to override MudPaper defaults */
.mud-paper.stat-card,
.stat-card.mud-paper,
.stat-card {
    background: var(--mud-palette-surface) !important;
    background-color: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
}

/* Members card - Orange accent */
.stat-card-members::before {
    background: linear-gradient(180deg, #E85D04 0%, #F48C06 100%);
}
.stat-card-members:hover {
    box-shadow: 0 12px 24px rgba(232, 93, 4, 0.15) !important;
}
.mud-theme-dark .stat-card-members:hover {
    box-shadow: 0 12px 24px rgba(244, 140, 6, 0.2) !important;
}

/* Finance card - Green accent */
.stat-card-finance::before {
    background: linear-gradient(180deg, #2E7D32 0%, #4CAF50 100%);
}
.stat-card-finance:hover {
    box-shadow: 0 12px 24px rgba(46, 125, 50, 0.15) !important;
}
.mud-theme-dark .stat-card-finance:hover {
    box-shadow: 0 12px 24px rgba(76, 175, 80, 0.2) !important;
}

/* Events card - Blue accent */
.stat-card-events::before {
    background: linear-gradient(180deg, #0077B6 0%, #00B4D8 100%);
}
.stat-card-events:hover {
    box-shadow: 0 12px 24px rgba(0, 119, 182, 0.15) !important;
}
.mud-theme-dark .stat-card-events:hover {
    box-shadow: 0 12px 24px rgba(0, 180, 216, 0.2) !important;
}

/* Users card - Purple accent */
.stat-card-users::before {
    background: linear-gradient(180deg, #7B1FA2 0%, #AB47BC 100%);
}
.stat-card-users:hover {
    box-shadow: 0 12px 24px rgba(123, 31, 162, 0.15) !important;
}
.mud-theme-dark .stat-card-users:hover {
    box-shadow: 0 12px 24px rgba(171, 71, 188, 0.2) !important;
}

/* Info/Update card - Cyan accent */
.stat-card-info::before {
    background: linear-gradient(180deg, #0288D1 0%, #03A9F4 100%);
}
.stat-card-info:hover {
    box-shadow: 0 12px 24px rgba(2, 136, 209, 0.15) !important;
}
.mud-theme-dark .stat-card-info:hover {
    box-shadow: 0 12px 24px rgba(3, 169, 244, 0.2) !important;
}

/* Warning card - Amber accent */
.stat-card-warning::before {
    background: linear-gradient(180deg, #F9A825 0%, #FFC107 100%);
}
.stat-card-warning:hover {
    box-shadow: 0 12px 24px rgba(249, 168, 37, 0.15) !important;
}
.mud-theme-dark .stat-card-warning:hover {
    box-shadow: 0 12px 24px rgba(255, 193, 7, 0.2) !important;
}

/* Access card - Amber/Orange accent */
.stat-card-access::before {
    background: linear-gradient(180deg, #E65100 0%, #FF9800 100%);
}
.stat-card-access:hover {
    box-shadow: 0 12px 24px rgba(230, 81, 0, 0.15) !important;
}
.mud-theme-dark .stat-card-access:hover {
    box-shadow: 0 12px 24px rgba(255, 152, 0, 0.2) !important;
}

/* ============================================ */
/* GLASSMORPHISM EFFECTS */
/* ============================================ */

/* Glass card for main content areas - using MudBlazor CSS variables */
/* Higher specificity to override MudPaper defaults */
.mud-paper.glass-card,
.glass-card.mud-paper,
.glass-card {
    background: var(--mud-palette-surface) !important;
    background-color: var(--mud-palette-surface) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--mud-palette-lines-default) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08) !important;
}

.mud-paper.glass-card:hover,
.glass-card.mud-paper:hover,
.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Glass card header accent line */
.glass-card-header {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.glass-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(232, 93, 4, 0.5) 0%, rgba(232, 93, 4, 0) 100%);
}

.mud-theme-dark .glass-card-header::after {
    background: linear-gradient(90deg, rgba(244, 140, 6, 0.5) 0%, rgba(244, 140, 6, 0) 100%);
}

/* ============================================ */
/* DASHBOARD ACTIVITY CARDS */
/* ============================================ */

/* Activity/Pending cards with subtle styling - using MudBlazor CSS variables */
/* Higher specificity to override MudPaper defaults */
.mud-paper.activity-card,
.activity-card.mud-paper,
.activity-card {
    border-radius: 12px !important;
    position: relative;
    overflow: hidden;
    background: var(--mud-palette-surface) !important;
    background-color: var(--mud-palette-surface) !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
}

.activity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mud-palette-primary) 0%, var(--mud-palette-primary-lighten) 50%, var(--mud-palette-tertiary) 100%);
}

/* ============================================ */
/* SKELETON LOADING ANIMATIONS */
/* ============================================ */

/* Base skeleton styling */
.skeleton {
    background: linear-gradient(90deg,
        var(--mud-palette-background-grey) 25%,
        var(--mud-palette-surface) 50%,
        var(--mud-palette-background-grey) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton variants */
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-text-lg {
    height: 20px;
}

.skeleton-title {
    height: 24px;
    width: 40%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 4px;
}

.skeleton-chip {
    height: 24px;
    width: 60px;
    border-radius: 12px;
}

.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* Table row skeleton */
.skeleton-table-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.skeleton-table-cell {
    flex: 1;
}

/* Card skeleton */
.skeleton-card {
    padding: 16px;
    border-radius: 12px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

/* Stat card skeleton */
.skeleton-stat-card {
    height: 100px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.skeleton-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--mud-palette-lines-default);
}

/* ============================================ */
/* EMPTY STATE STYLING */
/* ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mud-palette-primary-lighten) 0%, var(--mud-palette-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    opacity: 0.8;
}

.empty-state-icon .mud-icon-root {
    font-size: 40px;
    color: white;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 0.95rem;
    color: var(--mud-palette-text-secondary);
    max-width: 400px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Subtle empty state variant */
.empty-state-subtle {
    padding: 32px 16px;
}

.empty-state-subtle .empty-state-icon {
    width: 56px;
    height: 56px;
    background: var(--mud-palette-background-grey);
    margin-bottom: 16px;
}

.empty-state-subtle .empty-state-icon .mud-icon-root {
    font-size: 28px;
    color: var(--mud-palette-text-secondary);
}

.empty-state-subtle .empty-state-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.empty-state-subtle .empty-state-description {
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* ============================================ */
/* PAGE TRANSITIONS */
/* ============================================ */

/* Page content fade-in animation */
@keyframes pageContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main content area with smooth transitions */
.mud-main-content {
    animation: pageContentFadeIn 0.3s ease-out forwards;
}

/* Page content wrapper for route transitions */
.page-content,
article,
.mud-main-content > .mud-container,
.mud-main-content > div:first-child {
    animation: pageContentFadeIn 0.25s ease-out forwards;
}

/* Staggered animation for page sections */
.page-header {
    animation: pageContentFadeIn 0.25s ease-out forwards;
}

.page-body,
.page-content > .mud-stack,
.page-content > .mud-grid {
    animation: pageContentFadeIn 0.3s ease-out 0.05s forwards;
    opacity: 0;
}

/* Glass cards with staggered entrance */
.glass-card {
    animation: pageContentFadeIn 0.3s ease-out forwards;
}

/* Stat cards staggered animation */
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

/* Table rows fade in */
@keyframes tableRowFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mud-table-body .mud-table-row {
    animation: tableRowFadeIn 0.2s ease-out forwards;
}

/* Stagger table rows slightly */
.mud-table-body .mud-table-row:nth-child(1) { animation-delay: 0s; }
.mud-table-body .mud-table-row:nth-child(2) { animation-delay: 0.02s; }
.mud-table-body .mud-table-row:nth-child(3) { animation-delay: 0.04s; }
.mud-table-body .mud-table-row:nth-child(4) { animation-delay: 0.06s; }
.mud-table-body .mud-table-row:nth-child(5) { animation-delay: 0.08s; }
.mud-table-body .mud-table-row:nth-child(n+6) { animation-delay: 0.1s; }

/* Card list staggered animation */
.mud-grid > .mud-grid-item:nth-child(1) { animation-delay: 0s; }
.mud-grid > .mud-grid-item:nth-child(2) { animation-delay: 0.03s; }
.mud-grid > .mud-grid-item:nth-child(3) { animation-delay: 0.06s; }
.mud-grid > .mud-grid-item:nth-child(4) { animation-delay: 0.09s; }
.mud-grid > .mud-grid-item:nth-child(5) { animation-delay: 0.12s; }
.mud-grid > .mud-grid-item:nth-child(6) { animation-delay: 0.15s; }
.mud-grid > .mud-grid-item:nth-child(n+7) { animation-delay: 0.18s; }

.mud-grid > .mud-grid-item {
    animation: pageContentFadeIn 0.25s ease-out forwards;
    opacity: 0;
}

/* Smooth tab panel transitions */
.mud-tabs-panels {
    transition: opacity 0.2s ease-out;
}

.mud-tabpanel {
    animation: pageContentFadeIn 0.2s ease-out forwards;
}

/* ============================================ */
/* ACCESSIBILITY IMPROVEMENTS */
/* ============================================ */

/* Skip to main content link - visible on focus */
.skip-to-content {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 24px;
    background: var(--mud-palette-primary);
    color: white;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: 0;
    outline: none;
}

/* Enhanced focus indicators for keyboard navigation */
/* Note: MudBlazor inputs already have their own focus styling */

/* Button focus states */
.mud-button-root:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(232, 93, 4, 0.25) !important;
}

.mud-theme-dark .mud-button-root:focus-visible {
    box-shadow: 0 0 0 4px rgba(244, 140, 6, 0.3) !important;
}

/* Icon button focus */
.mud-icon-button:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
    border-radius: 50% !important;
    background-color: rgba(232, 93, 4, 0.1) !important;
}

.mud-theme-dark .mud-icon-button:focus-visible {
    background-color: rgba(244, 140, 6, 0.15) !important;
}

/* Input focus states */
.mud-input-control:focus-within {
    outline: none !important;
}

.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--mud-palette-primary) !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15) !important;
}

.mud-theme-dark .mud-input-outlined:focus-within .mud-input-outlined-border {
    box-shadow: 0 0 0 3px rgba(244, 140, 6, 0.2) !important;
}

/* Link focus states */
a:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}

/* Nav link focus */
.mud-nav-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: -2px !important;
    background-color: rgba(232, 93, 4, 0.1) !important;
}

/* Table row focus for keyboard navigation */
.mud-table-row:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: -2px !important;
    background-color: rgba(232, 93, 4, 0.08) !important;
}

/* Chip focus */
.mud-chip:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
}

/* Select focus */
.mud-select:focus-visible .mud-input-outlined-border {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15) !important;
}

/* Card focus for interactive cards */
.mud-card:focus-visible,
.mud-paper:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
}

/* Dialog focus trap indicator */
.mud-dialog:focus-visible {
    outline: none !important;
}

/* Tab focus */
.mud-tab:focus-visible {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: -2px !important;
    background-color: rgba(232, 93, 4, 0.1) !important;
}

/* Checkbox and radio focus */
.mud-checkbox:focus-visible .mud-icon-root,
.mud-radio:focus-visible .mud-icon-root {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}

/* Switch focus */
.mud-switch:focus-visible .mud-switch-track {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
}

/* Screen reader only utility class */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Make visually hidden content visible on focus */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Disable skeleton shimmer animation */
    .skeleton {
        animation: none !important;
        background: var(--mud-palette-background-grey) !important;
    }

    /* Disable hover transforms */
    .mud-card:hover,
    .stat-card:hover,
    .glass-card:hover,
    .card-interactive:hover,
    .mud-button-root:hover {
        transform: none !important;
    }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    /* Stronger borders */
    .mud-card,
    .mud-paper,
    .mud-table,
    .glass-card,
    .stat-card {
        border-width: 2px !important;
    }

    /* Stronger focus indicators for buttons and links */
    .mud-button-root:focus-visible,
    .mud-icon-button:focus-visible,
    a:focus-visible {
        outline-width: 3px !important;
        outline-offset: 3px !important;
    }

    /* More visible text */
    .mud-typography,
    .mud-text {
        font-weight: 500;
    }
}

/* Ensure interactive elements are properly announced */
[role="button"],
[role="link"],
[role="tab"],
[role="menuitem"] {
    cursor: pointer;
}

/* Loading state announcement for screen readers */
[aria-busy="true"] {
    cursor: wait;
}

/* Disabled state styling */
[aria-disabled="true"],
[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================ */
/* PRINT STYLES */
/* ============================================ */

@media print {
    .mud-appbar,
    .mud-drawer,
    .mud-button {
        display: none !important;
    }

    .mud-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    /* Ensure good contrast for printing */
    * {
        color: #000 !important;
        background: #fff !important;
    }

    /* Show link URLs in print */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ============================================ */
/* MODULE CARDS (Organization Settings)         */
/* ============================================ */

.module-card {
    border: 1px solid var(--mud-palette-lines-default) !important;
    border-radius: var(--mud-default-borderradius) !important;
    background: var(--mud-palette-surface) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.module-card:hover {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.app-dark .module-card {
    background: rgba(255, 255, 255, 0.04) !important;
}

.app-dark .module-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
