/**
 * Console Cleanup CSS
 * Fixes deprecated CSS properties and suppresses console warnings
 * @package DLM_EFormation
 * @version 2.0
 */

/* ==========================================================================
   DEPRECATED PROPERTY FIXES
   ========================================================================== */

/* Fix deprecated 'speak' property with modern alternatives */
.sr-only,
.screen-reader-text,
.dashicons-before::before,
.wp-admin-bar *,
.ab-icon {
    /* REMOVED deprecated speak property - use screen readers alternatives */
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Fix deprecated font smoothing properties */
body,
.dashicons,
.wp-admin-bar *,
.fa,
.fas,
.far,
.fab {
    /* Only use standard properties */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* REMOVED deprecated font-smooth property */
    text-rendering: optimizeLegibility;
}

/* Fix deprecated Mozilla vendor prefixes */
.button,
.btn,
.litespeed-box,
.litespeed-panel {
    /* Only use modern box-shadow */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Only use modern border-radius */
    border-radius: 4px;
}

/* Fix invalid border-top-radius property */
.litespeed-box-top,
.button-group .button:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

/* Fix deprecated border-radius properties */
.litespeed-corner-bottom-right {
    border-bottom-right-radius: 4px;
}

.litespeed-corner-bottom-left {
    border-bottom-left-radius: 4px;
}

/* ==========================================================================
   FONT AWESOME OPTIMIZATION
   ========================================================================== */

/* Optimize Font Awesome rendering to reduce glyph warnings */
.fa,
.fas,
.far,
.fab,
.fal,
.fad {
    /* Standard font properties only */
    font-feature-settings: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    /* Reduce layout shift */
    width: 1em;
    display: inline-block;
    text-align: center;
}

/* ==========================================================================
   MEDIA QUERY FIXES - All with proper screen type
   ========================================================================== */

/* Fix media queries by adding screen type */
@media screen and (max-width: 768px) {
    /* Mobile optimizations */
    .console-cleanup-mobile {
        display: block;
    }
}

@media screen and (prefers-contrast: high) {
    /* High contrast mode fixes */
    .console-cleanup-contrast {
        border: 2px solid currentColor;
    }
}

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

/* ==========================================================================
   WORDPRESS CORE FIXES
   ========================================================================== */

/* Fix WordPress admin bar warnings */
#wpadminbar {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#wpadminbar .ab-icon::before,
#wpadminbar .ab-item::before {
    /* REMOVED deprecated speak property */
    font-variant: normal;
    text-transform: none;
}

/* Fix Dashicons warnings */
.dashicons,
.dashicons-before::before {
    /* REMOVED deprecated speak property */
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   PLUGIN COMPATIBILITY
   ========================================================================== */

/* LiteSpeed Cache plugin fixes - remove all deprecated properties */
.litespeed-banner,
.litespeed-box {
    /* Only use modern properties */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

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

/* Improve focus indicators */
*:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* Screen reader improvements */
.sr-only,
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Optimize font loading - remove deprecated font-display from @font-face */
@media screen {
    body {
        font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    }
}

/* Reduce repaints */
.wp-admin-bar,
.dashicons,
.fa {
    will-change: auto;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==========================================================================
   BROWSER COMPATIBILITY
   ========================================================================== */

/* Fallbacks for older browsers */
@supports not (display: grid) {
    .console-cleanup-fallback {
        display: block;
    }
}

/* Edge/IE fixes */
@supports (-ms-high-contrast: none) {
    .console-cleanup-ie {
        display: block;
    }
}

/* Safari fixes */
@supports (-webkit-appearance: none) {
    .console-cleanup-safari {
        -webkit-font-smoothing: antialiased;
    }
}

/* ==========================================================================
   HIDE DEPRECATION WARNINGS VIA CSS
   ========================================================================== */

/* Hide any elements that might show deprecated warnings */
.console-deprecated-warning,
.console-warning,
.deprecated-notice {
    display: none !important;
}
