/* Services Section Styles */
.services-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23dee2e6" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.services-section .container {
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Mobile-First Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 576px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
        margin-top: 3rem;
    }
}

@media (min-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 30px;
        margin-top: 50px;
    }
}

/* Service Card */
.service-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Service Icon */
.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.service-card:hover .service-icon {
    transform: rotateY(360deg) scale(1.1);
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Service Content */
.service-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.service-card:hover .service-title {
    color: #3b82f6;
}

.service-description {
    color: #6c757d;
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Mobile-First Responsive Design */
@media (max-width: 575px) {
    .services-section {
        padding: 3rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .services-grid {
        margin-top: 2rem;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
        border-radius: 1rem;
        margin: 0;
        min-height: 280px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .service-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .service-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Disable hover effects on mobile */
    .service-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    .service-card:hover .service-icon {
        transform: none;
    }
    
    .service-card:hover .service-title {
        color: #2c3e50;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .services-section {
        padding: 4rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    .service-card {
        padding: 2.5rem 2rem;
        border-radius: 1.25rem;
    }
    
    .service-icon {
        width: 75px;
        height: 75px;
        font-size: 1.9rem;
    }
    
    .service-title {
        font-size: 1.35rem;
    }
}

@media (min-width: 992px) {
    .services-section {
        padding: 80px 0;
    }
    
    .section-header {
        margin-bottom: 60px;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.2rem;
    }
    
    .service-card {
        padding: 40px 30px;
        border-radius: 20px;
    }
    
    .service-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .service-title {
        font-size: 1.4rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .service-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .service-card:active {
        transform: scale(0.98);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }
    
    .service-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    .service-card:hover .service-icon {
        transform: none;
        background: linear-gradient(135deg, #3b82f6, #10b981);
    }
    
    .service-card:hover .service-title {
        color: #2c3e50;
    }
}

/* Improved accessibility for mobile */
@media (max-width: 575px) {
    .service-card {
        border: 2px solid transparent;
        transition: border-color 0.3s ease;
    }
    
    .service-card:focus-within {
        border-color: var(--vitabex-primary);
        outline: none;
    }
    
    .service-title {
        font-weight: 600;
    }
    
    .service-description {
        color: #495057;
    }
}

/* Animation for cards appearing - Fixed to prevent initial hiding */
.service-card {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}