/* ======================================
   Browser Compatibility & Vendor Prefixes
   Supports: Chrome, Firefox, Safari, Edge, IE11+
   ====================================== */

/* === Normalize & Base Resets === */
*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Flexbox Compatibility === */
.row-flex-center {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.social-links {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    gap: 20px;
}

/* Fallback for browsers that don't support gap in flexbox */
@supports not (gap: 20px) {
    .social-links>* {
        margin-right: 20px;
    }

    .social-links>*:last-child {
        margin-right: 0;
    }
}

/* === Transform Compatibility === */
.box-icon-2:hover,
.industry-card:hover,
.testimonial-card:hover {
    -webkit-transform: translateY(-4px);
    -moz-transform: translateY(-4px);
    -ms-transform: translateY(-4px);
    -o-transform: translateY(-4px);
    transform: translateY(-4px);
}

.btn-primary:hover,
.btn-gradient-blue:hover,
.btn-gradient-purple:hover {
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

#back-to-top:hover {
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
    -o-transform: translateY(-5px);
    transform: translateY(-5px);
}

/* === Transition Compatibility === */
.btn,
.box-icon-2,
.industry-card,
.testimonial-card,
.navbar-apphub,
a,
button {
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -o-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Animation Compatibility === */
@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@-moz-keyframes fadeInUp {
    from {
        opacity: 0;
        -moz-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -moz-transform: translateY(0);
        transform: translateY(0);
    }
}

@-o-keyframes fadeInUp {
    from {
        opacity: 0;
        -o-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -o-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        -moz-transform: translateY(30px);
        -o-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -o-transform: translateY(0);
        transform: translateY(0);
    }
}

@-webkit-keyframes slideUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        -moz-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        transform: translateY(0);
    }
}

.animate-up {
    -webkit-animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    -moz-animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    -o-animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.wrap-caption {
    -webkit-animation: fadeInUp 0.8s ease-out;
    -moz-animation: fadeInUp 0.8s ease-out;
    -o-animation: fadeInUp 0.8s ease-out;
    animation: fadeInUp 0.8s ease-out;
}

/* === Backdrop Filter Compatibility === */
.wrap-caption.glass,
.navbar-apphub.scrolled {
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

/* Fallback for browsers without backdrop-filter support */
@supports not ((-webkit-backdrop-filter: blur(15px)) or (backdrop-filter: blur(15px))) {
    .wrap-caption.glass {
        background: rgba(0, 0, 0, 0.75) !important;
    }

    .navbar-apphub.scrolled {
        background: rgba(255, 255, 255, 0.98) !important;
    }
}

/* === Gradient Compatibility === */
.btn-gradient-blue {
    background: -webkit-linear-gradient(315deg, #00d2ff 0%, #3a7bd5 100%) !important;
    background: -moz-linear-gradient(315deg, #00d2ff 0%, #3a7bd5 100%) !important;
    background: -o-linear-gradient(315deg, #00d2ff 0%, #3a7bd5 100%) !important;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
}

.btn-gradient-purple {
    background: -webkit-linear-gradient(315deg, #7c83fd 0%, #8b5cf6 100%) !important;
    background: -moz-linear-gradient(315deg, #7c83fd 0%, #8b5cf6 100%) !important;
    background: -o-linear-gradient(315deg, #7c83fd 0%, #8b5cf6 100%) !important;
    background: linear-gradient(135deg, #7c83fd 0%, #8b5cf6 100%) !important;
}

.cta-section {
    background: -webkit-linear-gradient(315deg, #014486 0%, #5F3DC4 100%);
    background: -moz-linear-gradient(315deg, #014486 0%, #5F3DC4 100%);
    background: -o-linear-gradient(315deg, #014486 0%, #5F3DC4 100%);
    background: linear-gradient(135deg, #014486 0%, #5F3DC4 100%);
}

.banner-page,
.banner-page.about {
    background: -webkit-linear-gradient(315deg, #7c83fd 0%, #8b5cf6 100%);
    background: -moz-linear-gradient(315deg, #7c83fd 0%, #8b5cf6 100%);
    background: -o-linear-gradient(315deg, #7c83fd 0%, #8b5cf6 100%);
    background: linear-gradient(135deg, #7c83fd 0%, #8b5cf6 100%);
}

/* === Border Radius Compatibility === */
.box-icon-2,
.btn,
.industry-card,
.testimonial-card {
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
}

/* === Box Shadow Compatibility === */
.box-icon-2:hover {
    -webkit-box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    -moz-box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === User Select Compatibility === */
.navbar-brand img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* === Appearance Reset for Forms === */
input,
textarea,
select,
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 12px;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px !important;
}

/* === Placeholder Styling === */
::-webkit-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

::-moz-placeholder {
    color: #9ca3af;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* === Scrollbar Styling (Webkit) === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #FAFAFA;
}

::-webkit-scrollbar-thumb {
    background: #D0D7E2;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 2px solid #FAFAFA;
}

::-webkit-scrollbar-thumb:hover {
    background: #9EA9BC;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #D0D7E2 #FAFAFA;
}

/* === IE11 & Edge Legacy Fixes === */
@media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {

    /* IE11 specific fixes */
    .row-flex-center {
        display: block;
    }

    .row-flex-center>[class*="col-"] {
        display: inline-block;
        vertical-align: top;
    }

    .wrap-caption.glass {
        background: rgba(0, 0, 0, 0.8) !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* === Print Styles === */
@media print {

    .navbar-apphub,
    .footer,
    #back-to-top,
    .slides-navigation {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000 !important;
        background: #fff !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    .section {
        page-break-inside: avoid;
    }
}

/* === High Contrast Mode Support === */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0056b3;
        --text-primary: #000000;
        --border-color: #000000;
    }

    .btn-primary,
    .btn-gradient-blue,
    .btn-gradient-purple {
        border: 2px solid #000 !important;
    }
}

/* === Reduced Motion Support === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        -webkit-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-animation-iteration-count: 1 !important;
        animation-iteration-count: 1 !important;
        -webkit-transition-duration: 0.01ms !important;
        -moz-transition-duration: 0.01ms !important;
        -o-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1 !important;
        -webkit-transform: none !important;
        -moz-transform: none !important;
        transform: none !important;
    }
}

/* === Dark Mode Support (for future use) === */
@media (prefers-color-scheme: dark) {
    /* Prepared for dark mode implementation */
    /* Currently disabled - can be enabled when needed */
}

/* === Touch Device Optimizations === */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects on touch devices */
    .box-icon-2:hover,
    .industry-card:hover,
    .testimonial-card:hover {
        -webkit-transform: none;
        -moz-transform: none;
        transform: none;
    }

    /* Increase touch targets */
    .navbar-nav>li>a {
        padding: 15px 20px !important;
        min-height: 44px;
    }

    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* === Safari-specific fixes === */
@supports (-webkit-touch-callout: none) {

    /* Safari only */
    .wrap-caption.glass {
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
    }

    /* Fix for Safari flex gap */
    .social-links {
        gap: 0;
    }

    .social-links>a {
        margin-right: 20px;
    }

    .social-links>a:last-child {
        margin-right: 0;
    }
}

/* === Firefox-specific fixes === */
@-moz-document url-prefix() {

    /* Firefox only */
    select {
        text-indent: 0.01px;
        text-overflow: '';
    }

    /* Fix Firefox button padding */
    button::-moz-focus-inner {
        border: 0;
        padding: 0;
    }
}

/* === Object-fit fallback for older browsers === */
.img-responsive {
    max-width: 100%;
    height: auto;
    -ms-interpolation-mode: bicubic;
}

/* === Smooth scroll with fallback === */
html {
    scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* === Focus visible polyfill styles === */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

.js-focus-visible .focus-visible {
    outline: 2px solid #1B96FF;
    outline-offset: 2px;
}

/* === Legacy Edge (EdgeHTML) Support === */
@supports (-ms-ime-align: auto) {

    /* Edge 12-18 only */
    .wrap-caption.glass {
        background: rgba(0, 0, 0, 0.75) !important;
    }
}