/**
 * Responsive Images CSS
 * Styles for Pexels images integration
 */

/* ===================================
   HERO IMAGES
   =================================== */

.hero-image-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    object-fit: cover;
    transition: transform var(--duration-base) var(--timing-ease-in-out);
}

.hero-image:hover {
    transform: scale(1.02);
}

/* Hero image with decorative elements */
.hero-image-wrapper {
    position: relative;
    z-index: 1;
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-info-500));
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0.2;
}

/* ===================================
   SERVICE CARD IMAGES
   =================================== */

.service-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-4);
}

.service-card-image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-4);
}

.service-card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--timing-ease-in-out);
}

.service-card:hover .service-card-image-container img {
    transform: scale(1.1);
}

/* Background images for service cards (low opacity) */
.service-card-with-bg {
    position: relative;
    overflow: hidden;
}

.service-card-with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    z-index: 0;
    transition: opacity var(--duration-base) var(--timing-ease-in-out);
}

.service-card-with-bg:hover::before {
    opacity: 0.12;
}

.service-card-with-bg > * {
    position: relative;
    z-index: 1;
}

/* Eye care background */
.service-card-with-bg.eye-care::before {
    background-image: url('../assets/images/pexels/services/eye-care-bg.jpg');
}

/* Dental care background */
.service-card-with-bg.dental-care::before {
    background-image: url('../assets/images/pexels/services/dental-care-bg.jpg');
}

/* ===================================
   TESTIMONIAL AVATARS
   =================================== */

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 3px solid var(--color-neutral-200);
    object-fit: cover;
    flex-shrink: 0;
}

.testimonial-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-neutral-200);
    object-fit: cover;
}

/* Avatar with glow effect */
.testimonial-avatar-glow {
    box-shadow: 0 0 0 4px var(--color-primary-100);
}

/* ===================================
   DOCTOR PROFILE IMAGES
   =================================== */

.doctor-profile-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--color-neutral-200);
    object-fit: cover;
    margin: 0 auto var(--spacing-4);
    display: block;
    transition: all var(--duration-base) var(--timing-ease-in-out);
}

.doctor-card:hover .doctor-profile-image {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 4px var(--color-primary-100);
    transform: scale(1.05);
}

/* ===================================
   BACKGROUND IMAGES
   =================================== */

.section-with-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.section-with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.section-with-bg > * {
    position: relative;
    z-index: 1;
}

/* ===================================
   LAZY LOADING STATES
   =================================== */

/* Placeholder for loading images */
img[loading="lazy"] {
    background: var(--color-neutral-100);
}

/* Blur-up effect (if using progressive loading) */
.image-loading {
    filter: blur(20px);
    transition: filter var(--duration-slow) var(--timing-ease-out);
}

.image-loaded {
    filter: blur(0);
}

/* ===================================
   IMAGE OVERLAYS
   =================================== */

.image-overlay {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--timing-ease-in-out);
}

.image-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity var(--duration-base) var(--timing-ease-in-out);
}

.image-overlay:hover::after {
    opacity: 1;
}

.image-overlay:hover img {
    transform: scale(1.05);
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .hero-image-container {
        max-width: 100%;
    }

    .hero-image-wrapper::before {
        top: -10px;
        right: -10px;
    }

    .service-card-image {
        height: 180px;
    }

    .doctor-profile-image {
        width: 100px;
        height: 100px;
    }

    /* Disable parallax on mobile */
    .section-with-bg {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    .service-card-image {
        height: 160px;
    }

    .testimonial-avatar {
        width: 64px;
        height: 64px;
        border-width: 2px;
    }

    .doctor-profile-image {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .hero-image,
    .service-card-image-container img,
    .doctor-profile-image,
    .image-overlay img {
        transition: none;
    }

    .section-with-bg {
        background-attachment: scroll;
    }
}

/* Focus states for keyboard navigation */
img:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .hero-image,
    .service-card-image,
    .doctor-profile-image,
    .testimonial-avatar {
        box-shadow: none;
        border: 1px solid var(--color-neutral-300);
    }
}
