/* Enhanced Mobile Responsiveness & Image Styles */

/* Service Showcase Section */
.service-showcase {
    background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-white) 100%);
}

.showcase-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.showcase-item {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.showcase-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.showcase-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.showcase-content {
    padding: var(--space-5);
}

.showcase-content h3 {
    font-size: var(--text-xl);
    color: var(--color-primary);
    margin-bottom: var(--space-2);
    font-weight: var(--font-semibold);
}

.showcase-content p {
    color: var(--color-gray-600);
    line-height: 1.6;
    margin: 0;
}

.showcase-cta {
    text-align: center;
    padding: var(--space-8);
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.showcase-cta-text {
    font-size: var(--text-2xl);
    color: var(--color-primary);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-4);
}

/* Hero Background Image */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/hero-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Card Images */
.card {
    position: relative;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-4) calc(var(--space-4) * -1);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

/* Enhanced Mobile Styles - Base (320px+) */
@media (max-width: 374px) {
    :root {
        --container-padding: 1rem;
        --text-4xl: 1.75rem; /* 28px */
        --text-5xl: 2.25rem; /* 36px */
    }
    
    .hero-title {
        font-size: var(--text-4xl);
        line-height: 1.2;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: var(--text-sm);
    }
    
    .card-image {
        height: 160px;
    }
}

/* iPhone SE, iPhone 6/7/8 (375px - 413px) */
@media (min-width: 375px) and (max-width: 413px) {
    .hero-title {
        font-size: 2rem; /* 32px */
    }
    
    .card-image {
        height: 180px;
    }
    
    .service-card {
        padding: var(--space-5);
    }
}

/* iPhone 12/13/14 Pro, iPhone X/XS (414px - 479px) */
@media (min-width: 414px) and (max-width: 479px) {
    .hero-title {
        font-size: 2.25rem; /* 36px */
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    .card-image {
        height: 190px;
    }
}

/* Large Mobile / Small Phablet (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .grid-3 {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    
    .hero-cta {
        flex-direction: row;
        gap: var(--space-4);
    }
    
    .card-image {
        height: 200px;
    }
}

/* Phablet / Small Tablet Portrait (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .grid-3 {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .service-tiers {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero-content {
        max-width: 600px;
    }
    
    .card-image {
        height: 220px;
    }
    
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    .showcase-image {
        height: 200px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--space-6);
    }
    
    .service-tiers {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-xl);
    }
    
    .card-image {
        height: 200px;
    }
    
    /* Two column layout for tablets */
    .faq-grid {
        grid-template-columns: 1fr;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
    
    .showcase-image {
        height: 220px;
    }
}

/* iPad Mini/Air Portrait (810px - 1023px) */
@media (min-width: 810px) and (max-width: 1023px) {
    .service-tiers {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }
    
    .service-card {
        padding: var(--space-5);
    }
}

/* Desktop / Laptop (1024px - 1279px) */
@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-8);
    }
    
    .service-tiers {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
    
    .hero-title {
        font-size: var(--text-6xl);
    }
    
    .card-image {
        height: 220px;
    }
    
    .showcase-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
    
    .showcase-image {
        height: 240px;
    }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .card-image {
        height: 240px;
    }
    
    .service-card {
        padding: var(--space-8);
    }
    
    .showcase-image {
        height: 260px;
    }
}

/* Landscape Mode Optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: var(--space-6) 0;
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .section {
        padding: var(--space-8) 0;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: var(--space-4);
    }
    
    /* Remove hover effects on touch devices */
    .card:hover .card-image img {
        transform: none;
    }
    
    .card:active .card-image img {
        transform: scale(0.98);
    }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .hero-bg-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .header,
    .hero-cta,
    .btn,
    .nav-toggle {
        display: none;
    }
    
    .hero {
        background: white;
        color: black;
    }
    
    .card-image {
        page-break-inside: avoid;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .card-image img,
    .hero-bg-image {
        transition: none;
        animation: none;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Currently not implemented, but structure ready */
}

/* Specific Android Device Optimizations */
@media (max-width: 767px) {
    /* Android Chrome address bar handling */
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* Prevent text size adjustment on orientation change */
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* iPad Pro Landscape & Desktop Tablets */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .container {
        max-width: 1200px;
    }
    
    .grid-3 {
        gap: var(--space-6);
    }
}

/* Ultra-wide Displays (1440px+) */
@media (min-width: 1440px) {
    .hero-content {
        max-width: 1400px;
    }
    
    .card-image {
        height: 260px;
    }
}
