/* Expertise Cards with Images */
.expertise-card {
    height: 350px;
    /* Fixed height for all cards */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
}

.expertise-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.expertise-image {
    position: relative;
    height: 100%;
    /* Take full height of the card */
    flex: 1;
    /* Allow image to expand to fill available space */
    overflow: hidden;
}

.expertise-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.expertise-card:hover .expertise-image img {
    transform: scale(1.1);
}

.expertise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 132, 196, 0.8) 0%, rgba(44, 76, 114, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    /* Always visible by default */
    transition: opacity 0.3s ease;
}

.expertise-content {
    text-align: center;
    padding: 2rem;
    color: white;
}

.expertise-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.expertise-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* Removed old default positioning since overlay is now always visible */

/* Primary color background patterns for expertise cards */
.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0.1;
    z-index: 1;
    border-radius: 15px;
}

/* Alternative background patterns */
.expertise-card:nth-child(1)::before {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0.15;
}

.expertise-card:nth-child(2)::before {
    background: radial-gradient(circle at center, var(--primary-color) 0%, transparent 70%);
    opacity: 0.12;
}

.expertise-card:nth-child(3)::before {
    background: linear-gradient(45deg, var(--primary-color) 25%, transparent 25%),
        linear-gradient(-45deg, var(--primary-color) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--primary-color) 75%),
        linear-gradient(-45deg, transparent 75%, var(--primary-color) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.1;
}

/* Additional card enhancements */
.expertise-card {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Enhanced hover effects for background patterns */
.expertise-card:hover::before {
    opacity: 0.2;
    transition: opacity 0.3s ease;
}


/* Improved text readability for always-visible overlay */
.expertise-title {
    background: rgba(44, 76, 114, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
}

/* Using existing section classes from index.php for consistency */

/* Responsive adjustments */
@media (max-width: 768px) {
    .expertise-card {
        height: 300px;
        /* Maintain equal height on tablets */
    }

    .expertise-title {
        font-size: 1.2rem;
        padding: 6px 12px;
    }

    .expertise-description {
        font-size: 0.9rem;
    }

    .expertise-content {
        padding: 1.5rem;
    }

    /* Adjust pattern sizes for mobile */
    .section:nth-of-type(2) {
        background-size: 40px 40px;
        background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    }
}

@media (max-width: 576px) {
    .expertise-card {
        height: 280px;
        /* Maintain equal height on mobile */
    }

    .expertise-title {
        font-size: 1.1rem;
        padding: 4px 8px;
    }

    .expertise-description {
        font-size: 0.85rem;
    }

    /* Further adjust patterns for small mobile */
    .section:nth-of-type(2) {
        background-size: 30px 30px;
        background-position: 0 0, 0 15px, 15px -15px, -15px 0px;
    }
}