/* ===== FLIP CARD ANIMATION & ALTERNATING LAYOUT ===== */

/* Flip card container */
.flip-card {
    background-color: transparent !important;
    border: none !important;
    perspective: 1000px;
    height: 220px;
    position: relative;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.flip-card-front {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.flip-card-back {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: rotateY(180deg);
    padding: 1.5rem;
}

.flip-card-front .keyfact-icon {
    margin-bottom: 1rem;
}

.flip-card-front h3 {
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.flip-card-back p {
    color: #e6e6e6;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== ALTERNATING LAYOUT ===== */
.alternate-layout {
    display: options;
}

/* For "Why Us" section with alternating left/right */
.why-us-content {
    position: relative;
}

.alternate-content-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
}

.alternate-content-group.reverse {
    direction: rtl;
}

.alternate-content-group.reverse > * {
    direction: ltr;
}

.alt-text {
    padding: 2rem;
}

.alt-image {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.alt-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.alternate-content-group:hover .alt-image img {
    transform: scale(1.05) rotate(2deg);
}

/* Service cards with flip on desktop, normal on mobile */
.service-card {
    perspective: 1000px;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.service-card:hover .service-card-inner {
    transform: rotateY(15deg) rotateX(5deg);
}

/* Responsive alternating layout */
@media (max-width: 768px) {
    .alternate-content-group {
        grid-template-columns: 1fr;
    }
    
    .alternate-content-group.reverse {
        direction: ltr;
    }
    
    .alternate-content-group.reverse > * {
        direction: ltr;
    }
    
    .flip-card {
        height: auto;
    }
}

/* 3D perspective on main container */
.why-us {
    perspective: 1200px;
}
