/* ========================================
   3D SPINNING CUBE - PREMIUM VERSION
   Intelligence Services Showcase
   ======================================== */

/* ========================================
   CUBE CONTAINER & STRUCTURE
   ======================================== */

.cube-section {
    padding: 160px 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg,
        rgba(59, 130, 246, 0.02) 0%,
        transparent 50%,
        rgba(59, 130, 246, 0.02) 100%
    );
}

.cube-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
}

.cube-header {
    text-align: center;
    max-width: 700px;
}

.cube-header h2 {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.cube-header p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   3D CUBE VIEWPORT
   ======================================== */

.cube-wrapper {
    width: 100%;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    position: relative;
}

.cube {
    width: 400px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 30s infinite linear;
    cursor: grab;
}

.cube:active {
    cursor: grabbing;
    animation-play-state: paused;
}

/* Continuous rotation animation */
@keyframes rotateCube {
    0% {
        transform: rotateX(-15deg) rotateY(0deg);
    }
    100% {
        transform: rotateX(-15deg) rotateY(360deg);
    }
}

/* ========================================
   CUBE FACES
   ======================================== */

.cube-face {
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 
        0 0 60px rgba(59, 130, 246, 0.15),
        inset 0 0 80px rgba(59, 130, 246, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glass morphism effect */
.cube-face::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.1) 0%,
        transparent 50%,
        rgba(139, 92, 246, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cube-face:hover::before {
    opacity: 1;
}

/* Face positioning */
.cube-face--front {
    transform: translateZ(200px);
}

.cube-face--back {
    transform: rotateY(180deg) translateZ(200px);
}

.cube-face--right {
    transform: rotateY(90deg) translateZ(200px);
}

.cube-face--left {
    transform: rotateY(-90deg) translateZ(200px);
}

.cube-face--top {
    transform: rotateX(90deg) translateZ(200px);
}

.cube-face--bottom {
    transform: rotateX(-90deg) translateZ(200px);
}

/* ========================================
   FACE CONTENT
   ======================================== */

.face-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--accent-cyan);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.cube-face:hover .face-icon {
    opacity: 1;
    transform: scale(1.1);
}

.face-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.face-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.face-features {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.face-features li {
    font-size: 14px;
    color: var(--text-tertiary);
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    text-align: left;
}

.face-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
}

/* ========================================
   CUBE EDGES (OPTIONAL ENHANCEMENT)
   ======================================== */

.cube-edges {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cube-edge {
    position: absolute;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 212, 255, 0.5) 50%,
        transparent 100%
    );
    opacity: 0.3;
}

/* Horizontal edges */
.cube-edge--horizontal {
    height: 1px;
    width: 100%;
}

/* Vertical edges */
.cube-edge--vertical {
    width: 1px;
    height: 100%;
}

/* ========================================
   INTERACTION HINTS
   ======================================== */

.cube-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.cube-hint svg {
    width: 16px;
    height: 16px;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   AMBIENT LIGHTING EFFECTS
   ======================================== */

.cube-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(
        circle,
        rgba(59, 130, 246, 0.15) 0%,
        transparent 70%
    );
    animation: ambientPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ambientPulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .cube-section {
        padding: 120px 0;
    }
    
    .cube-wrapper {
        height: 500px;
    }
    
    .cube {
        width: 350px;
        height: 350px;
    }
    
    .cube-face {
        width: 350px;
        height: 350px;
        padding: 40px 32px;
    }
    
    .cube-face--front {
        transform: translateZ(175px);
    }
    
    .cube-face--back {
        transform: rotateY(180deg) translateZ(175px);
    }
    
    .cube-face--right {
        transform: rotateY(90deg) translateZ(175px);
    }
    
    .cube-face--left {
        transform: rotateY(-90deg) translateZ(175px);
    }
    
    .cube-face--top {
        transform: rotateX(90deg) translateZ(175px);
    }
    
    .cube-face--bottom {
        transform: rotateX(-90deg) translateZ(175px);
    }
}

@media (max-width: 768px) {
    .cube-section {
        padding: 80px 0;
    }
    
    /* Switch to card carousel on mobile */
    .cube-wrapper {
        display: none;
    }
    
    .mobile-services {
        display: block;
        width: 100%;
    }
    
    .service-card {
        background: rgba(21, 26, 40, 0.6);
        border: 1px solid var(--border-subtle);
        border-radius: 16px;
        padding: 32px 24px;
        margin-bottom: 24px;
        transition: all 0.4s ease;
    }
    
    .service-card:hover {
        border-color: var(--border-default);
        background: rgba(21, 26, 40, 0.9);
        transform: translateY(-4px);
    }
}

/* Hide mobile fallback on desktop */
@media (min-width: 769px) {
    .mobile-services {
        display: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.cube-face:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 8px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cube {
        animation: none;
    }
    
    .cube-hint svg {
        animation: none;
    }
    
    @keyframes rotateCube {
        0%, 100% {
            transform: rotateX(-15deg) rotateY(20deg);
        }
    }
}
