/* Data in 3D - Optimized CSS Styles */

/* Custom color scheme for Data in 3D */
:root {
    --primary-blue: #00649b;
    --primary-blue-dark: #004d75;
    --accent-red: #dc2626;
    --accent-red-dark: #b91c1c;
    --text-gray: #374151;
    --light-gray: #f9fafb;
}

/* Performance: Reduce paint and composite operations */
* {
    box-sizing: border-box;
}

.gradient-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
}

/* Optimized card hover effects with will-change */
.card-hover {
    transition: all 0.3s ease;
    will-change: transform, box-shadow;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Service icon animations */
.service-icon {
    transition: all 0.3s ease;
    will-change: transform, color;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    color: var(--primary-blue);
}

/* Smooth scrolling with reduced motion support */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .card-hover,
    .service-icon {
        transition: none;
    }
}

/* Custom scrollbar - webkit only */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

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

/* Animation for fade-in on scroll with improved performance */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto; /* Remove will-change after animation */
}

/* Professional typography with improved readability */
.text-balance {
    text-wrap: balance;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000;
    }
    
    .bg-gray-50 {
        background-color: #fff;
        border: 1px solid #000;
    }
}

/* Custom Data in 3D Blue Colors with better performance */
.bg-datain3d {
    background-color: var(--primary-blue);
}

.bg-datain3d:hover {
    background-color: var(--primary-blue-dark);
}

.text-datain3d {
    color: var(--primary-blue);
}

.text-datain3d:hover {
    color: var(--primary-blue-dark);
}

.border-datain3d {
    border-color: var(--primary-blue);
}

.bg-datain3d-light {
    background-color: rgba(0, 100, 155, 0.1);
}

/* Focus styles for better accessibility */
.focus\:not-sr-only:focus {
    position: absolute !important;
    width: auto !important;
    height: auto !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    background-color: var(--primary-blue) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 0.375rem !important;
    z-index: 50 !important;
}

/* Enhanced skip link */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* Improved print styles */
@media print {
    .gradient-hero {
        background: var(--primary-blue) !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
    }
    
    .shadow-lg,
    .shadow-sm {
        box-shadow: none !important;
    }
    
    .hidden {
        display: none !important;
    }
}

/* Performance optimization for images */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder - only for content images */
img[data-src]:not(.social-icon) {
    filter: blur(5px);
    transition: filter 0.3s;
}

img[data-src].loaded {
    filter: blur(0);
}

/* Social media icons should never be blurred */
.social-icon, header img {
    filter: none !important;
}