/* Performance Optimized Styles */

/* Critical CSS - Load above the fold */
body {
    font-display: swap;
    text-rendering: optimizeSpeed;
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Lazy loading styles */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

/* Breadcrumb styles */
.breadcrumbs {
    margin: 1rem 0;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #666;
}

.breadcrumbs a {
    color: #007cba;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Performance optimized animations */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        animation: fadeIn 0.5s ease-in-out;
    }
    
    .slide-up {
        animation: slideUp 0.3s ease-out;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Optimize fonts */
@font-face {
    font-family: 'CustomFont';
    font-display: swap;
    src: url('fonts/custom-font.woff2') format('woff2');
}

/* Reduce layout shift */
.container {
    contain: layout style paint;
}

/* Optimize for mobile */
@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.8rem;
    }
    
    .breadcrumbs ol {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .breadcrumbs li:not(:last-child)::after {
        content: '→';
        margin: 0.25rem 0;
    }
}

/* Print styles for better performance */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .breadcrumbs,
    .no-print {
        display: none !important;
    }
}

/* Focus styles for accessibility */
.breadcrumbs a:focus,
.breadcrumbs a:active {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .breadcrumbs a {
        color: #000;
        text-decoration: underline;
    }
    
    .breadcrumbs li:not(:last-child)::after {
        color: #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .breadcrumbs {
        color: #e0e0e0;
    }
    
    .breadcrumbs a {
        color: #4fc3f7;
    }
    
    .breadcrumbs li:not(:last-child)::after {
        color: #888;
    }
}
