/* =============================================================================
   SynergyHub - Global Application Styles
   Modern, elegant design system integration
   ============================================================================= */

/* =============================================================================
   BASE RESETS & DEFAULTS
   ============================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--mud-typography-default-family);
    line-height: 1.5;
}

/* =============================================================================
   GLOBAL MUDBLAZOR OVERRIDES - Elegant Styling
   ============================================================================= */

/* Paper & Cards - Subtle shadows */
.mud-paper {
    border-radius: 8px;
}

.mud-card {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mud-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Buttons - Smooth transitions */
.mud-button-root {
    border-radius: 8px !important;
    transition: all 200ms ease !important;
}

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

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

.mud-icon-button {
    border-radius: 8px !important;
    transition: all 150ms ease !important;
}

/* Text Fields - Clean borders */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    transition: border-color 200ms ease !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--mud-palette-primary) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-width: 1px !important;
}

/* Select - Clean styling */
.mud-select .mud-input-outlined-border {
    border-radius: 8px !important;
}

/* Autocomplete */
.mud-autocomplete .mud-input-outlined-border {
    border-radius: 8px !important;
}

/* Chips - Rounded & elegant */
.mud-chip {
    border-radius: 16px !important;
}

/* Tables - Clean borders */
.mud-table {
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-table-head {
    background: rgba(0, 0, 0, 0.02);
}

.mud-table-row:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

/* Dialogs - Smooth appearance */
.mud-dialog {
    border-radius: 16px !important;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Drawer - Elegant shadow */
.mud-drawer {
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Menu - Clean popover */
.mud-menu .mud-popover-paper {
    border-radius: 12px !important;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-menu-item {
    border-radius: 6px;
    margin: 2px 4px;
    transition: background 150ms ease;
}

/* Tooltips */
.mud-tooltip {
    border-radius: 6px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
}

/* Snackbar - Clean notifications */
.mud-snackbar {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Progress - Rounded */
.mud-progress-linear {
    border-radius: 4px !important;
    overflow: hidden;
}

/* Tabs - Clean underline */
.mud-tabs-toolbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Expansion Panels */
.mud-expand-panel {
    border-radius: 8px !important;
    margin-bottom: 8px;
}

/* =============================================================================
   SCROLLBAR STYLING
   ============================================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* =============================================================================
   TYPOGRAPHY ENHANCEMENTS
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

/* =============================================================================
   LAYOUT UTILITIES
   ============================================================================= */

.page-container {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.section-card {
    background: var(--mud-palette-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 16px;
}

/* =============================================================================
   DARK MODE ADJUSTMENTS - uses MudBlazor theme class instead of prefers-color-scheme
   ============================================================================= */

.mud-theme-dark .mud-card,
.mud-theme-dark .mud-table,
.mud-theme-dark .mud-dialog,
.mud-theme-dark .mud-menu .mud-popover-paper {
    border-color: rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .mud-table-head {
    background: rgba(255, 255, 255, 0.02);
}

.mud-theme-dark .mud-table-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

.mud-theme-dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.mud-theme-dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.mud-theme-dark * {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

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

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

/* High contrast */
@media (prefers-contrast: high) {
    .mud-card,
    .mud-paper,
    .mud-table,
    .mud-dialog {
        border-width: 2px;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .mud-drawer,
    .mud-appbar,
    .mud-snackbar {
        display: none !important;
    }

    .page-container {
        padding: 0;
    }

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

/* =============================================================================
   CHECKBOX & RADIO LABEL FIX
   Keep primary color for icons, readable text for labels
   ============================================================================= */

.mud-checkbox .mud-typography,
.mud-radio .mud-typography {
    color: var(--mud-palette-text-primary) !important;
}

.mud-theme-dark .mud-checkbox .mud-typography,
.mud-theme-dark .mud-radio .mud-typography {
    color: var(--mud-palette-text-primary) !important;
}
