/* ===========================
   RAPIDWEBSOLUTION - RESPONSIVE DESIGN
   Mobile-First Responsive Styles
   =========================== */

/* ===========================
   MOBILE FIRST BASE STYLES
   =========================== */
@media (max-width: 576px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.75rem;
        --font-size-h3: 1.25rem;
        --section-padding: 60px 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Navigation Mobile */
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--box-shadow-large);
        backdrop-filter: blur(20px);
        z-index: var(--z-dropdown);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    /* Hero Mobile */
    .hero {
        min-height: 100vh;
        padding-top: 80px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .device-mockup {
        width: 250px;
        height: 350px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    /* Services Mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
    
    /* Process Mobile */
    .process-timeline::before {
        left: 20px;
    }
    
    .process-step {
        grid-template-columns: auto 1fr;
        gap: 1.5rem;
        text-align: left;
    }
    
    .process-step:nth-child(even) .step-content {
        order: 2;
        text-align: left;
    }
    
    .process-step:nth-child(even) .step-visual {
        order: 3;
    }
    
    .process-step:nth-child(odd) .step-content {
        text-align: left;
    }
    
    .step-visual {
        display: none;
    }
    
    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
    
    /* Portfolio Mobile */
    .before-after {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .portfolio-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* CTA Mobile */
    .cta-features {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Contact Mobile */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ===========================
   TABLET STYLES
   =========================== */
@media (min-width: 577px) and (max-width: 768px) {
    :root {
        --font-size-h1: 2.5rem;
        --font-size-h2: 2rem;
        --section-padding: 80px 0;
    }
    
    /* Hero Tablet */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 2rem;
    }
    
    /* Services Tablet */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .service-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Process Tablet */
    .process-timeline::before {
        left: 30px;
    }
    
    .process-step {
        grid-template-columns: auto 1fr;
        gap: 2rem;
    }
    
    .process-step:nth-child(even) .step-content,
    .process-step:nth-child(odd) .step-content {
        text-align: left;
    }
    
    .step-visual {
        display: none;
    }
    
    /* Portfolio Tablet */
    .before-after {
        gap: 2rem;
    }
    
    .portfolio-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    /* Contact Tablet */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* Footer Tablet */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* ===========================
   SMALL DESKTOP STYLES
   =========================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-container {
        gap: 3rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2.5rem 2rem;
    }
    
    .contact-content {
        gap: 3rem;
    }
}

/* ===========================
   LARGE DESKTOP STYLES
   =========================== */
@media (min-width: 1025px) and (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-container {
        gap: 4rem;
    }
}

/* ===========================
   ULTRA WIDE STYLES
   =========================== */
@media (min-width: 1401px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-container {
        gap: 6rem;
    }
    
    .section-padding {
        --section-padding: 120px 0;
    }
}

/* ===========================
   LANDSCAPE MOBILE STYLES
   =========================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .hero-visual {
        order: 2;
    }
    
    .device-mockup {
        width: 200px;
        height: 280px;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 2rem;
        justify-content: center;
    }
}

/* ===========================
   TOUCH DEVICE OPTIMIZATIONS
   =========================== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 1rem 2rem;
        min-height: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 0;
    }
    
    .service-card:hover::before {
        opacity: 0.05;
    }
    
    .service-card:hover {
        transform: none;
    }
    
    .hover-lift:hover,
    .hover-tilt:hover,
    .hover-scale:hover {
        transform: none;
    }
    
    .contact-method i {
        min-width: 50px;
        min-height: 50px;
    }
}

/* ===========================
   HIGH DPI DISPLAYS
   =========================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===========================
   DARK MODE SUPPORT
   =========================== */
@media (prefers-color-scheme: dark) {
    /* Already implemented in main styles */
}

/* ===========================
   REDUCED MOTION PREFERENCES
   =========================== */
@media (prefers-reduced-motion: reduce) {
    .floating-device,
    .float-animation,
    .float-animation-delay,
    .float-horizontal,
    .rotate-slow,
    .shape {
        animation: none;
    }
    
    .hover-lift:hover,
    .hover-tilt:hover,
    .hover-scale:hover {
        transform: none;
    }
    
    .btn::before {
        display: none;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .navbar,
    .cta,
    .contact,
    .footer {
        display: none;
    }
    
    .hero {
        page-break-after: always;
    }
    
    .section-title,
    .hero-title {
        page-break-after: avoid;
    }
    
    .service-card,
    .process-step {
        page-break-inside: avoid;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
    
    .btn {
        border: 1px solid black;
        text-decoration: none;
    }
}

/* ===========================
   ACCESSIBILITY ENHANCEMENTS
   =========================== */
@media (prefers-contrast: high) {
    :root {
        --text-gray: #cccccc;
        --border-color: rgba(255, 255, 255, 0.3);
    }
    
    .btn-secondary {
        border-color: rgba(255, 255, 255, 0.5);
    }
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
.nav-link:focus-visible,
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===========================
   CONTAINER QUERIES (Future Enhancement)
   =========================== */
@supports (container-type: inline-size) {
    .service-card {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .service-card {
            padding: 1.5rem;
        }
        
        .service-icon {
            width: 60px;
            height: 60px;
            font-size: 1.5rem;
        }
    }
}

/* ===========================
   FLEXIBLE GRID SYSTEMS
   =========================== */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.responsive-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.responsive-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.responsive-flex > * {
    flex: 1;
    min-width: 250px;
}

/* ===========================
   UTILITY CLASSES FOR RESPONSIVE
   =========================== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
}

.text-center-mobile {
    text-align: left;
}

@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* Full width on mobile */
.full-width-mobile {
    width: auto;
}

@media (max-width: 768px) {
    .full-width-mobile {
        width: 100%;
    }
}