/* ========== CROSS-BROWSER COMPATIBILITY CSS ========== */
/* This file ensures consistent rendering across all browsers */
/* Apply to all HTML pages for uniform appearance */

/* ========== CSS RESET & NORMALIZATION ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

/* ========== HTML5 DISPLAY DEFINITIONS ========== */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
    display: block;
}

audio, canvas, progress, video {
    display: inline-block;
    vertical-align: baseline;
}

audio:not([controls]) {
    display: none;
    height: 0;
}

[hidden], template {
    display: none;
}

/* ========== BASE ELEMENTS ========== */
html {
    font-family: 'Tibeb', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: 'Tibeb', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    line-height: 1.6;
    color: #1A2F3F;
    background-color: #FFFBF9;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== TYPOGRAPHY NORMALIZATION ========== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Tibeb', 'Inter', system-ui, sans-serif;
    font-weight: bold;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    color: inherit;
}

p {
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    background-color: transparent;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

a:active, a:hover {
    outline: 0;
}

/* ========== FORM ELEMENTS NORMALIZATION ========== */
button, input, optgroup, select, textarea {
    font-family: 'Tibeb', 'Inter', system-ui, sans-serif;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
    color: inherit;
    border: none;
    outline: none;
    background: transparent;
}

button, input {
    overflow: visible;
}

button, select {
    text-transform: none;
}

button, html input[type="button"], input[type="reset"], input[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
    border: none;
    outline: none;
}

button[disabled], html input[disabled] {
    cursor: default;
}

button::-moz-focus-inner, input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

input {
    line-height: normal;
}

input[type="checkbox"], input[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="search"] {
    -webkit-appearance: textfield;
    box-sizing: content-box;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

textarea {
    overflow: auto;
    resize: vertical;
}

/* ========== MEDIA ELEMENTS ========== */
img {
    border: 0;
    max-width: 100%;
    height: auto;
    display: block;
    -ms-interpolation-mode: bicubic;
}

svg:not(:root) {
    overflow: hidden;
}

/* ========== FLEXBOX COMPATIBILITY ========== */
.d-flex, .flex {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

.flex-column {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.flex-row {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
}

.align-items-center {
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.justify-content-center {
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.justify-content-between {
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

/* ========== TRANSFORM COMPATIBILITY ========== */
.transform {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
}

/* ========== TRANSITION COMPATIBILITY ========== */
.transition {
    -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;
}

/* ========== 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 4px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ========== GRADIENT COMPATIBILITY ========== */
.gradient-red {
    background: #FF0000;
    background: -webkit-linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    background: -moz-linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    background: -ms-linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    background: -o-linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.gradient-orange {
    background: #FF8C00;
    background: -webkit-linear-gradient(135deg, #FF8C00 0%, #FF6600 100%);
    background: -moz-linear-gradient(135deg, #FF8C00 0%, #FF6600 100%);
    background: -ms-linear-gradient(135deg, #FF8C00 0%, #FF6600 100%);
    background: -o-linear-gradient(135deg, #FF8C00 0%, #FF6600 100%);
    background: linear-gradient(135deg, #FF8C00 0%, #FF6600 100%);
}

.gradient-blue {
    background: #4285F4;
    background: -webkit-linear-gradient(135deg, #4285F4 0%, #1967D2 100%);
    background: -moz-linear-gradient(135deg, #4285F4 0%, #1967D2 100%);
    background: -ms-linear-gradient(135deg, #4285F4 0%, #1967D2 100%);
    background: -o-linear-gradient(135deg, #4285F4 0%, #1967D2 100%);
    background: linear-gradient(135deg, #4285F4 0%, #1967D2 100%);
}

/* ========== FILTER COMPATIBILITY ========== */
.filter-shadow {
    -webkit-filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.filter-blur {
    -webkit-filter: blur(10px);
    filter: blur(10px);
}

/* ========== BACKDROP FILTER COMPATIBILITY ========== */
.backdrop-blur {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* ========== FONT SMOOTHING ========== */
.font-smooth {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========== SCROLL BEHAVIOR ========== */
.smooth-scroll {
    scroll-behavior: smooth;
    -webkit-scroll-behavior: smooth;
}

/* ========== WEBKIT SCROLLBAR STYLING ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== SELECTION STYLING ========== */
::selection {
    background-color: #FF0000;
    color: white;
}

::-moz-selection {
    background-color: #FF0000;
    color: white;
}

/* ========== FOCUS OUTLINE NORMALIZATION ========== */
:focus {
    outline: 2px solid #FF0000;
    outline-offset: 2px;
}

button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #FF0000;
    outline-offset: 2px;
}

/* ========== PRINT STYLES ========== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    .no-print {
        display: none !important;
    }
}

/* ========== ACCESSIBILITY IMPROVEMENTS ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for brand consistency */
    html, body {
        background-color: #FFFBF9 !important;
        color: #1A2F3F !important;
    }
}

/* ========== MOBILE WEBKIT FIXES ========== */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific fixes */
    body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    input, textarea, button {
        -webkit-appearance: none;
        border-radius: 0;
    }
    
    input[type="submit"], input[type="button"], button {
        -webkit-appearance: none;
        border-radius: 0;
    }
}

/* ========== FIREFOX SPECIFIC FIXES ========== */
@-moz-document url-prefix() {
    /* Firefox specific styles */
    button {
        -moz-appearance: none;
    }
    
    input[type="submit"], input[type="button"] {
        -moz-appearance: none;
    }
}

/* ========== INTERNET EXPLORER FIXES ========== */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* IE10+ specific styles */
    .flex {
        display: -ms-flexbox;
    }
    
    .flex-column {
        -ms-flex-direction: column;
    }
    
    .align-items-center {
        -ms-flex-align: center;
    }
    
    .justify-content-center {
        -ms-flex-pack: center;
    }
}

/* ========== EDGE SPECIFIC FIXES ========== */
@supports (-ms-ime-align: auto) {
    /* Edge specific styles */
    body {
        -ms-overflow-style: scrollbar;
    }
}

/* ========== CHROME/WEBKIT SPECIFIC OPTIMIZATIONS ========== */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Chrome/Safari specific optimizations */
    body {
        -webkit-font-feature-settings: "kern" 1;
        font-feature-settings: "kern" 1;
    }
}

/* ========== RESPONSIVE UTILITIES ========== */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 576px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

@media (min-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.m-0 { margin: 0; }
.p-0 { padding: 0; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }

/* ========== CLEARFIX ========== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ========== SCREEN READER ONLY ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}