/* Modern CSS Variables for Theming - Updated for cache refresh */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --surface-color: #ffffff;
    --background-color: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Loading Progress Styles - Fix for FOUC */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    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: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.loading-progress-text:after {
    content: "Loading...";
}

/* Hide loading when Blazor starts */
#app > .loading-progress {
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

#app.blazor-started > .loading-progress {
    opacity: 0;
    pointer-events: none;
}

/* Base Styles */
html, body {
    font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100%;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100%;
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

h1:focus {
    outline: none;
}

/* Modern Link Styles */
a, .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

a:hover, .btn-link:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* Modern Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* MudBlazor Component Overrides */
.mud-theme-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: white !important;
}

.mud-button {
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
}

.mud-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-md) !important;
}

.mud-button.mud-button-filled.mud-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    box-shadow: var(--shadow-sm) !important;
}

.mud-button.mud-button-filled.mud-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #db2777 100%) !important;
}

.mud-button.mud-button-filled.mud-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
}

.mud-button.mud-button-filled.mud-error {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%) !important;
}

/* Modern Card Styles */
.mud-card {
    border-radius: var(--radius-xl) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.3s ease !important;
    background: var(--surface-color) !important;
}

.mud-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-lg) !important;
}

.mud-card-header {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.5rem !important;
}

.mud-card-content {
    padding: 1.5rem !important;
}

/* Modern Paper Styles */
.mud-paper {
    border-radius: var(--radius-lg) !important;
    background: var(--surface-color) !important;
    border: 1px solid var(--border-color) !important;
}

.mud-paper.mud-elevation-0 {
    box-shadow: none !important;
}

.mud-paper.mud-elevation-1 {
    box-shadow: var(--shadow-sm) !important;
}

.mud-paper.mud-elevation-2 {
    box-shadow: var(--shadow-md) !important;
}

/* Modern Input Styles */
.mud-input {
    border-radius: var(--radius-md) !important;
}

.mud-input-outlined {
    border: 2px solid var(--border-color) !important;
    transition: all 0.2s ease !important;
}

.mud-input-outlined:hover {
    border-color: var(--primary-color) !important;
}

.mud-input-outlined.mud-input-focused {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Modern Chip Styles */
.mud-chip {
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    padding: 0.25rem 0.75rem !important;
}

.mud-chip.mud-chip-text.mud-primary {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary-color) !important;
}

.mud-chip.mud-chip-text.mud-secondary {
    background: rgba(236, 72, 153, 0.1) !important;
    color: var(--secondary-color) !important;
}

.mud-chip.mud-chip-text.mud-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--success-color) !important;
}

.mud-chip.mud-chip-text.mud-error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--error-color) !important;
}

.mud-chip.mud-chip-text.mud-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--warning-color) !important;
}

.mud-chip.mud-chip-text.mud-info {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--info-color) !important;
}

/* Modern Data Grid Styles */
.mud-table-container {
    border-radius: var(--radius-lg) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border: 1px solid var(--border-color) !important;
}

.mud-table-head {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    border-bottom: 2px solid var(--primary-hover) !important;
}

.mud-table-head .mud-table-cell {
    font-weight: 700 !important;
    color: white !important;
    padding: 1rem !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
}

.mud-table-head .mud-table-cell .mud-button-root {
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    padding: 0.5rem !important;
    min-width: auto !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
}

.mud-table-head .mud-table-cell .mud-button-root:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.mud-table-head .mud-table-cell .mud-icon-button-root {
    color: white !important;
}

.mud-table-head .mud-table-cell .mud-icon-button-root:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

/* Clean table cell styling */
.mud-table-cell {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5) !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.2s ease !important;
}

/* Brute force sort indicator - maximum specificity */
.mud-table-head .mud-table-cell:not([data-label]):not([data-sortable="false"]) {
    position: relative !important;
}

.mud-table-head .mud-table-cell:not([data-label]):not([data-sortable="false"]):after {
    content: "↕" !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 12px !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999 !important;
    pointer-events: none !important;
    line-height: 1 !important;
}

.mud-table-head .mud-table-cell:not([data-label]):not([data-sortable="false"]):hover:after {
    display: none !important;
}

/* Even more specific targeting */
.mud-card .mud-data-grid .mud-table-head .mud-table-cell:after {
    content: "↕" !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 12px !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999 !important;
    pointer-events: none !important;
    line-height: 1 !important;
}

.mud-card .mud-data-grid .mud-table-head .mud-table-cell:hover:after {
    display: none !important;
}

/* Make sure cells have relative positioning */
.mud-card .mud-data-grid .mud-table-head .mud-table-cell {
    position: relative !important;
}

.mud-table-row:hover .mud-table-cell {
    background: rgba(99, 102, 241, 0.02) !important;
}

/* Clean MudDataGrid header styling - minimal sort interference */
.mud-data-grid .mud-table-head {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: white !important;
}

.mud-data-grid .mud-table-head .mud-table-cell {
    background: transparent !important;
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
}

.mud-data-grid .mud-table-head .mud-table-cell .mud-button-root:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Clean row hover styling */
.mud-table-row:hover .mud-table-cell {
    background: rgba(99, 102, 241, 0.02) !important;
}
