/* Vendor Prefix Fixes for Better Browser Compatibility */

/* Fix backdrop-filter issues */
.glass-header,
.menu-items,
.contact-info-item,
.project-card .project-card-overlay,
.carousel-button {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Fix text-size-adjust for mobile */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Fix user-select issues */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection where needed */
p, span, h1, h2, h3, h4, h5, h6, .project-description {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Fix transform3d for better performance */
.projects-carousel,
.project-card,
.carousel-button {
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Fix backface-visibility */
.project-card,
.projects-carousel {
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Fix perspective for better 3D transforms */
.projects-container {
    -webkit-perspective: 1000px;
    -moz-perspective: 1000px;
    -ms-perspective: 1000px;
    perspective: 1000px;
}

/* Fix background-clip for gradient text */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), #7986cb);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Fix transition properties */
.carousel-button,
.project-card,
.menu-item {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* Fix box-sizing for all elements */
*, *::before, *::after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Fix scrollbar webkit prefixes */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #c7d0f8;
    border-radius: 6px;
    border: 3px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Fix flex properties for older browsers */
.projects-page {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

/* For Safari grid support */
@supports not (display: grid) {
    .projects-page {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: -moz-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
    }
}

/* Fix appearance for form elements */
input, textarea, select, button {
    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    appearance: none;
}

/* Fix tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
}

/* Fix overflow scrolling for mobile */
.menu-items,
.project-description {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* Fix animation for webkit */
@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fix will-change for better performance */
.carousel-button,
.project-card {
    will-change: transform, opacity;
}

/* Fix filter properties */
.hero-overlay,
.project-overlay {
    filter: blur(0);
    -webkit-filter: blur(0);
}

/* Fix line-clamp for text truncation */
.project-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Fix sticky positioning */
.glass-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
}

/* Touch action for better scrolling */
body, html {
    touch-action: pan-y;
    -ms-touch-action: pan-y;
}

/* Fix mask properties if used */
.mask-element {
    -webkit-mask: linear-gradient(to bottom, black 0%, transparent 100%);
    mask: linear-gradient(to bottom, black 0%, transparent 100%);
}
