/* 3D Premium Service Cards */

.service-card-3d {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 340px; /* Slightly increased fixed height */
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.05);
    cursor: default;
}

/* Hover State for Card */
.service-card-3d:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.2);
    transform: translateY(-5px);
}

/* 3D Image/Icon Container */
.service-3d-image-container {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy effect */
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Icon Styling to look "3D" and Premium */
.service-3d-image-container i {
    font-size: 6rem;
    background: linear-gradient(135deg, #2563EB 0%, #60A5FA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 15px rgba(37, 99, 235, 0.3));
    transition: all 0.5s ease;
}

/* On hover, shrink icon */
.service-card-3d:hover .service-3d-image-container i {
    font-size: 2.5rem; /* Smaller size */
    filter: drop-shadow(0 4px 6px rgba(37, 99, 235, 0.2));
}

/* Card Content (Title + Desc) */
.service-content-3d {
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-content-3d h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    transition: all 0.4s ease;
    height: 3rem; /* Fixed height for title to prevent jump */
    display: flex; /* alignment */
    align-items: center;
    justify-content: center;
}

.service-description-3d {
    opacity: 0;
    transform: translateY(20px);
    height: 0; /* Hidden by default */
    overflow: hidden;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth reveal */
    text-align: left;
}

/* HOVER EFFECT LOGIC */

/* 1. Move Image to left side */
.service-card-3d:hover .service-3d-image-container {
    width: 70px; /* Smaller icon but clearly visible */
    height: 70px;
    transform: translateX(-110px) translateY(-10px); /* Move left */
    margin-bottom: 0; 
    /* Absolute positioning idea avoided to keep flow, using transform instead */
}

/* 2. Adjust Title */
.service-card-3d:hover .service-content-3d h3 {
    text-align: left;
    transform: translateX(30px) translateY(-35px); /* Adjusted to prevent overlap */
    justify-content: flex-start;
    font-size: 1.3rem;
    padding-left: 10px; /* Added spacing */
}

/* 3. Reveal Text */
.service-card-3d:hover .service-description-3d {
    opacity: 1;
    height: auto;
    /* Use margin to pull it UP into the space left by the image/title movement */
    margin-top: -30px; 
    transform: translateY(0);
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05); /* Optional: separator line */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .service-card-3d {
        height: auto;
        min-height: 280px;
        padding: 2rem;
        align-items: flex-start;
        text-align: left;
    }

    /* Disable the complex hover/transform on mobile, show static layout */
    .service-card-3d .service-3d-image-container {
        width: 80px;
        height: 80px;
        transform: none !important;
        margin-bottom: 1rem;
    }

    .service-card-3d .service-content-3d h3 {
        text-align: left;
        transform: none !important;
        justify-content: flex-start;
        font-size: 1.4rem;
        height: auto;
        margin-bottom: 1rem;
    }

    .service-card-3d .service-description-3d {
        opacity: 1;
        height: auto;
        transform: none !important;
        text-align: left;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
}
