/* Mobile-First Responsive Enhancements */

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .cta-button,
    .login-button-white {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    .hamburger {
        min-height: 44px;
        min-width: 44px;
    }
    
    .faq-question {
        min-height: 44px;
        padding: 1rem;
    }
}

/* Improved tap targets for mobile */
@media (max-width: 768px) {
    .nav-menu a {
        min-height: 48px;
        padding: 1rem;
        display: flex;
        align-items: center;
    }
    
    .dropdown-menu a {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .btn,
    .cta-button {
        min-height: 48px;
        padding: 1rem 2rem;
        font-size: 1rem;
        border-radius: 12px;
    }
}

/* Enhanced mobile typography */
@media (max-width: 768px) {
    .gradient-text {
        background-size: 100% 100%;
        -webkit-background-clip: text;
        background-clip: text;
    }
    
    .hero-title {
        font-size: 5rem !important;
        line-height: 1.1 !important;
        font-weight: 800 !important;
    }
    
    .hero-title .gradient-text {
        font-size: inherit;
        line-height: inherit;
    }
    
    p, .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .service-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Mobile-optimized cards */
@media (max-width: 768px) {
    .service-card-modern,
    .feature-modern,
    .team-member {
        border-radius: 16px;
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-card {
        border-radius: 20px;
        padding: 2rem 1.5rem;
        margin: 1rem auto;
    }
    
    .main-card {
        max-width: 90%;
        margin: 0 auto;
    }
}

/* Improved mobile navigation */
@media (max-width: 768px) {
    .navbar {
        height: 70px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .nav-container {
        height: 70px;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo h2 {
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
    }
    
    /* Hide hamburger menu */
    .hamburger {
        display: none !important;
    }
    
    /* Hide mobile navigation menu */
    .nav-menu {
        display: none !important;
    }
    
    /* Hide login button on mobile */
    .login-button-white {
        display: none !important;
    }
    
    /* Make CTA button smaller and contained */
    .cta-button {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        min-height: 36px !important;
        white-space: nowrap;
        max-width: 120px;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    
    /* Adjust nav-actions to accommodate smaller button */
    .nav-actions {
        gap: 0.5rem;
        align-items: center;
    }
}

/* Mobile form improvements */
@media (max-width: 768px) {
    .contact-modern {
        padding: 2rem 0;
    }
    
    .contact-form {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 20px;
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        border-radius: 12px;
        border: 2px solid #e5e7eb;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-modern {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .hero-container {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }
    
    .hero-content {
        flex: 1;
        text-align: left;
    }
    
    .hero-visual {
        flex: 0 0 auto;
        margin: 0;
    }
    
    .main-card {
        max-width: 280px;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .container {
        padding: 0 12px;
    }
    
    .nav-container {
        padding: 0 12px;
    }
    
    .hero-title {
        font-size: 3.5rem !important;
        font-weight: 800 !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .main-card {
        max-width: 95%;
        padding: 1.5rem 1rem;
    }
    
    .service-card-modern {
        padding: 1.25rem;
    }
}

/* Safe area handling for newer iPhones */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .nav-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .footer-minimal {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-background::before,
    .hero-background::after,
    .floating-blob {
        animation: none !important;
    }
    
    .animate-float {
        animation: none !important;
    }
    
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .service-card-modern,
    .feature-modern,
    .hero-card {
        border: 2px solid var(--gray-800);
    }
    
    .btn,
    .cta-button {
        border: 2px solid currentColor;
    }
}