/* ================================================
   3D Service Cards Component
   ================================================ */

.service-cards-3d {
    padding: 80px 0;
    background: #f8f9fa;
}

.service-cards-3d-wrapper {
    width: 100%;
}

.service-cards-3d-header {
    text-align: center;
    margin-bottom: 60px;
}

.service-cards-3d-header h2 {
    font-size: 42px;
    font-weight: 700;
    color: #1d3557;
    margin-bottom: 16px;
}

.service-cards-3d-header p {
    font-size: 18px;
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto;
}

/* Grid Layout */
.service-cards-3d-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 3D Card Container */
.service-card-3d-container {
    perspective: 1000px;
    position: relative;
    height: 700px;
}

/* Desktop Rotate Cursor */
@media (min-width: 769px) {
    .service-card-3d-container {
        cursor: pointer;
    }
    
    .service-card-3d-container:hover .service-card-3d {
        transform: rotateY(180deg);
    }
    
    /* Show rotate indicator on hover */
    .service-card-3d-container:hover .rotate-indicator {
        opacity: 1;
    }
}

/* 3D Card */
.service-card-3d {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    transform-origin: center center;
}

.service-card-3d-container.flipped .service-card-3d {
    transform: rotateY(180deg);
}

/* Card Sides - Shared Styles */
.service-card-3d-front,
.service-card-3d-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Front Side */
.service-card-3d-front {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transform: rotateY(0deg);
}

.service-card-3d-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(29, 53, 87, 0.1) 0%, rgba(230, 57, 70, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card-3d-container:hover .card-overlay {
    opacity: 1;
}

.rotate-indicator {
    width: 60px;
    height: 60px;
    background: rgba(230, 57, 70, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: pulse 2s infinite;
}

.rotate-indicator svg {
    width: 32px;
    height: 32px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Back Side */
.service-card-3d-back {
    background: #e63946;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    z-index: 1;
}

.service-card-3d-content {
    text-align: left;
    color: #fff;
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 0 24px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.service-card-3d-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #fff;
}

.service-card-3d-content p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

.service-card-3d-content p:last-child {
    margin-bottom: 0;
}

.service-description ul,
.service-description ol {
    margin: 12px 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.service-description li {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.service-description strong {
    color: #fff;
    font-weight: 700;
}

.service-description a {
    color: #fff;
    text-decoration: underline;
}

.service-description a:hover {
    opacity: 0.8;
}

/* Mobile Rotate Hint */
.mobile-rotate-hint {
    display: none;
}

@media (max-width: 768px) {
    .mobile-rotate-hint {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: -60px;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity 0.5s ease;
        pointer-events: none;
        gap: 8px;
    }
    
    .mobile-rotate-hint.show {
        opacity: 1;
        animation: fadeInOut 4s ease-in-out forwards;
    }
    
    .mobile-rotate-hint svg {
        width: 32px;
        height: 32px;
        animation: rotate-hint 2s ease-in-out infinite;
    }
    
    .mobile-rotate-hint span {
        font-size: 14px;
        font-weight: 500;
        color: #e63946;
    }
    
    @keyframes fadeInOut {
        0% {
            opacity: 0;
        }
        15% {
            opacity: 1;
        }
        85% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }
    
    @keyframes rotate-hint {
        0%, 100% {
            transform: rotate(0deg);
        }
        25% {
            transform: rotate(15deg);
        }
        75% {
            transform: rotate(-15deg);
        }
    }
    
    /* Hide desktop rotate indicator on mobile */
    .rotate-indicator {
        display: none;
    }
    
    .card-overlay {
        display: none;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .service-cards-3d {
        padding: 60px 0;
    }
    
    .service-cards-3d-header h2 {
        font-size: 32px;
    }
    
    .service-cards-3d-header p {
        font-size: 16px;
    }
    
    .service-cards-3d-grid {
        grid-template-columns: 1fr;
        gap: 80px;
    }
    
    .service-card-3d-back {
        padding: 30px;
    }
    
    .service-card-3d-content h3 {
        font-size: 20px;
    }
    
    .service-card-3d-content p,
    .service-description li {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .service-cards-3d {
        padding: 40px 0;
    }
    
    .service-cards-3d-header {
        margin-bottom: 40px;
    }
    
    .service-cards-3d-header h2 {
        font-size: 28px;
    }
    
    .service-card-3d-back {
        padding: 24px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }
}

