/* ================================
   Vendor Prefix Compatibility Layer
   Ensures cross-browser support
   ================================ */

/* Text size adjust for mobile browsers */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* User select - prevent text selection where needed */
.no-select,
.jay-hamburger,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mask properties for Safari and Edge */
[class*="mask-"] {
    -webkit-mask-image: var(--mask-image);
    mask-image: var(--mask-image);
    
    -webkit-mask-size: var(--mask-size, cover);
    mask-size: var(--mask-size, cover);
    
    -webkit-mask-repeat: var(--mask-repeat, no-repeat);
    mask-repeat: var(--mask-repeat, no-repeat);
    
    -webkit-mask-position: var(--mask-position, center);
    mask-position: var(--mask-position, center);
}

/* Text wrap fallback for older Safari */
.text-wrap-balance {
    text-wrap: balance;
}

@supports not (text-wrap: balance) {
    .text-wrap-balance {
        /* Fallback: Use pretty if balance not supported */
        text-wrap: pretty;
    }
}

@supports not (text-wrap: pretty) {
    .text-wrap-balance {
        /* Final fallback: normal text wrapping */
        text-wrap: wrap;
    }
}

/* Ensure all backdrop-filter has webkit prefix */
.backdrop-blur,
[class*="backdrop-"] {
    -webkit-backdrop-filter: var(--backdrop-filter, blur(10px));
    backdrop-filter: var(--backdrop-filter, blur(10px));
}

/* Specific backdrop-filter overrides for common cases */
.jay-header,
.jay-nav,
.status-badge,
.modal-overlay,
.dropdown {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Box sizing for all elements */
*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Appearance normalization */
input[type="search"],
input[type="text"],
input[type="email"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
}

/* Placeholder text color with vendor prefixes */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

::-webkit-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

::-moz-placeholder {
    color: #9ca3af;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Transform and animation prefixes */
@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Flexbox prefixes for older browsers */
.flex,
[class*="flex-"] {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

/* Smooth scrolling with vendor prefixes */
html {
    -webkit-scroll-behavior: smooth;
    -moz-scroll-behavior: smooth;
    -ms-scroll-behavior: smooth;
    scroll-behavior: smooth;
}

/* CSS Grid support */
.grid {
    display: -ms-grid;
    display: grid;
}

/* Filter effects with vendor prefix */
.filter,
[class*="filter-"] {
    -webkit-filter: var(--filter-value);
    filter: var(--filter-value);
}

/* Clip path for complex shapes */
[class*="clip-"] {
    -webkit-clip-path: var(--clip-path);
    clip-path: var(--clip-path);
}

/* Column count for multi-column layouts */
.columns {
    -webkit-column-count: var(--column-count, 2);
    -moz-column-count: var(--column-count, 2);
    column-count: var(--column-count, 2);
    
    -webkit-column-gap: var(--column-gap, 1rem);
    -moz-column-gap: var(--column-gap, 1rem);
    column-gap: var(--column-gap, 1rem);
}

/* Hyphens for text wrapping */
.hyphens {
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

/* Tab size normalization */
pre, code {
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
}

/* Touch action for mobile */
.touch-action-none {
    -ms-touch-action: none;
    touch-action: none;
}

.touch-action-pan-y {
    -ms-touch-action: pan-y;
    touch-action: pan-y;
}

.touch-action-pan-x {
    -ms-touch-action: pan-x;
    touch-action: pan-x;
}

/* Overflow scrolling with momentum */
.overflow-scroll,
.overflow-auto {
    -webkit-overflow-scrolling: touch;
}

/* Font smoothing */
body,
.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Shape outside for text wrapping around images */
[class*="shape-"] {
    -webkit-shape-outside: var(--shape-outside);
    shape-outside: var(--shape-outside);
}
