/* Performance and Image Optimization Styles */

/* Critical above-the-fold styles */
.critical-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Lazy loading placeholder */
.lazy-image {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: barberpole 0.5s linear infinite;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

@keyframes barberpole {
    from { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
    to { background-position: 20px 0, 20px 10px, 30px -10px, 10px 0px; }
}

/* Enhanced image styles */
.optimized-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.optimized-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* Performance indicators */
.performance-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.performance-badge.show {
    opacity: 1;
}

/* Enhanced content grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.content-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.content-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.content-card-body {
    padding: 1.5rem;
}

.content-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.content-card p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced typography for better readability */
.enhanced-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 65ch;
}

.enhanced-text h2 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.enhanced-text h3 {
    color: var(--text-primary);
    font-weight: 500;
    margin: 1.5rem 0 0.75rem 0;
}

/* Call-to-action improvements */
.cta-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0 20L10 10L20 20L30 10L40 20L50 10L60 20L70 10L80 20L90 10L100 20V0H0Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 100px 20px;
    animation: wave 10s linear infinite;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: var(--background-light);
}

/* Enhanced social media integration */
.social-section {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 2rem 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--background-white);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-icon.twitter:hover { background: #1da1f2; color: white; }
.social-icon.pinterest:hover { background: #bd081c; color: white; }
.social-icon.facebook:hover { background: #4267b2; color: white; }

/* Accessibility improvements */
.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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #333333;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
    }
    
    .content-card, .thickBorderOverBox {
        border: 2px solid #000000;
    }
}

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

/* Print optimization */
@media print {
    .cta-section, .social-section, #nav-menu, .mobile-only {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000000;
        background: white;
    }
    
    .content-card, .thickBorderOverBox {
        break-inside: avoid;
        border: 1px solid #000000;
        margin-bottom: 1rem;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}