/* ClientPlaza Responsive Images CSS - Phase 4 */
/* Complete image optimization and responsive handling */

/* ==========================================================================
   RESPONSIVE IMAGE FOUNDATION
   ========================================================================== */

/* Base responsive image behavior */
img {
    max-width: 100%;
    height: auto;
    border: none;
    display: block;
}

/* Modern responsive image classes */
.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.responsive-image:hover {
    transform: scale(1.02);
}

/* ==========================================================================
   RESPONSIVE BACKGROUND IMAGES - HERO SECTIONS
   ========================================================================== */

/* Enhanced hero section backgrounds */
.hero-section {
    width: 100%;
    min-height: 300px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* Better mobile performance */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 2rem;
}

/* ==========================================================================
   SPECIFIC BACKGROUND IMPLEMENTATIONS
   ========================================================================== */

/* Homepage background with photo */
#HomepageBackgroundWithPhoto {
    background-image: url('../images/homepage-hero.jpg');
    min-height: 400px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Appointment class background */
#ApptClassBackgroundWithPhoto {
    background-image: url('../images/appointment-hero.jpg');
    min-height: 350px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Customer class background */
#CustomerClassBackgroundWithPhoto {
    background-image: url('../images/customer-hero.jpg');
    min-height: 350px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ==========================================================================
   RESPONSIVE BACKGROUND SCALING
   ========================================================================== */

/* Mobile-first background scaling */
@media (max-width: 767px) {
    .hero-section,
    #HomepageBackgroundWithPhoto,
    #ApptClassBackgroundWithPhoto,
    #CustomerClassBackgroundWithPhoto {
        min-height: 250px;
        background-attachment: scroll;
        background-position: center center;
    }
    
    .hero-content {
        padding: 1.5rem;
    }
}

/* Tablet scaling */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-section,
    #HomepageBackgroundWithPhoto,
    #ApptClassBackgroundWithPhoto,
    #CustomerClassBackgroundWithPhoto {
        min-height: 350px;
    }
    
    .hero-content {
        padding: 2.5rem;
    }
}

/* Desktop scaling */
@media (min-width: 1024px) {
    .hero-section,
    #HomepageBackgroundWithPhoto {
        min-height: 500px;
        background-attachment: fixed;
    }
    
    #ApptClassBackgroundWithPhoto,
    #CustomerClassBackgroundWithPhoto {
        min-height: 400px;
        background-attachment: fixed;
    }
    
    .hero-content {
        padding: 3rem;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    #HomepageBackgroundWithPhoto {
        min-height: 600px;
    }
    
    .hero-content {
        padding: 4rem;
    }
}

/* ==========================================================================
   LOGO AND BRANDING IMAGES
   ========================================================================== */

/* Responsive logo handling */
.logo-container {
    max-width: 200px;
    margin: 0 auto;
}

.logo-image {
    width: 100%;
    height: auto;
    max-width: 200px;
}

/* Navigation logo */
.nav-logo {
    max-height: 40px;
    width: auto;
}

/* ==========================================================================
   SERVICE ICONS AND THUMBNAILS
   ========================================================================== */

/* Service icons */
.service-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 1rem;
    transition: transform 0.3s ease;
}

.service-icon:hover {
    transform: scale(1.1);
}

/* Thumbnail images */
.thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   BUTTONS AND CTAs
   ========================================================================== */

	 /* Green Registration Banner - Much Smaller Size */
/* Green Registration Banner - Target the specific class and context */
/* More specific targeting with higher priority */
div.cta-section a.register-link img.responsive-image {
    max-width: 10% !important;
    min-width: 120px !important;
    width: 10% !important;
    height: auto !important;
    display: block !important;
    margin: 1rem auto !important;
}

/* Hover effect */
.register-link:hover .responsive-image {
    transform: scale(1.05);
}

/* Mobile adjustments */
@media (max-width: 767px) {
    div.cta-section a.register-link img.responsive-image {
        max-width: 25% !important;
        min-width: 100px !important;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .cta-section .responsive-image,
    .register-link .responsive-image {
        max-width: 15% !important;
        min-width: 120px;
    }
}

/* ==========================================================================
   TESTIMONIAL AND PROFILE IMAGES
   ========================================================================== */

/* Profile pictures */
.profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto 1rem;
}

/* Testimonial images */
.testimonial-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    margin-right: 1rem;
}

/* ==========================================================================
   GALLERY AND PORTFOLIO IMAGES
   ========================================================================== */

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

/* ==========================================================================
   LAZY LOADING AND PERFORMANCE
   ========================================================================== */

/* Lazy loading placeholder */
.image-placeholder {
    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; }
}

/* Progressive image loading */
.progressive-image {
    transition: opacity 0.3s ease;
}

.progressive-image.loading {
    opacity: 0.6;
}

.progressive-image.loaded {
    opacity: 1;
}

/* ==========================================================================
   HIGH DPI / RETINA DISPLAY SUPPORT
   ========================================================================== */

/* Retina display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-section {
        background-image: url('../images/homepage-hero@2x.jpg');
    }
    
    #HomepageBackgroundWithPhoto {
        background-image: url('../images/homepage-hero@2x.jpg');
    }
    
    #ApptClassBackgroundWithPhoto {
        background-image: url('../images/appointment-hero@2x.jpg');
    }
    
    #CustomerClassBackgroundWithPhoto {
        background-image: url('../images/customer-hero@2x.jpg');
    }
}

/* ==========================================================================
   MOBILE-SPECIFIC IMAGE OPTIMIZATIONS
   ========================================================================== */

/* Mobile image optimizations */
@media (max-width: 767px) {
    /* Reduce image complexity on mobile */
    .thumbnail {
        height: 150px;
    }
    
    .gallery-image {
        height: 180px;
    }
    
    .service-icon {
        width: 48px;
        height: 48px;
    }
    
    .profile-image {
        width: 60px;
        height: 60px;
    }
    
    .testimonial-image {
        width: 50px;
        height: 50px;
    }
    
    /* Disable fixed backgrounds on mobile for performance */
    .hero-section,
    #HomepageBackgroundWithPhoto,
    #ApptClassBackgroundWithPhoto,
    #CustomerClassBackgroundWithPhoto {
        background-attachment: scroll !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Image accessibility */
.responsive-image[alt=""],
.thumbnail[alt=""],
.gallery-image[alt=""] {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

/* Focus states for interactive images */
.thumbnail:focus,
.gallery-item:focus,
.service-icon:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    /* Hide decorative images in print */
    .hero-section::before,
    .gallery-item,
    .thumbnail {
        display: none;
    }
    
    /* Ensure essential images print */
    .logo-image,
    .service-icon {
        max-width: 100px;
        height: auto;
    }
    
    /* Remove background images for print */
    .hero-section,
    #HomepageBackgroundWithPhoto,
    #ApptClassBackgroundWithPhoto,
    #CustomerClassBackgroundWithPhoto {
        background-image: none !important;
        min-height: auto;
        color: #000;
    }
}

/* ==========================================================================
   FALLBACKS AND ERROR HANDLING
   ========================================================================== */

/* Fallback for missing background images */
.hero-section:not([style*="background-image"]),
#HomepageBackgroundWithPhoto:not([style*="background-image"]) {
    background: linear-gradient(135deg, #003399, #0066cc);
    color: white;
}

/* Image error handling */
.responsive-image:not([src]),
.thumbnail:not([src]) {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

.responsive-image:not([src])::before,
.thumbnail:not([src])::before {
    content: "Image not available";
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Optimize image rendering */
.responsive-image,
.thumbnail,
.gallery-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* GPU acceleration for transforms */
.thumbnail,
.gallery-item,
.service-icon {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .thumbnail,
    .gallery-item,
    .service-icon,
    .responsive-image {
        transition: none !important;
        transform: none !important;
    }
    
    .hero-section {
        background-attachment: scroll !important;
    }
}