/* Mobile-specific optimizations for CodeAlves website */

/* Touch-friendly improvements */
@media (max-width: 767px) {
    /* Improve touch targets */
    button, 
    input[type="submit"], 
    input[type="button"], 
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .py-20 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-16 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .py-12 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Improve mobile navigation */
    #main-header {
        padding: 0.75rem 0;
    }
    
    #main-header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile menu improvements */
    #mobile-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: #f6f4f0;
        border-top: 1px solid #eae8e4;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 40;
    }
    
    #mobile-menu a {
        display: block;
        padding: 1rem 1.5rem;
        color: #575757;
        border-bottom: 1px solid #eae8e4;
        transition: background-color 0.2s ease;
    }
    
    #mobile-menu a:hover {
        background-color: #f0f0f0;
        color: #222;
    }
    
    /* Hero section mobile */
    #hero {
        padding-top: 1rem;
        padding-bottom: 2rem;
        text-align: center;
    }
    
    #hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    #hero p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    /* Mobile buttons */
    .cta-button {
        display: block;
        width: 100%;
        padding: 1rem;
        margin-bottom: 1rem;
        text-align: center;
        font-size: 1.1rem;
        border-radius: 0.5rem;
    }
    
    /* Mobile form improvements */
    #contact-form {
        padding: 1rem;
    }
    
    #contact-form input,
    #contact-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #d1d5db;
    }
    
    #contact-form label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* Mobile grid improvements */
    .grid-cols-1 {
        gap: 1rem;
    }
    
    .md\\:grid-cols-2,
    .md\\:grid-cols-3,
    .lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    /* Mobile cards */
    .bg-card-light,
    .bg-card-dark {
        padding: 1.5rem;
        margin-bottom: 1rem;
        border-radius: 1rem;
    }
    
    /* Mobile images */
    img {
        max-width: 100%;
        height: auto;
        border-radius: 0.5rem;
    }
    
    /* Mobile text improvements */
    h2 {
        font-size: 1.875rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* Mobile service cards */
    .service-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .service-card .icon-container {
        width: 3rem;
        height: 3rem;
        margin: 0 auto 1rem;
    }
    
    /* Mobile project cards */
    .project-card img {
        height: 200px;
        object-fit: cover;
    }
    
    /* Mobile statistics */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stats-grid > div {
        text-align: center;
        padding: 1rem;
    }
    
    /* Mobile logo scroller */
    .logo-scroller {
        margin: 1rem 0;
    }
    
    .logo-scroller-inner img {
        height: 1.5rem;
        margin: 0 1rem;
    }
    
    /* Mobile FAQ */
    .faq-item {
        margin-bottom: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .faq-item summary {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-item p {
        padding: 0 1rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Mobile footer */
    footer {
        padding: 2rem 0 1rem;
    }
    
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    /* Mobile WhatsApp button */
    .fixed.bottom-8.right-6 {
        bottom: 1rem;
        right: 1rem;
        width: 3.5rem;
        height: 3.5rem;
    }
    
    /* Mobile animations - faster on mobile */
    .animate-on-scroll {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .animate-on-scroll.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .md\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #hero h1 {
        font-size: 3rem;
    }
}

/* Large mobile devices */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    #hero h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .cta-button {
        padding: 0.875rem;
        font-size: 1rem;
    }
}

/* Landscape mobile */
@media (max-width: 767px) and (orientation: landscape) {
    #hero {
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
    
    #hero h1 {
        font-size: 1.75rem;
    }
    
    .py-20 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp images on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .logo-scroller-inner {
        animation: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can go here */
}
