/* Services Section */
.services {
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
    margin-bottom: 0;
}

.cards-grid {
    display: flex;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem; /* Added vertical padding */
}

.card-item {
    flex: 1;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 250, 252, 0.9) 50%,
        rgba(241, 245, 249, 0.95) 100%);
    padding: 2rem 1rem 2.5rem 1rem;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.6s ease-out forwards;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem;
}

/* Plastified effect */
.card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%,
        transparent 30%,
        transparent 70%,
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

/* Hover effect - highlight selected, dim others */
.cards-grid:hover .card-item {
    opacity: 0.4;
    transform: scale(0.95);
    filter: grayscale(0.3);
}

.cards-grid .card-item:hover {
    opacity: 1 !important;
    transform: scale(1.05) !important;
    filter: grayscale(0) !important;
    box-shadow: 
        0 20px 60px rgba(0, 71, 255, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 71, 255, 0.3);
    transition: all 3s cubic-bezier(.25,1,.5,1);
}

.card-item:nth-child(1) { animation-delay: 0.1s; }
.card-item:nth-child(2) { animation-delay: 0.2s; }
.card-item:nth-child(3) { animation-delay: 0.3s; }
.card-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-item.glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.card-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 71, 255, 0.15);
}

.card-item:hover::before {
    left: 100%;
}

/* Icon container - fixed height */
.card-item i,
.card-item i[data-lucide],
.card-item svg {
    font-size: 3.5rem !important;
    color: var(--color-primary) !important;
    margin: 0;
    transition: all 0.4s ease !important;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.cards-grid .card-item:hover i,
.cards-grid .card-item:hover i[data-lucide],
.cards-grid .card-item:hover svg {
    transform: translateY(-4px) scale(1.15) !important;
    color: var(--color-accent) !important;
    filter: drop-shadow(0 4px 8px rgba(0, 71, 255, 0.3));
    transition: all 3s cubic-bezier(.25,1,.5,1);
}

/* Title container - fixed height */
.card-item h3 {
    font-size: 1.6rem;
    margin: 0;
    color: var(--color-text);
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cards-grid .card-item:hover h3 {
    color: var(--color-primary);
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(0, 71, 255, 0.2);
}

/* Description container - fixed height */
.card-item p {
    color: var(--color-neutral-700);
    margin: 0;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    line-height: 1.6;
    font-size: 1rem;
    text-align: center;
    width: 100%;
    max-width: 280px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cards-grid .card-item:hover p {
    color: var(--color-neutral-600);
    transform: translateY(-1px);
}

/* Services: background images per card with dim overlay */
.services .card-item { position: relative; overflow: hidden; }
.services .card-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}
.services .cards-grid .card-item:nth-child(1)::after {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('../../assets/banner_1.webp');
}
.services .cards-grid .card-item:nth-child(2)::after {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('../../assets/banner_2.webp');
}
.services .cards-grid .card-item:nth-child(3)::after {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('../../assets/banner_3.webp');
}
.services .cards-grid .card-item:nth-child(4)::after {
    background-image: linear-gradient(0deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('../../assets/banner_4.webp');
}

/* Services: make text light over background images */
.services .card-item h3 {
    color: rgba(255,255,255,0.98) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.services .card-item p {
    color: rgba(255,255,255,0.92) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Services: shift blue accents to orange inside banners */
.services .card-item i,
.services .card-item i[data-lucide],
.services .card-item svg {
    color: var(--color-highlight) !important;
}

.services .cards-grid .card-item:hover i,
.services .cards-grid .card-item:hover i[data-lucide],
.services .cards-grid .card-item:hover svg {
    color: var(--color-highlight) !important;
    filter: drop-shadow(0 4px 8px rgba(255, 164, 0, 0.35));
}

.services .cards-grid .card-item:hover h3 {
    color: var(--color-highlight) !important;
    text-shadow: 0 2px 4px rgba(255,164,0,0.28);
}

.services .badge {
    background: linear-gradient(135deg, rgba(255, 164, 0, 0.18), rgba(255, 164, 0, 0.10));
    color: var(--color-highlight);
    border: 1px solid rgba(255, 164, 0, 0.45);
    box-shadow: 0 2px 8px rgba(255, 164, 0, 0.12);
}

.services .cards-grid .card-item:hover .badge {
    background: linear-gradient(135deg, rgba(255, 164, 0, 0.28), rgba(255, 164, 0, 0.18));
    border-color: rgba(255, 164, 0, 0.6);
    box-shadow: 0 6px 16px rgba(255, 164, 0, 0.28);
}

/* Mobile optimization for Services */
@media (max-width: 768px) {
    .cards-grid {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .card-item {
        flex-direction: row;
        align-items: center;
        min-height: auto;
        padding: 1rem;
        gap: 1rem;
        text-align: left;
    }

    /* Icon smaller and on the left */
    .card-item i,
    .card-item i[data-lucide],
    .card-item svg {
        font-size: 2rem !important;
        height: 40px;
        width: 40px;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }

    /* Wrap content in a div to stack title/desc/badges */
    .card-item h3 {
        height: auto;
        width: auto;
        justify-content: flex-start;
        font-size: 1.2rem;
        text-align: left;
        margin-bottom: 0.2rem;
    }

    .card-item p {
        display: none; /* Hide description on mobile for compact view */
    }
    
    .card-item .badges {
        display: none; /* Hide badges on mobile for cleaner look */
    }

    /* Adjust flex for content wrapper (if added via HTML structure change or simulated via grid) */
    /* Since HTML structure is flat, we use grid to position elements */
    .card-item {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        grid-template-areas: 
            "icon title"
            "icon desc";
    }

    .card-item i, .card-item svg { grid-area: icon; }
    .card-item h3 { grid-area: title; }
    .card-item p { 
        grid-area: desc; 
        display: none !important; /* Hide description on mobile */
        margin-top: 0;
    }
    
    /* Disable hover effects on mobile that might stick */
    .cards-grid:hover .card-item {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
