/* Browser Compatibility CSS */
/* This file ensures cross-browser compatibility for all major browsers */

/* CSS Reset for older browsers */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}

/* Flexbox compatibility */
.flex {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

.flex-center {
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.flex-column {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.flex-wrap {
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.flex-space-between {
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -moz-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

/* Grid compatibility */
.grid {
    display: -ms-grid;
    display: grid;
}

/* Border radius compatibility */
.border-radius {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

/* Box shadow compatibility */
.box-shadow {
    -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Gradient compatibility */
.gradient-primary {
    background: #4B0082; /* Fallback for old browsers */
    background: -webkit-linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    background: -o-linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
    background: linear-gradient(135deg, #4B0082 0%, #764ba2 100%);
}

/* Transform compatibility */
.transform-scale {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

.transform-rotate {
    -webkit-transform: rotate(5deg);
    -moz-transform: rotate(5deg);
    -ms-transform: rotate(5deg);
    -o-transform: rotate(5deg);
    transform: rotate(5deg);
}

.transform-translate {
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
    -o-transform: translateY(-5px);
    transform: translateY(-5px);
}

/* Transition compatibility */
.transition-all {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.transition-transform {
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
}

/* Filter compatibility */
.filter-brightness {
    -webkit-filter: brightness(1.1);
    filter: brightness(1.1);
}

.filter-blur {
    -webkit-filter: blur(5px);
    filter: blur(5px);
}

/* Animation compatibility */
.animation-fade {
    -webkit-animation: fadeIn 0.5s ease;
    -moz-animation: fadeIn 0.5s ease;
    -o-animation: fadeIn 0.5s ease;
    animation: fadeIn 0.5s ease;
}

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

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

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

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

/* User select compatibility */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Appearance compatibility */
.no-appearance {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Placeholder compatibility */
input::-webkit-input-placeholder {
    color: #999;
}

input::-moz-placeholder {
    color: #999;
    opacity: 1;
}

input:-ms-input-placeholder {
    color: #999;
}

input::placeholder {
    color: #999;
}

/* Scrollbar compatibility */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* IE specific fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .flex {
        display: -ms-flexbox;
    }
    
    .flex-center {
        -ms-flex-align: center;
        -ms-flex-pack: center;
    }
    
    .flex-column {
        --ms-flex-direction: column;
    }
    
    .flex-wrap {
        --ms-flex-wrap: wrap;
    }
}

/* Safari specific fixes */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        .safari-fix {
            --webkit-transform: translateZ(0);
        }
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .firefox-fix {
        --moz-transform: translateZ(0);
    }
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    .no-print {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #2E2E2E;
        --text-color: #f5f5f5;
        --card-color: #3a3a3a;
    }
}

/* Mobile viewport fix */
@supports (-webkit-touch-callout: none) {
    .mobile-fix {
        --webkit-transform: translate3d(0, 0, 0);
    }
}