/* ==================================================================
   ADVANCED 3D VOLUME VISUALIZATION - AI ENGINEERING STYLE
   Ultra-Professional CAD/Engineering Software Simulation
================================================================== */

.volume-3d-container {
    margin-top: 2.5rem;
    background:
        linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 204, 0, 0.02) 2px, rgba(255, 204, 0, 0.02) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 204, 0, 0.02) 2px, rgba(255, 204, 0, 0.02) 4px);
    border: 3px solid #FFCC00;
    border-left-width: 6px;
    padding: 2.5rem;
    position: relative;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 204, 0, 0.2),
        0 0 60px rgba(255, 204, 0, 0.1);
    overflow: hidden;
}

/* Animated grid background */
.volume-3d-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(255, 204, 0, 0.03) 50px, rgba(255, 204, 0, 0.03) 51px),
        repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(255, 204, 0, 0.03) 50px, rgba(255, 204, 0, 0.03) 51px);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Corner accents */
.volume-3d-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #FFCC00;
    pointer-events: none;
    clip-path: polygon(0 0, 30px 0, 30px 2px, 2px 2px, 2px 30px, 0 30px,
            0 100%, 30px 100%, 30px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 30px), 0 calc(100% - 30px),
            100% 100%, 100% calc(100% - 30px), calc(100% - 2px) calc(100% - 30px), calc(100% - 2px) calc(100% - 2px), calc(100% - 30px) calc(100% - 2px), calc(100% - 30px) 100%,
            100% 0, calc(100% - 30px) 0, calc(100% - 30px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 30px, 100% 30px);
}

.volume-3d-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.1) 0%, transparent 100%);
    border-left: 4px solid #FFCC00;
    position: relative;
    z-index: 10;
}

.volume-3d-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255, 204, 0, 0.05) 10px, rgba(255, 204, 0, 0.05) 20px);
    pointer-events: none;
}

.volume-3d-header i {
    color: #FFCC00;
    font-size: 2rem;
    animation: iconPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 0.8));
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.9;
    }
}

.volume-3d-header h4 {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 900;
    color: #FFCC00;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
    flex: 1;
    text-shadow:
        0 0 20px rgba(255, 204, 0, 0.6),
        0 0 40px rgba(255, 204, 0, 0.3);
    position: relative;
}

/* AI Status Badge */
.volume-3d-header h4::after {
    content: 'AI POWERED';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: #FFCC00;
    color: #000;
    font-weight: 900;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.8);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 204, 0, 0.8);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 204, 0, 1);
    }
}

/* Main 3D Scene */
.volume-3d-scene {
    width: 100%;
    height: 650px;
    perspective: 2000px;
    perspective-origin: 50% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    background:
        radial-gradient(ellipse at center, rgba(255, 204, 0, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 20% 80%, rgba(255, 204, 0, 0.03) 0%, transparent 50%);
}

/* Ground Grid - Engineering Style */
.volume-3d-scene::before {
    content: '';
    position: absolute;
    bottom: 10%;
    left: -20%;
    width: 140%;
    height: 400px;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 204, 0, 0.15) 49px, rgba(255, 204, 0, 0.15) 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(255, 204, 0, 0.15) 49px, rgba(255, 204, 0, 0.15) 50px),
        linear-gradient(180deg, transparent 0%, rgba(255, 204, 0, 0.05) 50%, transparent 100%);
    transform: rotateX(75deg) translateY(100px);
    transform-origin: center center;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* Reference line */
.volume-3d-scene::after {
    content: '';
    position: absolute;
    bottom: 18%;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FFCC00 30%, #FFCC00 70%, transparent);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.8), 0 0 40px rgba(255, 204, 0, 0.4);
    z-index: 5;
}

.volume-3d-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

/* The 3D Volume Box - AI Enhanced */
.volume-box {
    position: relative;
    width: 250px;
    height: 250px;
    transform-style: preserve-3d;
    transform: rotateX(-12deg) rotateY(40deg) rotateZ(0deg);
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    animation: rotateAI 35s infinite cubic-bezier(0.45, 0, 0.55, 1);
    filter:
        drop-shadow(0 40px 80px rgba(0, 0, 0, 1)) drop-shadow(0 0 60px rgba(255, 204, 0, 0.4)) drop-shadow(0 0 100px rgba(255, 204, 0, 0.2));
}

@keyframes rotateAI {
    0% {
        transform: rotateX(-12deg) rotateY(0deg);
    }

    25% {
        transform: rotateX(-15deg) rotateY(90deg);
    }

    50% {
        transform: rotateX(-12deg) rotateY(180deg);
    }

    75% {
        transform: rotateX(-15deg) rotateY(270deg);
    }

    100% {
        transform: rotateX(-12deg) rotateY(360deg);
    }
}

.volume-box:hover {
    animation-play-state: paused;
    transform: rotateX(-18deg) rotateY(45deg) scale(1.12);
    filter:
        drop-shadow(0 50px 100px rgba(0, 0, 0, 1)) drop-shadow(0 0 80px rgba(255, 204, 0, 0.6)) drop-shadow(0 0 120px rgba(255, 204, 0, 0.3));
}

/* AI-Enhanced Faces */
.box-face {
    position: absolute;
    width: 250px;
    height: 250px;
    border: 4px solid #FFCC00;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: visible;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow:
        inset 0 0 50px rgba(255, 204, 0, 0.2),
        0 0 30px rgba(255, 204, 0, 0.4);
}

/* Front Face - Primary */
.box-face.front {
    background:
        linear-gradient(135deg, rgba(255, 204, 0, 0.6) 0%, rgba(255, 204, 0, 0.3) 100%),
        repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(0, 0, 0, 0.15) 15px, rgba(0, 0, 0, 0.15) 30px),
        repeating-linear-gradient(-45deg, transparent, transparent 15px, rgba(255, 255, 255, 0.02) 15px, rgba(255, 255, 255, 0.02) 30px);
    transform: translateZ(125px);
    border-color: #FFD700;
    border-width: 5px;
}

.box-face.back {
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(255, 204, 0, 0.1) 24px, rgba(255, 204, 0, 0.1) 25px);
    transform: translateZ(-125px) rotateY(180deg);
}

/* Top Face - Engineering Grid */
.box-face.top {
    background:
        linear-gradient(135deg, rgba(255, 204, 0, 0.7) 0%, rgba(255, 204, 0, 0.4) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(0, 0, 0, 0.2) 24px, rgba(0, 0, 0, 0.2) 25px),
        repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(0, 0, 0, 0.2) 24px, rgba(0, 0, 0, 0.2) 25px);
    transform: rotateX(90deg) translateZ(125px);
    border-color: #FFD700;
    border-width: 5px;
}

/* Bottom Face - Excavation */
.box-face.bottom {
    background:
        repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(255, 204, 0, 0.4) 24px, rgba(255, 204, 0, 0.4) 25px),
        repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(255, 204, 0, 0.4) 24px, rgba(255, 204, 0, 0.4) 25px),
        linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(10, 10, 10, 0.9) 100%);
    transform: rotateX(-90deg) translateZ(125px);
    box-shadow:
        inset 0 0 80px rgba(255, 204, 0, 0.3),
        0 30px 60px rgba(0, 0, 0, 0.8);
}

.box-face.left {
    background:
        linear-gradient(135deg, rgba(255, 204, 0, 0.35) 0%, rgba(0, 0, 0, 0.6) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 204, 0, 0.1) 49px, rgba(255, 204, 0, 0.1) 50px);
    transform: rotateY(-90deg) translateZ(125px);
}

.box-face.right {
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(255, 204, 0, 0.35) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 204, 0, 0.1) 49px, rgba(255, 204, 0, 0.1) 50px);
    transform: rotateY(90deg) translateZ(125px);
}

/* Face Labels - AI Style */
.face-label {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 900;
    color: #FFCC00;
    letter-spacing: 4px;
    text-shadow:
        0 0 20px rgba(0, 0, 0, 1),
        0 0 40px rgba(255, 204, 0, 1),
        0 0 60px rgba(255, 204, 0, 0.5),
        3px 3px 0 rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    animation: labelGlow 3s ease-in-out infinite;
}

@keyframes labelGlow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(0, 0, 0, 1), 0 0 40px rgba(255, 204, 0, 1);
    }

    50% {
        text-shadow: 0 0 20px rgba(0, 0, 0, 1), 0 0 60px rgba(255, 204, 0, 1), 0 0 80px rgba(255, 204, 0, 0.5);
    }
}

/* Advanced Dimension System */
.dimension-labels {
    position: absolute;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 15;
    left: -10%;
    top: -10%;
}

.dim-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background:
        linear-gradient(135deg, #FFCC00 0%, #FFD930 100%),
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0, 0, 0, 0.1) 5px, rgba(0, 0, 0, 0.1) 10px);
    border: 4px solid #000000;
    font-family: 'Orbitron', monospace;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.9),
        inset 0 3px 0 rgba(255, 255, 255, 0.5),
        inset 0 -3px 5px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 204, 0, 0.6);
    animation: dimFloat 4s ease-in-out infinite;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes dimFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Dimension lines with arrows */
.dim-label::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #FFCC00, #FFD700, #FFCC00);
    box-shadow:
        0 0 20px rgba(255, 204, 0, 1),
        0 0 40px rgba(255, 204, 0, 0.5);
}

.dim-label::after {
    content: '◄────►';
    position: absolute;
    color: #FFCC00;
    font-size: 0.8rem;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 204, 0, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.dim-length {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.dim-length::before {
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.dim-length::after {
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
}

.dim-width {
    right: 3%;
    top: 45%;
    transform: translateY(-50%);
}

.dim-width::before {
    right: -50px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.dim-width::after {
    right: -45px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.dim-depth {
    top: 5%;
    left: 10%;
}

.dim-depth::before {
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.dim-depth::after {
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    content: '◄──►';
}

.dim-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #000000;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    animation: valueUpdate 0.5s ease;
}

@keyframes valueUpdate {
    0% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.dim-name {
    font-size: 0.75rem;
    font-weight: 800;
    color: #000000;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Area Info Badge */
.volume-3d-scene .area-badge {
    content: 'EXCAVATION ZONE';
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #FFCC00 0%, #FFD700 100%);
    color: #000000;
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 3px;
    border: 4px solid #000000;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 0 40px rgba(255, 204, 0, 0.6);
    z-index: 20;
    animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 204, 0, 0.6);
    }

    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 204, 0, 1);
    }
}

/* Footer Controls */
.volume-3d-footer {
    margin-top: 2.5rem;
    padding: 1.5rem;
    border-top: 3px solid #FFCC00;
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.05) 0%, transparent 50%, rgba(255, 204, 0, 0.05) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.rotation-indicator {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 0.85rem;
    color: #FFCC00;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.rotation-indicator i {
    color: #FFCC00;
    font-size: 1.4rem;
    animation: iconSpin 6s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 1));
}

@keyframes iconSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.rotation-indicator::after {
    content: 'CATERPILLAR® AI PRECISION';
    margin-left: auto;
    padding: 0.5rem 1.2rem;
    background: #000000;
    color: #FFCC00;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    border: 3px solid #FFCC00;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 204, 0, 0.3),
        0 0 30px rgba(255, 204, 0, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .volume-3d-scene {
        height: 500px;
    }

    .volume-box {
        width: 180px;
        height: 180px;
    }

    .box-face {
        width: 180px;
        height: 180px;
    }

    .dim-label {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}