/* Connect Africa - Responsive Enhancements */

/* Mobile-First Responsive Design */

/* Small Mobile Devices (320px - 480px) */
@media screen and (max-width: 480px) {
    /* Typography Adjustments */
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Button Adjustments */
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        text-align: center;
    }

    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem;
    }

    .mobile-menu-button {
        padding: 0.5rem;
    }

    /* Grid Adjustments */
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Service Cards */
    .service-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem !important;
    }

    .service-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }

    /* Form Improvements */
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-input {
        padding: 0.875rem;
        font-size: 1rem;
    }

    .form-submit-btn {
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    /* Spacing Adjustments */
    .section-padding {
        padding: 3rem 1rem;
    }

    .container-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Contact Info Cards */
    .contact-info-card {
        margin-bottom: 1rem;
        padding: 1.5rem;
    }

    /* Technology Section */
    .tech-feature {
        text-align: center;
        margin-bottom: 2rem;
    }

    .tech-icon {
        margin: 0 auto 1rem;
    }
}

/* Medium Mobile Devices (481px - 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
    /* Typography */
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
    }

    .section-title {
        font-size: 2.5rem;
    }

    /* Grid Layouts */
    .grid-responsive-md {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Service Cards */
    .service-cards-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Form Layout */
    .form-grid-md {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Contact Section */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Technology Features */
    .tech-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Tablet Devices (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Hero Section */
    .hero-content {
        padding: 4rem 2rem;
    }

    .hero-title {
        font-size: 3rem;
        line-height: 1.2;
    }

    /* Grid Adjustments */
    .grid-responsive-lg {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .service-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Navigation */
    .desktop-nav {
        display: none;
    }

    .mobile-nav-toggle {
        display: block;
    }

    /* Form Layout */
    .form-container {
        max-width: 600px;
        margin: 0 auto;
    }

    /* Content Spacing */
    .section-padding {
        padding: 4rem 2rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger Touch Targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.5rem;
    }

    .nav-link {
        padding: 1rem 0.75rem;
    }

    .form-input {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .mobile-menu-item {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Remove Hover Effects */
    .service-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    /* Focus Styles for Touch */
    .btn:focus,
    .form-input:focus,
    .nav-link:focus {
        outline: 2px solid #FF6B35;
        outline-offset: 2px;
    }
}

/* Landscape Mobile Orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
    /* Reduce Hero Height */
    .hero-section {
        min-height: 100vh;
        padding: 2rem 0;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    /* Compact Navigation */
    .navbar {
        height: 3rem;
    }

    .navbar-content {
        height: 3rem;
    }

    /* Adjust Sections */
    .section-padding {
        padding: 2rem 1rem;
    }
}

/* High DPI Displays */
@media screen and (min-resolution: 2dppx) {
    /* Crisp Icons */
    .service-icon,
    .tech-icon,
    .contact-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Sharper Images */
    .hero-image,
    .tech-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Responsive */
@media (prefers-color-scheme: dark) {
    @media (max-width: 768px) {
        /* Dark Mode Mobile Adjustments */
        .mobile-menu {
            background-color: #1f2937;
            border-color: #374151;
        }

        .mobile-menu-item {
            color: #f9fafb;
            border-bottom-color: #374151;
        }

        .form-container {
            background-color: #1f2937;
        }

        .form-input {
            background-color: #374151;
            border-color: #4b5563;
            color: #f9fafb;
        }
    }
}

/* Reduced Motion Responsive */
@media (prefers-reduced-motion: reduce) {
    @media (max-width: 768px) {
        /* Remove Animations on Mobile for Better Performance */
        .animate-on-scroll,
        .service-card,
        .tech-feature {
            animation: none !important;
            transition: none !important;
        }

        /* Keep Essential Focus Transitions */
        .form-input:focus,
        .btn:focus {
            transition: box-shadow 0.2s ease;
        }
    }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS Safari Viewport Issues */
    .hero-section {
        min-height: -webkit-fill-available;
    }

    /* Fix iOS Input Styling */
    .form-input {
        -webkit-appearance: none;
        border-radius: 0.5rem;
    }

    /* Fix iOS Button Styling */
    .btn {
        -webkit-appearance: none;
        border-radius: 0.5rem;
    }
}

/* Print Responsive */
@media print {
    @page {
        margin: 1in;
        size: A4;
    }

    /* Mobile-First Print Layout */
    .hero-section,
    .contact-section {
        page-break-inside: avoid;
    }

    .service-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    /* Single Column Print Layout */
    .grid-responsive,
    .grid-responsive-md,
    .grid-responsive-lg {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Hide Interactive Elements */
    .btn,
    .form-container,
    .mobile-menu-button {
        display: none !important;
    }

    /* Optimize Text for Print */
    .hero-title {
        font-size: 2rem;
        color: #000 !important;
    }

    .section-title {
        font-size: 1.5rem;
        color: #000 !important;
    }
}

/* Accessibility Responsive */
@media (prefers-contrast: high) {
    @media (max-width: 768px) {
        /* High Contrast Mobile */
        .btn {
            border: 2px solid currentColor;
        }

        .form-input {
            border: 2px solid currentColor;
        }

        .service-card {
            border: 2px solid currentColor;
        }
    }
}

/* Custom Breakpoint for Large Mobile */
@media screen and (min-width: 375px) and (max-width: 480px) {
    /* iPhone Plus / Large Android Phones */
    .hero-title {
        font-size: 2.25rem;
    }

    .service-card {
        padding: 2rem;
    }

    .form-container {
        padding: 2rem;
        margin: 0.5rem;
    }
}

/* Utilities for Responsive Design */
.mobile-only {
    display: block;
}

.tablet-up {
    display: none;
}

.desktop-only {
    display: none;
}

@media screen and (min-width: 769px) {
    .mobile-only {
        display: none;
    }

    .tablet-up {
        display: block;
    }
}

@media screen and (min-width: 1025px) {
    .desktop-only {
        display: block;
    }
}

/* Performance Optimizations for Mobile */
@media (max-width: 768px) {
    /* Reduce Complex Shadows */
    .shadow-lg {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .shadow-xl {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    /* Simplify Gradients on Mobile */
    .bg-gradient-to-br {
        background: var(--tw-gradient-stops);
    }

    /* Reduce Border Radius for Better Performance */
    .rounded-2xl {
        border-radius: 1rem;
    }
}