/* Global Styles */
body {
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Animated Gradient Background */
    background: radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
        var(--mud-palette-background);
    background-attachment: fixed;
    background-size: 200% 200%;
    animation: gradientMove 20s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Premium Glassmorphism */
.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
    border-radius: 16px !important;
    transition: all 0.3s ease;
}

body.mud-theme-dark .glass-panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.6) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25) !important;
}

/* Gradient Text */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(135deg, var(--mud-palette-primary) 0%, var(--mud-palette-secondary) 100%);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    /* Slate 400 with opacity */
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mud-palette-primary);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hover Effects */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.hover-scale:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

/* Utility Classes */
.rounded-xl {
    border-radius: 1rem !important;
}

.rounded-2xl {
    border-radius: 1.5rem !important;
}

.font-heading {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Fix pagination alignment */
.mud-table-pagination-toolbar .mud-button-root,
.mud-table-pagination-toolbar .mud-icon-button {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    vertical-align: middle !important;
}

/* Ensure pagination toolbar doesn't break lines */
.mud-table-toolbar {
    flex-wrap: nowrap !important;
}

/* Custom fix for full height DataGrid scrolling */
.full-height-grid {
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
}

.full-height-grid .mud-table-container {
    flex-grow: 1;
    overflow-y: auto !important;
    min-height: 0;
    height: auto !important;
}

/* Battery Icon Component */
.battery-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.battery-container {
    width: 60px;
    height: 28px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    position: relative;
    padding: 2px;
    background: rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.battery-container::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 2px 2px 0;
}

.battery-level {
    height: 100%;
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1), background-color 1s ease;
    position: relative;
    overflow: hidden;
}

.battery-level::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: batteryGlow 3s infinite linear;
}

@keyframes batteryGlow {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.battery-percentage-inside {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    z-index: 5;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

body.mud-theme-dark .battery-display {
    background: rgba(255, 255, 255, 0.05);
}

body.mud-theme-dark .battery-container {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

body.mud-theme-dark .battery-container::after {
    background: rgba(255, 255, 255, 0.5);
}