﻿/* ==========================================================================
   QDeskPro - Modern Design System
   A stunning, professional UI for quarry management
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
    /* === OBSIDIAN & AMBER DESIGN SYSTEM === */

    /* Primary Colors — Amber/Gold */
    --primary: #d97706;
    --primary-light: #fbbf24;
    --primary-dark: #92400e;
    --primary-rgb: 217, 119, 6;

    /* Secondary Colors — Slate Indigo */
    --secondary: #6366f1;
    --secondary-light: #818cf8;
    --secondary-dark: #4338ca;

    /* Obsidian Chrome (sidebar, appbar) */
    --obsidian: #0c4a4a;
    --obsidian-light: #125e5e;
    --obsidian-mid: #1a7a7a;

    /* Accent / Semantic Colors */
    --accent-success: #059669;
    --accent-warning: #ea580c;
    --accent-error: #e11d48;
    --accent-info: #0ea5e9;
    --accent-purple: #6366f1;
    --accent-teal: #0d9488;

    /* Neutral / Surface Colors */
    --surface: #ffffff;
    --background: #f8fafc;
    --background-alt: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0c4a4a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows — neutral (no blue tint) */
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.06);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
    --shadow-lg: 0 8px 24px rgba(15,23,42,0.10);
    --shadow-xl: 0 16px 48px rgba(15,23,42,0.12);
    --shadow-primary: 0 8px 24px rgba(217,119,6,0.25);
    --shadow-success: 0 6px 20px rgba(5,150,105,0.20);
    --shadow-warning: 0 6px 20px rgba(234,88,12,0.20);
    --shadow-error: 0 6px 20px rgba(225,29,72,0.20);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Typography — Outfit + DM Mono */
    --font-family: 'Outfit', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'DM Mono', 'Consolas', 'Monaco', monospace;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(217, 119, 6, 0.18);
    color: var(--primary-dark);
}

/* Numeric data uses DM Mono for clean tabular alignment */
.data-number,
.stat-value,
.metric-value,
.amount-display,
.clerk-stat-value,
.clerk-metric-value {
    font-family: var(--font-mono);
    font-feature-settings: 'tnum' 1;
}

/* Amber focus ring — replaces default blue on MudBlazor inputs */
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
}

.mud-input-underline:after {
    border-bottom-color: var(--primary) !important;
}

/* MudBlazor table row hover — amber tint */
.mud-table-row:hover td {
    background-color: rgba(217, 119, 6, 0.04) !important;
}

/* MudBlazor nav link global hover */
.mud-nav-link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Scrollbar theming for dark sidebar panels */
.qdp-drawer ::-webkit-scrollbar-thumb,
.qdp-notes-panel ::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 6, 0.3);
    border-radius: 4px;
}

.qdp-drawer ::-webkit-scrollbar-track,
.qdp-notes-panel ::-webkit-scrollbar-track {
    background: transparent;
}

/* ==========================================================================
   Global Animations
   ========================================================================== */

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Right Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Left Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Subtle Pulse Animation */
@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Shimmer Animation (for loading states) */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Spin Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-15px);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-8px);
    }
    90% {
        transform: translateY(-3px);
    }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(25, 118, 210, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(25, 118, 210, 0.5);
    }
}

/* ==========================================================================
   Animation Utility Classes
   ========================================================================== */
.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Staggered Animation Delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ==========================================================================
   Enhanced MudBlazor Component Overrides
   ========================================================================== */

/* ==========================================================================
   MudDatePicker - Dialog Z-Index Fix
   ========================================================================== */

/*
 * MudBlazor v8.8.0 handles 6-row month calendars natively
 * (min-height: 216px on .mud-picker-calendar-transition).
 *
 * The only custom fix needed is z-index layering for date pickers
 * rendered inside MudDialog overlays, so the picker popover
 * appears above the dialog backdrop.
 */

/* Date picker inside dialogs - needs higher z-index */
/* MudBlazor Dialog overlay is ~1300, dialog content ~1400 */
/* Popover must be above the dialog overlay to be visible */
.datepicker-above-dialog.mud-popover,
.datepicker-above-dialog.mud-popover-open,
.mud-popover.datepicker-above-dialog {
    z-index: 2147483647 !important;
}

.datepicker-above-dialog .mud-popover-paper,
.datepicker-above-dialog .mud-picker,
.datepicker-above-dialog .mud-picker-inline-paper {
    z-index: 2147483647 !important;
}

.datepicker-above-dialog,
.mud-popover-cascading-value .datepicker-above-dialog,
[class*="datepicker-above-dialog"] {
    z-index: 2147483647 !important;
}

/* Cards */
.mud-paper {
    transition: all var(--transition-normal);
}

.mud-card {
    border-radius: var(--radius-lg) !important;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.mud-card:hover {
    transform: translateY(-2px);
}

/* Buttons */
.mud-button-root {
    transition: all var(--transition-fast) !important;
    font-weight: 500 !important;
}

.mud-button-filled:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.mud-button-filled:active {
    transform: translateY(0);
}

.mud-fab {
    transition: all var(--transition-normal) !important;
}

.mud-fab:hover {
    transform: scale(1.1);
}

/* Text Fields */
.mud-input-outlined .mud-input-outlined-border {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.mud-input-outlined:focus-within .mud-input-outlined-border {
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

/* Chips */
.mud-chip {
    transition: all var(--transition-fast);
}

.mud-chip:hover {
    transform: translateY(-1px);
}

/* Avatars */
.mud-avatar {
    transition: transform var(--transition-fast);
}

.mud-avatar:hover {
    transform: scale(1.05);
}

/* Navigation */
.mud-nav-link {
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    margin: 2px 8px;
}

.mud-nav-link:hover {
    background: rgba(25, 118, 210, 0.08) !important;
}

.mud-nav-link.active {
    background: rgba(25, 118, 210, 0.12) !important;
}

/* Tables */
.mud-table-row {
    transition: background-color var(--transition-fast);
}

.mud-table-row:hover {
    background-color: rgba(25, 118, 210, 0.04) !important;
}

/* Alerts */
.mud-alert {
    border-radius: var(--radius-md) !important;
    animation: fadeInUp 0.4s ease;
}

/* Dialogs */
.mud-dialog {
    border-radius: var(--radius-xl) !important;
    animation: scaleIn 0.3s ease;
}

/* ===== Dialog and Overlay Z-Index Layering ===== */
/* Ensure proper z-index stacking for dialogs and their overlays */
/* so that date pickers with .datepicker-above-dialog can appear on top */
.mud-overlay {
    z-index: 1300 !important;
}

.mud-dialog-container {
    z-index: 1350 !important;
}

.mud-dialog {
    z-index: 1400 !important;
}

/* Popover provider should be at highest level to support dialogs */
.mud-popover-provider {
    z-index: 1500 !important;
}

/* Date picker popovers inside dialogs need to be above the dialog overlay */
/* This ensures datepicker-above-dialog class works correctly */
.mud-popover.mud-popover-open {
    z-index: 1600 !important;
}

/* Override for date pickers specifically marked to appear above dialogs */
.mud-popover.datepicker-above-dialog,
.datepicker-above-dialog.mud-popover-open {
    z-index: 2147483647 !important;
}

/* Snackbars */
.mud-snackbar {
    border-radius: var(--radius-md) !important;
    animation: slideInRight 0.4s ease;
}

/* Skeleton Loading */
.mud-skeleton {
    background: linear-gradient(
        90deg,
        var(--border-light) 25%,
        var(--background) 50%,
        var(--border-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ==========================================================================
   MudBlazor Layout Overrides - Fix drawer/content gap
   ========================================================================== */

/* Remove gap between drawer and main content */
.mud-layout {
    gap: 0 !important;
}

.mud-layout-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Main content should have no left padding/margin */
.mud-main-content {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Drawer should not create visual gap */
.mud-drawer {
    box-shadow: none !important;
}

/* Ensure drawer container doesn't add spacing */
.mud-drawer-container {
    margin-right: 0 !important;
    padding-right: 0 !important;
}

/* Fix for responsive drawer in all states */
.mud-drawer-responsive ~ .mud-main-content,
.mud-drawer--open ~ .mud-main-content,
.mud-drawer--closed ~ .mud-main-content {
    padding-left: 0 !important;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Clerk Container */
.clerk-container {
    padding: var(--spacing-md);
    max-width: 100%;
    animation: fadeIn 0.4s ease;
}

@media (min-width: 600px) {
    .clerk-container {
        padding: var(--spacing-lg);
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (min-width: 960px) {
    .clerk-container {
        padding: var(--spacing-xl);
        max-width: 800px;
    }
}

/* Manager Container */
.manager-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    animation: fadeIn 0.4s ease;
}

/* Page Transitions */
.page-enter {
    animation: fadeInUp 0.4s ease forwards;
}

/* ==========================================================================
   Custom Components
   ========================================================================== */

/* Touch-friendly targets */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    padding: var(--spacing-md);
}

/* Summary Card */
.summary-card {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

/* Metric Card */
.metric-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

/* Highlight unpaid orders */
.unpaid-row {
    background-color: rgba(244, 67, 54, 0.08) !important;
    border-left: 3px solid var(--accent-error);
}

/* Highlight flagged records (records with audit findings) */
.flagged-row {
    background-color: rgba(255, 152, 0, 0.12) !important;
    border-left: 3px solid var(--accent-warning);
}

.flagged-row:hover {
    background-color: rgba(255, 152, 0, 0.18) !important;
}

/* Floating action button positioning */
.fab-container {
    position: fixed;
    bottom: 80px;
    right: var(--spacing-md);
    z-index: 100;
}

/* Gradient Icon Box */
.icon-box {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-normal);
}

.icon-box:hover {
    transform: scale(1.05);
}

.icon-box-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-primary);
}

.icon-box-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #388E3C 100%);
    box-shadow: var(--shadow-success);
}

.icon-box-warning {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #F57C00 100%);
    box-shadow: var(--shadow-warning);
}

.icon-box-error {
    background: linear-gradient(135deg, var(--accent-error) 0%, #D32F2F 100%);
    box-shadow: var(--shadow-error);
}

.icon-box-purple {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6A1B9A 100%);
    box-shadow: 0 6px 20px rgba(123, 31, 162, 0.25);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   PWA-specific Styles
   ========================================================================== */

/* Hide install prompt when app is installed */
@media all and (display-mode: standalone) {
    .install-prompt {
        display: none !important;
    }
}

/* Safe area insets for notched devices */
.main-layout {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Bottom navigation should respect safe area */
.bottom-nav {
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
}

/* Prevent pull-to-refresh on mobile (when not needed) */
body.no-pull-refresh {
    overscroll-behavior-y: contain;
}

/* ==========================================================================
   Blazor Framework Styles
   ========================================================================== */

/* Blazor reconnect UI */
#blazor-error-ui {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid var(--accent-warning);
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-warning);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

#blazor-error-ui .dismiss:hover {
    background: #F57C00;
    transform: translateY(-50%) scale(1.1);
}

/* Loading spinner */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-progress circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--background);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Text Colors */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--accent-success) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-error { color: var(--accent-error) !important; }

/* Font Weights */
.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-medium { font-weight: 500 !important; }
.font-weight-semibold { font-weight: 600 !important; }
.font-weight-bold { font-weight: 700 !important; }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-none { box-shadow: none !important; }

/* Transitions */
.transition-fast { transition: all var(--transition-fast) !important; }
.transition-normal { transition: all var(--transition-normal) !important; }
.transition-slow { transition: all var(--transition-slow) !important; }

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(25, 118, 210, 0.3);
}

/* Chart container */
.chart-container {
    position: relative;
    min-height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Divider with text */
.divider-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-alt);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus Visible Styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .mud-paper {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Preparation (for future) */
@media (prefers-color-scheme: dark) {
    /* Will be enabled when dark mode is implemented */
    /* :root {
        --surface: #1E1E1E;
        --background: #121212;
        --text-primary: #FFFFFF;
        --text-secondary: #B0B0B0;
        --border: #333333;
    } */
}

/* ==========================================================================
   AI Chat Rich Content Styles
   ========================================================================== */

/* Markdown Content */
.ai-markdown-content {
    line-height: 1.6;
}

.ai-markdown-content p {
    margin-bottom: 0.75rem;
}

.ai-markdown-content p:last-child {
    margin-bottom: 0;
}

.ai-markdown-content ul,
.ai-markdown-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.ai-markdown-content li {
    margin-bottom: 0.25rem;
}

.ai-markdown-content a {
    color: var(--primary);
    text-decoration: underline;
}

.ai-markdown-content a:hover {
    color: var(--primary-dark);
}

.ai-markdown-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.ai-markdown-content pre {
    background: #f5f7fa;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.ai-markdown-content pre code {
    background: none;
    padding: 0;
}

.ai-markdown-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: var(--text-secondary);
}

.ai-markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
}

.ai-markdown-content th,
.ai-markdown-content td {
    border: 1px solid var(--border);
    padding: 0.5rem;
    text-align: left;
}

.ai-markdown-content th {
    background: var(--background-alt);
    font-weight: 600;
}

/* Chart Container in Chat */
.ai-chat-chart-container {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
}

.ai-chat-chart-container canvas {
    max-width: 100%;
}

.chart-export-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.ai-chat-chart-container:hover .chart-export-btn {
    opacity: 1;
}

/* Data Table in Chat */
.ai-chat-table-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    margin: var(--spacing-sm) 0;
}

.ai-chat-table-container .mud-table {
    background: transparent;
}

.ai-chat-table-container .mud-table-head th {
    background: var(--background-alt);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.625rem 0.75rem;
}

.ai-chat-table-container .mud-table-body td {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.ai-chat-table-container .table-export-row {
    background: var(--background-alt);
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Table row for unpaid orders */
.ai-chat-table-container tr.unpaid-row {
    background-color: rgba(244, 67, 54, 0.06) !important;
}

.ai-chat-table-container tr.unpaid-row:hover {
    background-color: rgba(244, 67, 54, 0.1) !important;
}

/* Totals row */
.ai-chat-table-container tr.totals-row {
    background-color: var(--background-alt);
    font-weight: 600;
}

.ai-chat-table-container tr.totals-row td {
    border-top: 2px solid var(--border);
}

/* Chart + Table Combo Layout */
.combo-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin: var(--spacing-sm) 0;
}

/* Code Block in Chat */
.code-block-wrapper {
    background: #1e1e1e;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: var(--spacing-sm) 0;
}

.code-header {
    background: #2d2d2d;
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid #3d3d3d;
}

.code-language {
    color: #999;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
}

.copy-code-btn {
    color: #999 !important;
}

.copy-code-btn:hover {
    color: #fff !important;
}

.code-content {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #d4d4d4;
}

.code-content code {
    background: transparent;
    padding: 0;
    font-family: inherit;
}

/* Collapsible Section in Chat */
.collapsible-section {
    margin: var(--spacing-sm) 0;
}

.collapsible-section .mud-expansion-panel {
    background: var(--background-alt);
    border-radius: var(--radius-sm) !important;
}

.collapsible-section .mud-expansion-panel-header {
    padding: 0.5rem 0.75rem;
    min-height: 40px;
}

.collapsible-section .mud-expansion-panel-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.collapsible-section .mud-expansion-panel-content {
    padding: 0.75rem;
    padding-top: 0;
}

/* Streaming Cursor Animation */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.streaming-cursor {
    display: inline-block;
    margin-left: 2px;
    animation: blink 1s infinite;
    color: var(--primary);
    font-weight: bold;
}

/* Tool Execution Indicator */
.tool-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(25, 118, 210, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--primary);
}

/* Chart and Table responsive adjustments */
@media (max-width: 959px) {
    .combo-container .mud-grid-item {
        padding: 8px !important;
    }

    .ai-chat-chart-container {
        height: 200px !important;
    }
}

/* Assistant message bubble width adjustment for rich content */
.assistant-message .message-bubble {
    max-width: 90%;
}

@media (min-width: 960px) {
    .assistant-message .message-bubble {
        max-width: 85%;
    }
}

/* Summary cards in chat */
.ai-summary-card {
    background: linear-gradient(135deg, var(--background-alt) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-sm) 0;
}

.ai-summary-card .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px dashed var(--border-light);
}

.ai-summary-card .summary-item:last-child {
    border-bottom: none;
}

.ai-summary-card .summary-item.total {
    font-weight: 600;
    border-top: 2px solid var(--border);
    border-bottom: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

/* ==========================================================================
   Admin & Master Data Pages Styling
   Modern styling for User Management, Quarries, Products, Layers, Brokers, Prices
   ========================================================================== */

/* Admin Page Header - Gradient style similar to ROI/Analytics pages */
.admin-header {
    background: linear-gradient(135deg, rgba(12, 74, 74, 0.08) 0%, rgba(18, 94, 94, 0.05) 100%);
    padding: 24px;
    border-radius: 16px;
    border-left: 4px solid #0c4a4a;
    margin-bottom: 8px;
}

.admin-header-title {
    background: linear-gradient(135deg, #0c4a4a, #125e5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    font-weight: 700;
}

.admin-header-title .mud-icon-root {
    -webkit-text-fill-color: #0c4a4a;
}

/* Admin Action Button */
.admin-action-btn {
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(12, 74, 74, 0.35) !important;
}

/* Admin Filter/Action Card */
.admin-filter-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 20px;
}

/* Admin Stats Row */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 16px 0;
}

@media (max-width: 1280px) {
    .admin-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-stats-row {
        grid-template-columns: 1fr;
    }
}

/* Admin Stat Card - Clean modern card with colored top border */
.admin-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out forwards;
}

.admin-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.admin-stat-card-primary { border-top: 4px solid var(--primary); }
.admin-stat-card-success { border-top: 4px solid var(--accent-success); }
.admin-stat-card-warning { border-top: 4px solid var(--accent-warning); }
.admin-stat-card-error { border-top: 4px solid var(--accent-error); }
.admin-stat-card-info { border-top: 4px solid var(--accent-info); }
.admin-stat-card-purple { border-top: 4px solid var(--accent-purple); }

/* Admin Stat Icon Container */
.admin-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-stat-icon .mud-icon-root {
    color: white !important;
}

.admin-stat-icon-primary { background: linear-gradient(135deg, #0c4a4a, #125e5e); }
.admin-stat-icon-success { background: linear-gradient(135deg, #4CAF50, #388E3C); }
.admin-stat-icon-warning { background: linear-gradient(135deg, #FF9800, #F57C00); }
.admin-stat-icon-error { background: linear-gradient(135deg, #F44336, #D32F2F); }
.admin-stat-icon-info { background: linear-gradient(135deg, #125e5e, #0c4a4a); }
.admin-stat-icon-purple { background: linear-gradient(135deg, #9C27B0, #7B1FA2); }

.admin-stat-content {
    flex: 1;
    min-width: 0;
}

.admin-stat-label {
    color: #64748B;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.7rem !important;
    margin-bottom: 4px;
}

.admin-stat-value {
    font-weight: 700 !important;
    font-size: 1.5rem;
    color: #125e5e;
    line-height: 1.2;
}

.admin-stat-subtext {
    color: #94A3B8;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Admin Mini Stat Cards - Gradient background style */
.admin-mini-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 16px 0;
}

@media (max-width: 960px) {
    .admin-mini-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-mini-stats-row {
        grid-template-columns: 1fr;
    }
}

.admin-mini-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.5s ease-out forwards;
}

.admin-mini-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.admin-mini-stat-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.admin-mini-stat-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.admin-mini-stat-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.admin-mini-stat-gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.admin-mini-stat-gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.admin-mini-stat-gradient-6 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }

.admin-mini-stat-icon {
    opacity: 0.9;
}

.admin-mini-stat-content {
    display: flex;
    flex-direction: column;
}

.admin-mini-stat-value {
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.2;
}

.admin-mini-stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Admin Table Card - Enhanced table container */
.admin-table-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out forwards;
}

.admin-table-card .mud-table {
    background: transparent;
}

.admin-table-card .mud-table-head th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: #64748B;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-table-card .mud-table-body td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.admin-table-card .mud-table-row:hover {
    background-color: rgba(25, 118, 210, 0.04) !important;
}

/* Admin Section Header */
.admin-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.admin-section-title {
    font-weight: 700;
    color: #125e5e;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Admin Info Card */
.admin-info-card {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 1px solid rgba(25, 118, 210, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
}

/* Admin Warning Card */
.admin-warning-card {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
}

/* Admin Success Card */
.admin-success-card {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
}

/* Empty State Card */
.admin-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

.admin-empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(12, 74, 74, 0.1) 0%, rgba(18, 94, 94, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.admin-empty-state-icon .mud-icon-root {
    color: var(--primary);
    font-size: 2.5rem;
}

/* Admin Dialog Styling */
.admin-dialog {
    border-radius: 20px !important;
}

.admin-dialog .mud-dialog-title {
    background: linear-gradient(135deg, rgba(12, 74, 74, 0.08) 0%, rgba(18, 94, 94, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px 24px;
}

.admin-dialog .mud-dialog-content {
    padding: 24px;
}

.admin-dialog .mud-dialog-actions {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Unassigned Users Section */
.unassigned-users-section {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.06) 0%, rgba(255, 193, 7, 0.04) 100%);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    animation: fadeInUp 0.5s ease-out forwards;
}

.unassigned-users-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 152, 0, 0.2);
    margin-bottom: 16px;
}

/* Quarry Owner Badge */
.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(12, 74, 74, 0.1) 0%, rgba(18, 94, 94, 0.06) 100%);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #0c4a4a;
}

/* Secondary Manager Badge */
.secondary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #EDE7F6 0%, #D1C4E9 100%);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #5E35B1;
}

/* Admin Action Icon Buttons */
.admin-action-icon {
    transition: all 0.2s ease;
}

.admin-action-icon:hover {
    transform: scale(1.15);
}

/* Fee Configuration Card */
.fee-config-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 16px;
}

.fee-config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.fee-config-row:last-child {
    border-bottom: none;
}

.fee-config-label {
    color: #64748B;
    font-weight: 500;
}

.fee-config-value {
    font-weight: 600;
    color: #125e5e;
}

/* Master Data Page Header Variants — all unified to teal */
.admin-header-users,
.admin-header-quarries,
.admin-header-products,
.admin-header-layers,
.admin-header-brokers,
.admin-header-prices,
.admin-header-data,
.admin-header-production,
.admin-header-expenses {
    background: linear-gradient(135deg, rgba(12, 74, 74, 0.08) 0%, rgba(18, 94, 94, 0.05) 100%);
    border-left: 4px solid #0c4a4a;
}

.admin-header-users .admin-header-title,
.admin-header-quarries .admin-header-title,
.admin-header-products .admin-header-title,
.admin-header-layers .admin-header-title,
.admin-header-brokers .admin-header-title,
.admin-header-prices .admin-header-title,
.admin-header-data .admin-header-title,
.admin-header-production .admin-header-title,
.admin-header-expenses .admin-header-title {
    background: linear-gradient(135deg, #0c4a4a, #125e5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dashboard Chart Cards */
.dashboard-chart-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 20px;
    animation: fadeInUp 0.5s ease-out forwards;
}

.dashboard-chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* Dashboard Filter Card */
.dashboard-filter-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 20px;
}

/* Staggered animation delays for stats */
.admin-stat-card:nth-child(1) { animation-delay: 0.1s; }
.admin-stat-card:nth-child(2) { animation-delay: 0.2s; }
.admin-stat-card:nth-child(3) { animation-delay: 0.3s; }
.admin-stat-card:nth-child(4) { animation-delay: 0.4s; }

.admin-mini-stat:nth-child(1) { animation-delay: 0.1s; }
.admin-mini-stat:nth-child(2) { animation-delay: 0.15s; }
.admin-mini-stat:nth-child(3) { animation-delay: 0.2s; }
.admin-mini-stat:nth-child(4) { animation-delay: 0.25s; }

/* Additional Mini Stat Gradient */
.admin-mini-stat-gradient-6 {
    background: linear-gradient(135deg, #5C6BC0 0%, #3949AB 100%);
}

/* Admin Warning Card */
.admin-warning-card {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 193, 7, 0.05) 100%);
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid #FF9800;
    animation: fadeInUp 0.5s ease-out forwards;
}

/* ==========================================================================
   Authorization Loading Screen
   Modern animated loading screen for Blazor authorization state
   ========================================================================== */

.auth-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    z-index: 10000;
    overflow: hidden;
}

.auth-loading-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.auth-loading-container::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M50 0 L100 50 L50 100 L0 50 Z' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    animation: patternMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes patternMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(60px, 60px) rotate(5deg); }
}

.auth-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
    animation: contentFadeIn 0.6s ease-out;
}

@keyframes contentFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.auth-logo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    animation: logoPulse 2s ease-in-out infinite;
}

.auth-logo-pulse::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: logoPulse 2s ease-in-out infinite 0.3s;
}

.auth-logo-pulse::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: logoPulse 2s ease-in-out infinite 0.6s;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: logoFloat 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.auth-logo svg {
    width: 48px;
    height: 48px;
    animation: logoSpin 8s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes logoSpin {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.auth-loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.auth-brand {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.auth-status {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 3px;
}

.auth-loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.auth-loading-dots span {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.auth-loading-dots span:nth-child(1) { animation-delay: 0s; }
.auth-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.auth-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8) translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2) translateY(-12px);
        opacity: 1;
    }
}

.auth-loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
}

.auth-loading-bar-progress {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.9) 50%,
        transparent 100%);
    border-radius: 4px;
    animation: barSlide 1.5s ease-in-out infinite;
}

@keyframes barSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Dark mode support for auth loading */
@media (prefers-color-scheme: dark) {
    .auth-loading-container {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    }

    .auth-logo {
        background: rgba(30, 30, 46, 0.95);
    }

    .auth-logo svg path:first-child {
        fill: url(#grad1);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-loading-container,
    .auth-loading-container::after,
    .auth-logo-pulse,
    .auth-logo-pulse::before,
    .auth-logo-pulse::after,
    .auth-logo,
    .auth-logo svg,
    .auth-loading-dots span,
    .auth-loading-bar-progress {
        animation: none;
    }

    .auth-loading-container {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .auth-loading-dots span {
        opacity: 1;
        transform: scale(1);
    }

    .auth-loading-bar-progress {
        width: 100%;
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Mobile responsiveness for auth loading */
@media (max-width: 600px) {
    .auth-logo-wrapper {
        width: 100px;
        height: 100px;
    }

    .auth-logo {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }

    .auth-logo svg {
        width: 38px;
        height: 38px;
    }

    .auth-brand {
        font-size: 26px;
    }

    .auth-status {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .auth-loading-bar {
        width: 160px;
    }
}

/* ==========================================================================
   Notification Dropdown Styles
   ========================================================================== */
.notification-dropdown-popover .mud-popover-root {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.notification-dropdown-container {
    border-radius: var(--radius-md);
}

.notification-list {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.notification-item {
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}

.notification-item:hover {
    background-color: var(--background-alt);
}

.notification-item.unread {
    background-color: rgba(25, 118, 210, 0.03);
}

.notification-item.unread:hover {
    background-color: rgba(25, 118, 210, 0.08);
}

.notification-item:last-child {
    border-bottom: none;
}

/* Badge styles */
.mud-badge-content {
    font-weight: 600;
    font-size: 11px;
}

/* ==========================================================================
   Reminder Alert Bar Styles
   ========================================================================== */
.reminder-alert-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
    color: white !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.reminder-alert-bar .mud-alert-message {
    color: white !important;
}

.reminder-alert-bar .mud-icon-root {
    color: white !important;
}

.reminder-alert-bar .mud-button-root {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-fast);
}

.reminder-alert-bar .mud-button-root:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.reminder-alert-bar .mud-icon-button {
    color: white !important;
}

.reminder-alert-bar .mud-icon-button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}
