/* Tablet-specific optimizations to prevent rendering artifacts */

/* Target tablet devices specifically */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  
  /* Tablet-optimized class for navigation components */
  .tablet-optimized {
    /* Hardware acceleration for tablets */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
    
    /* Prevent rendering artifacts */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    
    /* Ensure proper layering */
    isolation: isolate !important;
    
    /* Prevent subpixel rendering issues */
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
  }
  
  /* Fix for backdrop-filter rendering issues on tablets */
  .tablet-optimized {
    /* Reduce backdrop-filter complexity on tablets */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    
    /* Alternative background for tablets that don't support backdrop-filter well */
    background: rgba(30, 34, 90, 0.95) !important;
  }
  
  /* Fix for menu item rendering artifacts */
  .tablet-optimized button,
  .tablet-optimized [role="button"] {
    /* Hardware acceleration for buttons */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Prevent transition artifacts */
    will-change: transform, background-color, border-color !important;
    
    /* Ensure proper rendering on tablets */
    -webkit-tap-highlight-color: transparent !important;
    
    /* Optimize transitions for tablets */
    transition: all 0.15s ease-out !important;
  }
  
  /* Fix for scrolling artifacts in menu lists */
  .tablet-optimized .MenuList,
  .tablet-optimized [class*="MenuList"] {
    /* Hardware acceleration for scroll containers */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Improve scrolling on tablets */
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
    
    /* Prevent rendering artifacts during scroll */
    will-change: scroll-position !important;
    
    /* Ensure smooth scrolling */
    scroll-behavior: smooth !important;
  }
  
  /* Fix for overlay rendering issues */
  .tablet-optimized[class*="Overlay"],
  .tablet-optimized[class*="overlay"] {
    /* Hardware acceleration for overlays */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Reduce backdrop-filter complexity on tablets */
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    
    /* Prevent transition artifacts */
    will-change: opacity !important;
  }
  
  /* Fix for drawer/sidebar rendering issues */
  .tablet-optimized[class*="Drawer"],
  .tablet-optimized[class*="drawer"],
  .tablet-optimized[class*="Sidebar"],
  .tablet-optimized[class*="sidebar"] {
    /* Hardware acceleration for drawers */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
    
    /* Reduce backdrop-filter complexity on tablets */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    
    /* Prevent transition artifacts */
    will-change: transform !important;
    
    /* Ensure proper rendering on tablets */
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
  }
  
  /* Fix for icon rendering issues */
  .tablet-optimized svg,
  .tablet-optimized [class*="Icon"],
  .tablet-optimized [class*="icon"] {
    /* Hardware acceleration for icons */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Prevent icon rendering artifacts */
    shape-rendering: geometricPrecision !important;
    text-rendering: optimizeLegibility !important;
  }
  
  /* Fix for text rendering issues */
  .tablet-optimized {
    /* Optimize text rendering for tablets */
    font-smooth: never !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    
    /* Prevent text rendering artifacts */
    text-size-adjust: 100% !important;
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
  }
  
  /* Fix for border rendering issues */
  .tablet-optimized {
    /* Ensure crisp borders on tablets */
    border-image-slice: 1 !important;
    border-image-repeat: stretch !important;
    
    /* Prevent border rendering artifacts */
    outline: none !important;
    outline-offset: 0 !important;
  }
  
  /* Fix for shadow rendering issues */
  .tablet-optimized {
    /* Optimize shadows for tablets */
    filter: none !important;
    
    /* Use simpler shadows on tablets to prevent artifacts */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  }
  
  /* Fix for animation rendering issues */
  .tablet-optimized {
    /* Optimize animations for tablets */
    animation-fill-mode: both !important;
    
    /* Prevent animation artifacts */
    animation-play-state: running !important;
  }
  
  /* Fix for touch interaction issues */
  .tablet-optimized {
    /* Optimize touch interactions for tablets */
    touch-action: manipulation !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    
    /* Prevent touch feedback artifacts */
    -webkit-tap-highlight-color: transparent !important;
  }
  
  /* Fix for focus state rendering issues */
  .tablet-optimized:focus {
    /* Ensure proper focus rendering on tablets */
    outline: 2px solid rgba(88, 166, 255, 0.6) !important;
    outline-offset: 2px !important;
  }
  
  /* Fix for hover state rendering issues */
  .tablet-optimized:hover {
    /* Ensure proper hover rendering on tablets */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
  }
}

/* LOW-END TABLET OPTIMIZATIONS - For devices with limited CPU/GPU/RAM */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  
  .low-end-tablet {
    /* Disable all complex effects for low-end tablets */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    
    /* Use solid backgrounds instead of transparent ones */
    background: rgba(30, 34, 90, 0.98) !important;
    
    /* Disable complex shadows */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    
    /* Disable complex animations */
    animation: none !important;
    transition: none !important;
    
    /* Force simple rendering mode */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Disable perspective and 3D effects */
    perspective: none !important;
    -webkit-perspective: none !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    
    /* Use simpler borders */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    
    /* Disable will-change to prevent GPU memory issues */
    will-change: auto !important;
  }
  
  /* Low-end tablet button optimizations */
  .low-end-tablet button,
  .low-end-tablet [role="button"] {
    /* Disable all transforms and transitions */
    transform: none !important;
    -webkit-transform: none !important;
    transition: none !important;
    
    /* Use simple backgrounds */
    background: rgba(88, 166, 255, 0.1) !important;
    
    /* Simple hover effect */
    &:hover {
      background: rgba(88, 166, 255, 0.2) !important;
      transform: none !important;
      -webkit-transform: none !important;
    }
    
    /* Simple active effect */
    &:active {
      background: rgba(88, 166, 255, 0.3) !important;
    }
  }
  
  /* Low-end tablet menu list optimizations */
  .low-end-tablet .MenuList,
  .low-end-tablet [class*="MenuList"] {
    /* Disable complex scrolling effects */
    -webkit-overflow-scrolling: auto !important;
    overflow-scrolling: auto !important;
    
    /* Simple scrollbar */
    scrollbar-width: thin !important;
    scrollbar-color: rgba(88, 166, 255, 0.5) transparent !important;
    
    /* Disable will-change */
    will-change: auto !important;
  }
  
  /* Low-end tablet overlay optimizations */
  .low-end-tablet[class*="Overlay"],
  .low-end-tablet[class*="overlay"] {
    /* Use simple background instead of backdrop-filter */
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* Disable transitions */
    transition: none !important;
  }
  
  /* Low-end tablet drawer/sidebar optimizations */
  .low-end-tablet[class*="Drawer"],
  .low-end-tablet[class*="drawer"],
  .low-end-tablet[class*="Sidebar"],
  .low-end-tablet[class*="sidebar"] {
    /* Use solid background */
    background: rgba(30, 34, 90, 0.98) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* Disable complex transforms */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Simple border */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    
    /* Disable will-change */
    will-change: auto !important;
  }
  
  /* Low-end tablet icon optimizations */
  .low-end-tablet svg,
  .low-end-tablet [class*="Icon"],
  .low-end-tablet [class*="icon"] {
    /* Disable complex rendering */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Simple icon rendering */
    shape-rendering: auto !important;
    text-rendering: auto !important;
  }
  
  /* Low-end tablet text optimizations */
  .low-end-tablet {
    /* Simple text rendering */
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: auto !important;
    
    /* Disable complex text effects */
    text-shadow: none !important;
    letter-spacing: normal !important;
  }
  
  /* Low-end tablet focus optimizations */
  .low-end-tablet:focus {
    /* Simple focus indicator */
    outline: 2px solid rgba(88, 166, 255, 0.8) !important;
    outline-offset: 1px !important;
  }
  
  /* Low-end tablet touch optimizations */
  .low-end-tablet {
    /* Simple touch handling */
    touch-action: auto !important;
    -webkit-tap-highlight-color: rgba(88, 166, 255, 0.2) !important;
  }
}

/* Additional tablet-specific fixes for very specific screen sizes */
@media screen and (min-width: 800px) and (max-width: 900px) {
  .tablet-optimized {
    /* Further reduce backdrop-filter for problematic tablet sizes */
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
  }
  
  .low-end-tablet {
    /* Completely disable backdrop-filter for problematic sizes */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Landscape tablet optimizations */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .tablet-optimized {
    /* Optimize for landscape orientation */
    transform: translateZ(0) scale(1) !important;
    -webkit-transform: translateZ(0) scale(1) !important;
  }
  
  .low-end-tablet {
    /* Disable transforms for low-end landscape tablets */
    transform: none !important;
    -webkit-transform: none !important;
  }
}

/* Portrait tablet optimizations */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .tablet-optimized {
    /* Optimize for portrait orientation */
    transform: translateZ(0) scale(1) !important;
    -webkit-transform: translateZ(0) scale(1) !important;
  }
  
  .low-end-tablet {
    /* Disable transforms for low-end portrait tablets */
    transform: none !important;
    -webkit-transform: none !important;
  }
}

/* Performance mode CSS custom properties */
:root {
  --animation-duration: 0.3s;
  --transition-duration: 0.3s;
  --backdrop-blur: blur(18px);
  --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --render-mode: quality;
  --enable-transforms: true;
  --enable-filters: true;
  --enable-animations: true;
  
  /* Portrait mode detection */
  --portrait-mode: false;
  --disable-backdrop-filter: false;
  --force-solid-backgrounds: false;
  --viewport-width: auto;
  --viewport-height: auto;
  --overflow-hidden: false;
  --disable-perspective: false;
  --disable-3d-transforms: false;
  --disable-will-change: false;
}

/* Apply performance mode when CSS custom property is set */
[style*="--render-mode: performance"] {
  --animation-duration: 0.1s;
  --transition-duration: 0.1s;
  --backdrop-blur: blur(4px);
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  --enable-transforms: true;
  --enable-filters: false;
  --enable-animations: false;
}

/* Apply ultra-performance mode when CSS custom property is set */
[style*="--render-mode: ultra-performance"] {
  --animation-duration: 0.05s;
  --transition-duration: 0.05s;
  --backdrop-blur: none;
  --box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  --enable-transforms: false;
  --enable-filters: false;
  --enable-animations: false;
}

/* Apply portrait mode fixes when CSS custom property is set */
[style*="--portrait-mode: true"] {
  --disable-backdrop-filter: true;
  --force-solid-backgrounds: true;
  --viewport-width: 100%;
  --viewport-height: 100%;
  --overflow-hidden: true;
  --disable-perspective: true;
  --disable-3d-transforms: true;
  --disable-will-change: true;
}

/* Force performance mode for low-end tablets */
.low-end-tablet {
  --animation-duration: 0.1s !important;
  --transition-duration: 0.1s !important;
  --backdrop-blur: none !important;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  --render-mode: performance !important;
  --enable-transforms: false !important;
  --enable-filters: false !important;
  --enable-animations: false !important;
}

/* ULTRA-PERFORMANCE MODE - For very low-end tablets */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  
  .ultra-performance-tablet {
    /* Disable ALL effects for ultra-performance mode */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
    -webkit-transform: none !important;
    animation: none !important;
    transition: none !important;
    
    /* Use solid backgrounds only */
    background: rgba(30, 34, 90, 1) !important;
    
    /* Minimal shadows */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    
    /* Disable all 3D effects */
    perspective: none !important;
    -webkit-perspective: none !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    
    /* Simple borders */
    border: 1px solid rgba(88, 166, 255, 0.2) !important;
    
    /* Disable will-change completely */
    will-change: auto !important;
    
    /* Force simple rendering */
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: auto !important;
    
    /* Disable complex text effects */
    text-shadow: none !important;
    letter-spacing: normal !important;
    
    /* Simple touch handling */
    touch-action: auto !important;
    -webkit-tap-highlight-color: rgba(88, 166, 255, 0.1) !important;
  }
  
  /* Ultra-performance button optimizations */
  .ultra-performance-tablet button,
  .ultra-performance-tablet [role="button"] {
    /* No transforms or transitions */
    transform: none !important;
    -webkit-transform: none !important;
    transition: none !important;
    
    /* Simple solid background */
    background: rgba(88, 166, 255, 0.1) !important;
    
    /* No hover effects */
    &:hover {
      background: rgba(88, 166, 255, 0.15) !important;
      transform: none !important;
      -webkit-transform: none !important;
    }
    
    /* Simple active effect */
    &:active {
      background: rgba(88, 166, 255, 0.2) !important;
    }
  }
  
  /* Ultra-performance menu list optimizations */
  .ultra-performance-tablet .MenuList,
  .ultra-performance-tablet [class*="MenuList"] {
    /* Basic scrolling only */
    -webkit-overflow-scrolling: auto !important;
    overflow-scrolling: auto !important;
    
    /* Simple scrollbar */
    scrollbar-width: thin !important;
    scrollbar-color: rgba(88, 166, 255, 0.3) transparent !important;
    
    /* No will-change */
    will-change: auto !important;
  }
  
  /* Ultra-performance overlay optimizations */
  .ultra-performance-tablet[class*="Overlay"],
  .ultra-performance-tablet[class*="overlay"] {
    /* Simple solid background */
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* No transitions */
    transition: none !important;
  }
  
  /* Ultra-performance drawer/sidebar optimizations */
  .ultra-performance-tablet[class*="Drawer"],
  .ultra-performance-tablet[class*="drawer"],
  .ultra-performance-tablet[class*="Sidebar"],
  .ultra-performance-tablet[class*="sidebar"] {
    /* Solid background */
    background: rgba(30, 34, 90, 1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* No transforms */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Simple border */
    border: 1px solid rgba(88, 166, 255, 0.2) !important;
    
    /* No will-change */
    will-change: auto !important;
  }
  
  /* Ultra-performance icon optimizations */
  .ultra-performance-tablet svg,
  .ultra-performance-tablet [class*="Icon"],
  .ultra-performance-tablet [class*="icon"] {
    /* No transforms */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Basic icon rendering */
    shape-rendering: auto !important;
    text-rendering: auto !important;
  }
  
  /* Ultra-performance focus optimizations */
  .ultra-performance-tablet:focus {
    /* Simple focus indicator */
    outline: 1px solid rgba(88, 166, 255, 0.8) !important;
    outline-offset: 0 !important;
  }
}

/* PERFORMANCE MODE - For medium-end tablets */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  
  .performance-tablet {
    /* Reduce effects for performance mode */
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    
    /* Use semi-transparent backgrounds */
    background: rgba(30, 34, 90, 0.95) !important;
    
    /* Reduced shadows */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    
    /* Minimal animations */
    animation: none !important;
    transition: all 0.1s ease-out !important;
    
    /* Basic transforms only */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    
    /* Basic 3D effects */
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Simple borders */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    
    /* Limited will-change */
    will-change: transform !important;
  }
  
  /* Performance mode button optimizations */
  .performance-tablet button,
  .performance-tablet [role="button"] {
    /* Basic transforms only */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    transition: all 0.1s ease-out !important;
    
    /* Semi-transparent backgrounds */
    background: rgba(88, 166, 255, 0.1) !important;
    
    /* Simple hover effect */
    &:hover {
      background: rgba(88, 166, 255, 0.2) !important;
      transform: translateZ(0) !important;
      -webkit-transform: translateZ(0) !important;
    }
    
    /* Simple active effect */
    &:active {
      background: rgba(88, 166, 255, 0.3) !important;
    }
  }
}

/* PORTRAIT-SPECIFIC RENDERING FIXES */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  
  /* Portrait mode detection */
  .tablet-optimized {
    /* Force proper viewport rendering in portrait mode */
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    
    /* Prevent horizontal scrollbar artifacts */
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
    
    /* Force proper layer compositing in portrait */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Prevent subpixel rendering issues in portrait */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    
    /* Force proper border rendering in portrait */
    border-image-slice: 1 !important;
    border-image-repeat: stretch !important;
    
    /* Prevent outline artifacts in portrait */
    outline: none !important;
    outline-offset: 0 !important;
  }
  
  /* Enhanced portrait mode fixes for the specific portrait-mode-tablet class */
  .portrait-mode-tablet {
    /* Force solid backgrounds in portrait to prevent artifacts */
    background: rgba(30, 34, 90, 0.98) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* Disable all 3D effects in portrait */
    perspective: none !important;
    -webkit-perspective: none !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    
    /* Disable will-change in portrait */
    will-change: auto !important;
    
    /* Force proper overflow handling */
    overflow: hidden !important;
    
    /* Force proper viewport sizing */
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    
    /* Force proper box sizing */
    box-sizing: border-box !important;
    
    /* Disable complex shadows in portrait */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    
    /* Disable filters in portrait */
    filter: none !important;
    
    /* Force proper border rendering */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    border-radius: 12px !important;
    
    /* Force proper text rendering */
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: auto !important;
    
    /* Disable text effects in portrait */
    text-shadow: none !important;
    letter-spacing: normal !important;
    
    /* Force proper touch handling */
    touch-action: auto !important;
    -webkit-tap-highlight-color: rgba(88, 166, 255, 0.1) !important;
  }
  
  /* Portrait mode button fixes */
  .portrait-mode-tablet button,
  .portrait-mode-tablet [role="button"],
  .portrait-mode-tablet .MenuItem {
    /* Force solid backgrounds */
    background: rgba(88, 166, 255, 0.1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* Disable transforms in portrait */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Disable transitions in portrait */
    transition: none !important;
    
    /* Force proper sizing */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    
    /* Prevent overflow */
    overflow: hidden !important;
    
    /* Simple borders */
    border: 1px solid rgba(88, 166, 255, 0.2) !important;
    border-radius: 12px !important;
  }
  
  /* Portrait mode menu list fixes */
  .portrait-mode-tablet .MenuList,
  .portrait-mode-tablet [class*="MenuList"] {
    /* Force proper sizing */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    
    /* Prevent overflow */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    
    /* Basic scrolling */
    -webkit-overflow-scrolling: auto !important;
    overflow-scrolling: auto !important;
    
    /* Simple scrollbar */
    scrollbar-width: thin !important;
    scrollbar-color: rgba(88, 166, 255, 0.3) transparent !important;
    
    /* No will-change */
    will-change: auto !important;
  }
  
  /* Portrait mode overlay fixes */
  .portrait-mode-tablet[class*="Overlay"],
  .portrait-mode-tablet[class*="overlay"] {
    /* Force proper sizing */
    width: 100% !important;
    height: 100% !important;
    
    /* Prevent overflow */
    overflow: hidden !important;
    
    /* Solid background */
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* No transitions */
    transition: none !important;
  }
  
  /* Portrait mode drawer/sidebar fixes */
  .portrait-mode-tablet[class*="Drawer"],
  .portrait-mode-tablet[class*="drawer"],
  .portrait-mode-tablet[class*="Sidebar"],
  .portrait-mode-tablet[class*="sidebar"] {
    /* Force proper sizing */
    width: 80vw !important;
    max-width: 320px !important;
    height: 100vh !important;
    
    /* Prevent overflow */
    overflow: hidden !important;
    
    /* Solid background */
    background: rgba(30, 34, 90, 1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* No transforms */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Simple border */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    border-radius: 0 !important;
    
    /* No will-change */
    will-change: auto !important;
  }
  
  /* Portrait mode icon fixes */
  .portrait-mode-tablet svg,
  .portrait-mode-tablet [class*="Icon"],
  .portrait-mode-tablet [class*="icon"] {
    /* No transforms */
    transform: none !important;
    -webkit-transform: none !important;
    
    /* Basic rendering */
    shape-rendering: auto !important;
    text-rendering: auto !important;
    
    /* Proper sizing */
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }
  
  /* Portrait mode focus fixes */
  .portrait-mode-tablet:focus {
    /* Simple focus indicator */
    outline: 1px solid rgba(88, 166, 255, 0.8) !important;
    outline-offset: 1px !important;
  }
  
  /* Fix for portrait menu rendering artifacts */
  .tablet-optimized .MenuList,
  .tablet-optimized [class*="MenuList"] {
    /* Force proper container sizing in portrait */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    
    /* Prevent overflow artifacts in portrait */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    
    /* Force proper scroll container rendering */
    -webkit-overflow-scrolling: touch !important;
    overflow-scrolling: touch !important;
    
    /* Prevent scrollbar artifacts in portrait */
    scrollbar-width: thin !important;
    scrollbar-color: rgba(88, 166, 255, 0.5) transparent !important;
    
    /* Force proper layer compositing */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
  }
  
  /* Fix for portrait menu item artifacts */
  .tablet-optimized button,
  .tablet-optimized [role="button"],
  .tablet-optimized .MenuItem {
    /* Force proper button sizing in portrait */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    
    /* Prevent button overflow artifacts */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    
    /* Force proper button rendering in portrait */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Prevent button border artifacts */
    border: 1px solid rgba(88, 166, 255, 0.2) !important;
    border-radius: 12px !important;
    
    /* Force proper background rendering */
    background: rgba(88, 166, 255, 0.1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Fix for portrait overlay artifacts */
  .tablet-optimized[class*="Overlay"],
  .tablet-optimized[class*="overlay"] {
    /* Force proper overlay sizing in portrait */
    width: 100% !important;
    height: 100% !important;
    
    /* Prevent overlay overflow artifacts */
    overflow: hidden !important;
    
    /* Force proper overlay rendering in portrait */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Use solid background to prevent artifacts */
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Fix for portrait drawer/sidebar artifacts */
  .tablet-optimized[class*="Drawer"],
  .tablet-optimized[class*="drawer"],
  .tablet-optimized[class*="Sidebar"],
  .tablet-optimized[class*="sidebar"] {
    /* Force proper drawer sizing in portrait */
    width: 80vw !important;
    max-width: 320px !important;
    height: 100vh !important;
    
    /* Prevent drawer overflow artifacts */
    overflow: hidden !important;
    
    /* Force proper drawer rendering in portrait */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Use solid background to prevent artifacts */
    background: rgba(30, 34, 90, 0.98) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* Force proper border rendering */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    border-radius: 0 !important;
  }
  
  /* Fix for portrait icon artifacts */
  .tablet-optimized svg,
  .tablet-optimized [class*="Icon"],
  .tablet-optimized [class*="icon"] {
    /* Force proper icon sizing in portrait */
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    
    /* Prevent icon overflow artifacts */
    overflow: visible !important;
    
    /* Force proper icon rendering in portrait */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Force proper icon compositing */
    shape-rendering: geometricPrecision !important;
    text-rendering: optimizeLegibility !important;
  }
  
  /* Fix for portrait text artifacts */
  .tablet-optimized {
    /* Force proper text sizing in portrait */
    font-size: 1rem !important;
    line-height: 1.4 !important;
    
    /* Prevent text overflow artifacts */
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    
    /* Force proper text rendering in portrait */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    
    /* Prevent text selection artifacts */
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    
    /* Prevent text size adjustment artifacts */
    text-size-adjust: 100% !important;
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
  }
  
  /* Fix for portrait focus artifacts */
  .tablet-optimized:focus {
    /* Force proper focus rendering in portrait */
    outline: 2px solid rgba(88, 166, 255, 0.8) !important;
    outline-offset: 2px !important;
    
    /* Prevent focus overflow artifacts */
    overflow: visible !important;
  }
  
  /* Fix for portrait touch artifacts */
  .tablet-optimized {
    /* Force proper touch handling in portrait */
    touch-action: manipulation !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: rgba(88, 166, 255, 0.2) !important;
    
    /* Prevent touch feedback artifacts */
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
  }
  
  /* Fix for portrait animation artifacts */
  .tablet-optimized {
    /* Force proper animation rendering in portrait */
    animation-fill-mode: both !important;
    animation-play-state: running !important;
    
    /* Prevent animation overflow artifacts */
    overflow: hidden !important;
  }
  
  /* Fix for portrait transition artifacts */
  .tablet-optimized {
    /* Force proper transition rendering in portrait */
    transition: all 0.15s ease-out !important;
    
    /* Prevent transition overflow artifacts */
    overflow: hidden !important;
  }
  
  /* Fix for portrait shadow artifacts */
  .tablet-optimized {
    /* Force proper shadow rendering in portrait */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    
    /* Prevent shadow overflow artifacts */
    overflow: hidden !important;
  }
  
  /* Fix for portrait filter artifacts */
  .tablet-optimized {
    /* Force proper filter rendering in portrait */
    filter: none !important;
    
    /* Prevent filter overflow artifacts */
    overflow: hidden !important;
  }
  
  /* Fix for portrait backdrop-filter artifacts */
  .tablet-optimized {
    /* Disable backdrop-filter in portrait to prevent artifacts */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    /* Use solid background instead */
    background: rgba(30, 34, 90, 0.98) !important;
  }
  
  /* Fix for portrait will-change artifacts */
  .tablet-optimized {
    /* Disable will-change in portrait to prevent artifacts */
    will-change: auto !important;
  }
  
  /* Fix for portrait isolation artifacts */
  .tablet-optimized {
    /* Force proper layer isolation in portrait */
    isolation: isolate !important;
    z-index: auto !important;
  }
  
  /* Fix for portrait perspective artifacts */
  .tablet-optimized {
    /* Disable perspective in portrait to prevent artifacts */
    perspective: none !important;
    -webkit-perspective: none !important;
  }
  
  /* Fix for portrait backface-visibility artifacts */
  .tablet-optimized {
    /* Force backface visibility in portrait */
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
  }
  
  /* Fix for portrait image rendering artifacts */
  .tablet-optimized img,
  .tablet-optimized svg {
    /* Force proper image rendering in portrait */
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    
    /* Prevent image overflow artifacts */
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Fix for portrait container artifacts */
  .tablet-optimized > * {
    /* Force proper container rendering in portrait */
    box-sizing: border-box !important;
    max-width: 100% !important;
    
    /* Prevent container overflow artifacts */
    overflow-x: hidden !important;
  }
}
