/* 
 * Responsive Stylesheet for Ritika Verma Makeup Artist Website
 * Enhanced mobile-first approach with premium feminine aesthetics
 */

/* Base Mobile Optimizations (below 576px) */
@media (max-width: 575.98px) {
    /* Font size adjustments for better readability */
    html {
        font-size: 15px;
    }
    
    /* Header optimizations */
    .header-container {
        padding: 12px 15px;
    }
    
    .logo img {
        height: 40px;
    }
    
    /* Hero section adjustments */
    .hero {
        margin-top: 70px;
    }
    
    .hero-image {
        height: 350px;
    }
    
    .hero-content {
        padding: 0 15px;
    }
    
    /* Section padding adjustments */
    .section {
        padding: 3rem 0;
    }
    
    /* Service cards */
    .service-card {
        margin-bottom: 15px;
    }
    
    /* Form elements for better touch */
    .form-control {
        padding: 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Instagram grid optimization */
    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    /* WhatsApp button for easier access */
    .whatsapp-btn {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
    
    /* Testimonial adjustments */
    .testimonial {
        padding: 20px 15px;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    /* Footer elements */
    .footer {
        padding: 3rem 0 1rem;
    }
    
    .social-icon {
        margin: 0 12px;
    }
    
    /* Navigation for improved touch targets */
    .nav-item {
        margin-bottom: 15px;
    }
    
    .nav-link {
        padding: 10px 0;
        display: block;
    }
    
    /* Page header adjustment */
    .page-header {
        padding: 100px 0 50px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    /* Service grid switches to 2 columns */
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Contact info cards */
    .contact-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Instagram stays at 3 columns but with better spacing */
    .instagram-grid {
        gap: 10px;
    }
    
    /* Before-After Section */
    .before-after-images {
        display: flex;
    }
    
    .before-image, .after-image {
        flex: 1;
    }
    
    /* Portfolio filtering */
    .portfolio-categories a {
        margin: 0 5px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    
    .header-container {
        padding: 18px 20px;
    }
    
    .logo img {
        height: 50px;
    }
    
    /* Hero section changes to side-by-side layout */
    .hero {
        min-height: 550px;
    }
    
    .hero-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }
    
    .hero-image-container {
        width: 50%;
        margin-bottom: 0;
        margin-right: 30px;
    }
    
    .hero-image {
        height: 450px;
    }
    
    .hero-content {
        width: 45%;
        text-align: left;
        padding: 0;
    }
    
    /* About section layout */
    .about-container {
        flex-direction: row;
    }
    
    .about-img {
        width: 40%;
        margin-right: 30px;
        margin-bottom: 0;
    }
    
    .about-content {
        width: 55%;
        text-align: left;
    }
    
    /* Timeline layout returns to centered */
    .timeline:before {
        left: 50%;
    }
    
    .timeline-item:nth-child(odd) {
        text-align: right;
    }
    
    .timeline-item:nth-child(even) {
        text-align: left;
    }
    
    .timeline-content {
        width: calc(50% - 30px);
    }
    
    .timeline-item:nth-child(odd) .timeline-content {
        margin-right: 60px;
        margin-left: 0;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 60px;
        margin-right: 0;
    }
    
    .timeline-dot {
        left: 50%;
    }
    
    .timeline-item:nth-child(odd) .timeline-connector {
        right: 50%;
        left: auto;
    }
    
    .timeline-item:nth-child(even) .timeline-connector {
        left: 50%;
        right: auto;
    }
    
    /* Instagram profile */
    .instagram-profile {
        flex-direction: row;
        text-align: left;
        padding: 25px;
    }
    
    .instagram-profile-img {
        margin-bottom: 0;
        margin-right: 20px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Navigation menu shows horizontally */
    .nav-toggle {
        display: none !important;
    }
    
    .nav {
        position: static;
        height: auto;
        width: auto;
        background: none;
        overflow: visible;
        box-shadow: none;
    }
    
    .nav-list {
        display: flex;
        padding: 0;
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-item {
        margin: 0 0 0 25px;
        text-align: left;
    }
    
    .nav-link {
        padding: 0;
        font-size: 0.95rem;
    }
    
    /* Hero section enhancements */
    .hero {
        min-height: 650px;
    }
    
    .hero-image-container {
        width: 55%;
    }
    
    .hero-image {
        height: 550px;
    }
    
    .hero-content {
        width: 40%;
    }
    
    /* Service grid goes to 3 columns */
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    /* Contact layout changes */
    .contact-container {
        flex-direction: row;
    }
    
    .contact-form {
        width: 60%;
    }
    
    .contact-info-grid {
        width: 35%;
        grid-template-columns: 1fr;
        margin-top: 0;
        margin-left: 5%;
    }
    
    /* Testimonials can display side by side */
    .testimonials-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* Gallery layout */
    .photo-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Footer layout changes */
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .footer-logo, .footer-nav, .social-icons {
        margin-bottom: 0;
    }
    
    .copyright {
        width: 100%;
        margin-top: 3rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        padding: 0 30px;
    }
    
    /* Maximum hero impact */
    .hero {
        min-height: 700px;
    }
    
    .hero-image {
        height: 600px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 2rem;
    }
    
    .section {
        padding: 5rem 0;
    }
    
    .nav-item {
        margin-left: 30px;
    }
    
    /* Even larger gallery */
    .photo-gallery {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Ensure portrait orientation on mobile works well */
@media (max-width: 767.98px) and (orientation: portrait) {
    /* Adjust hero image height to not take too much vertical space */
    .hero-image {
        height: 300px;
    }
    
    /* Keep buttons prominent */
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Make Instagram grid more compact */
    .instagram-grid {
        gap: 5px;
    }
}

/* Landscape orientation adjustments for small devices */
@media (max-width: 767.98px) and (orientation: landscape) {
    /* Optimize hero for landscape view */
    .hero-container {
        flex-direction: row;
        padding: 20px 0;
    }
    
    .hero-image-container {
        width: 40%;
        margin-bottom: 0;
    }
    
    .hero-content {
        width: 55%;
        text-align: left;
    }
    
    /* Adjust navigation for landscape */
    .nav.active {
        height: 80vh;
    }
}

/* High pixel density screens (Retina) */
@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi) {
    /* Ensure images stay crisp */
    .logo img,
    .hero-image,
    .instagram-profile-img img {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Support for reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .loading-spinner:before,
    .loading-spinner:after {
        animation: none !important;
    }
}

/* Dark mode support (if user prefers it) */
@media (prefers-color-scheme: dark) {
    .nav,
    .header,
    .footer {
        /* These elements will maintain their design regardless of system preference */
    }
}

/* Touch-specific optimizations */
@media (hover: none) {
    /* Make buttons larger for touch */
    .btn {
        padding: 14px 30px;
    }
    
    /* Increase spacing between clickable elements */
    .nav-item {
        margin-bottom: 20px;
    }
    
    /* Show Instagram overlay by default */
    .instagram-overlay {
        opacity: 0.7;
    }
}

/* Special behavior for iPhone X and newer with notch */
@supports (padding: max(0px)) {
    .header, 
    .whatsapp-btn {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .whatsapp-btn {
        bottom: max(15px, env(safe-area-inset-bottom));
    }
}