/* ========================================
   QuantumStore — Premium Design System
   ======================================== */

:root {
    /* These will sync with MudThemeProvider */
    --eco-primary: #4F46E5;
    --eco-secondary: #F43F5E;
    --eco-radius: 16px;
    --eco-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --eco-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

/* Glassmorphism Classes */
.glass-effect {
    background: var(--mud-palette-appbar-background) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--mud-palette-divider) !important;
}

.mud-dark .glass-effect {
    background: rgba(17, 24, 39, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(circle at top left, #4F46E5 0%, #1E1B4B 100%);
    overflow: hidden;
}

.loading-content {
    text-align: center;
    color: white;
    animation: fadeInUp 0.8s ease-out;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.6s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main Layout Positioning */
.eco-main-content {
    min-height: 100vh;
    padding-top: 80px; 
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--mud-palette-background);
}

::-webkit-scrollbar-thumb {
    background: var(--mud-palette-divider);
    border-radius: 10px;
    border: 2px solid var(--mud-palette-background);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mud-palette-text-secondary);
}

/* Premium Button Overrides */
.mud-button-filled {
    box-shadow: 0 4px 14px 0 rgba(0,0,0,0.1) !important;
    transition: all 0.2s ease !important;
}

.mud-button-filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}

/* Card Styling */
.mud-card {
    border-radius: var(--eco-radius) !important;
    background-color: var(--mud-palette-surface) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}

/* Typography Enhancements */
h1, h2, h3, h4, .mud-typography-h1, .mud-typography-h2, .mud-typography-h3 {
    letter-spacing: -0.025em !important;
    color: var(--mud-palette-text-primary);
}

/* Blazor error UI */
#blazor-error-ui {
    background: #111827;
    color: white;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 300px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Anim Helper */
.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .eco-main-content {
        padding-top: 72px;
    }
}

/* ========================================
   Optimized Global Filter Bar 
   ======================================== */
.main-filter-bar {
    display: flex;
    align-items: center;
    background: rgba(var(--mud-palette-surface-rgb), 0.05);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--mud-palette-divider);
    border-radius: 20px;
    padding: 8px 16px;
    margin-bottom: 32px;
    gap: 16px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.mud-dark .main-filter-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.filter-header {
    border-right: 1px solid var(--mud-palette-divider);
    padding-right: 16px;
    flex-shrink: 0;
}

.filter-icon-bg {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(244, 63, 94, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mud-palette-divider);
}

.filter-items-container {
    display: flex;
    flex: 1;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-items-container::-webkit-scrollbar {
    display: none;
}

.filter-item {
    min-width: 160px;
    background: rgba(var(--mud-palette-text-primary-rgb), 0.03);
    border-radius: 12px;
    padding: 0 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mud-dark .filter-item {
    background: rgba(255, 255, 255, 0.02);
}

.filter-item:hover {
    background: rgba(var(--mud-palette-text-primary-rgb), 0.05);
    border-color: var(--eco-primary);
}

.modern-filter-select .mud-input {
    color: var(--mud-palette-text-primary) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.modern-filter-select .mud-input-underline:before,
.modern-filter-select .mud-input-underline:after {
    display: none !important;
}

.modern-filter-select .mud-input-adornment {
    color: var(--mud-palette-text-secondary) !important;
}

.modern-filter-field .mud-input {
    color: var(--mud-palette-text-primary) !important;
    font-size: 0.85rem !important;
}

.modern-filter-field .mud-input-underline:before,
.modern-filter-field .mud-input-underline:after {
    display: none !important;
}

@media (max-width: 960px) {
    .main-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 12px;
    }
    .filter-header {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0;
        padding-bottom: 12px;
    }
    .filter-items-container {
        flex-direction: column;
        overflow-x: visible;
    }
    .filter-item {
        width: 100%;
        min-width: auto;
    }
}