/* General responsive image styles */
img {
    max-width: 100%;
    height: auto;
}

/* Target all icons to ensure proper sizing on mobile */
i.fas, i.fab, i.far, i.fa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure all form elements are properly sized on mobile */
input, textarea, button {
    max-width: 100%;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* Improve touch targets for mobile */
.btn, 
nav a,
.info-item a,
input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fix overflow issues on mobile */
.container {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* Fix for footer items alignment */
.social-link-item h4 {
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
}

.social-link-item p, 
.social-link-item a {
    margin: 0;
    text-align: center;
}

/* Special styling for the bottom social icons */
@media (max-width: 480px) {
    .social-link-item:nth-child(4),
    .social-link-item:nth-child(5) {
        text-align: center;
    }
    
    .social-link-item:nth-child(4) h4,
    .social-link-item:nth-child(5) h4 {
        font-size: 0.9rem;
    }
}

/* Ensure service and about cards always have shadow */
.service-card, 
.about-card {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.service-card:hover, 
.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Footer spacing and alignment fixes */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto;
}

.social-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Responsive footer styling */
@media (max-width: 768px) and (min-width: 481px) {
    .social-links {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        justify-content: center;
    }
    
    .social-link-item {
        min-width: 120px;
        margin-bottom: 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .social-links {
        gap: 1.2rem;
    }
    
    .social-link-item {
        margin-bottom: 0.8rem;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 0 15px;
    }
    
    .footer-content {
        margin-bottom: 1.5rem;
    }
    
    .social-link-item h4 {
        margin-bottom: 0.4rem;
    }
    
    .social-links .social-icon {
        width: 50px;
        height: 50px;
    }
    
    /* First three items stacked */
    .social-link-item:nth-child(1),
    .social-link-item:nth-child(2),
    .social-link-item:nth-child(3) {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Fix for very small screens */
@media (max-width: 350px) {
    .social-link-item {
        width: 100%;
        padding: 0 20px;
        margin: 0 auto 1.5rem;
    }
    
    /* Better padding for address text */
    .location-item p,
    .social-link-item:first-child p,
    .address-text {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

/* Mobile-only social icons fix */
@media (max-width: 480px) {
    /* Create centered row for LinkedIn and Email only on mobile */
    .social-links {
        text-align: center;
    }
    
    .social-link-item:nth-child(4),
    .social-link-item:nth-child(5) {
        display: inline-block;
        vertical-align: top;
        width: 40%;
        max-width: 150px;
        margin: 0.5rem 4%;
    }
    
    /* Force their parent container to create a separate row */
    .social-link-item:nth-child(3) {
        margin-bottom: 1.5rem;
    }
    
    /* Ensure social icons are properly centered */
    .social-link-item:nth-child(4) .social-icon,
    .social-link-item:nth-child(5) .social-icon {
        margin: 0 auto;
    }
}

/* Even smaller screens */
@media (max-width: 350px) {
    .social-link-item:nth-child(4),
    .social-link-item:nth-child(5) {
        width: 40%;
        margin: 0.5rem 3%;
    }
}
