/* ===== D-PAD CONTROLS ===== */
.dpad.cube-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

/* D-pad container - black cross shape */
.dpad-container {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    left: 10px;
    bottom: 10px;
}

/* D-pad base - black cross shape */
.dpad-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 20px;
    background: #000000;
    border-radius: 10px;
    z-index: 1;
}

.dpad-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 80px;
    background: #000000;
    border-radius: 10px;
    z-index: 1;
}

/* D-pad buttons container */
.dpad-middle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 2;
    position: relative;
}

/* All D-pad buttons */
.dpad-button {
    width: 30%;
    height: 30%;
    border: none;
    border-radius: 50%;
    background: #000000;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 0 !important;
}

.dpad-button:hover {
    background: #e67e00;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dpad-button:active {
    transform: scale(0.95);
}

/* Directional arrows */
.dpad-button .arrow {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Center dot for reset button */
.center-dot {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Position buttons around the D-pad */
#rotate-up {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

#rotate-down {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

#rotate-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

#rotate-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

#reset-view {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    background: #ff8c00;
}

#reset-view:hover {
    background: #e67e00;
}

/* ===== CUBE STATES CSS ===== */

/* === INITIAL STATE (1st state) === */
.cube-face-back {
    width: 100% !important;
    height: 100% !important;
    transform: rotateY(180deg) translateZ(-14px) !important;
    background: white !important;
    box-shadow: 5px 5px 25px black;
}

.cube-face-left {
    width: 30px !important;
    height: 100% !important;
    transform: rotateY(-90deg) translateX(10px) !important;
}

.cube-face-right {
    width: 30px !important;
    height: 100% !important;
    transform: rotateY(90deg) translateX(-10px) !important;
}

.cube-face-top {
    width: 100% !important;
    height: 30px !important;
    transform: rotateX(90deg) translateY(10px) !important;
}

.cube-face-bottom {
    width: 100% !important;
    height: 30px !important;
    transform: rotateX(-90deg) translateY(-10px) !important;
}

/* === FRAME STATE (2nd state) === */
.cube.frame-active .cube-face-back {
    transform: rotateY(180deg) translateZ(5px) !important;
}

.cube.frame-active .cube-face-top {
    height: 20px !important;
    transform: rotateX(90deg) translateY(5px) !important;
    bottom: -10px !important;
}

.cube.frame-active .cube-face-bottom {
    height: 20px !important;
    transform: rotateX(-90deg) translateY(-5px) !important;
    top: -10px !important;
}

.cube.frame-active .cube-face-right {
    width: 20px !important;
    transform: rotateY(90deg) translateX(-5px) !important;
    left: -10px !important;
}

.cube.frame-active .cube-face-left {
    width: 20px !important;
    transform: rotateY(-90deg) translateX(5px) !important;
    right: -10px !important;
}

/* === FLOOR STATE (3rd state) === */
.cube.floor-active .cube-face-top {
    height: 7px !important;
    bottom: -3px !important;
}

.cube.floor-active .cube-face-bottom {
    height: 7px !important;
    top: -3px !important;
}

.cube.floor-active .cube-face-right {
    width: 7px !important;
    left: -4px !important;
}

.cube.floor-active .cube-face-left {
    width: 7px !important;
    right: -4px !important;
}

.cube.floor-active .cube-face-back {
    transform: rotateY(180deg) translateZ(-7px) !important;
}

.cube.floor-active .cube-face-front {
    transform: rotateY(0deg) translateZ(13px);
}

/* === COMBINED STATES === */
.cube.frame-active.floor-active .cube-face-back {
    transform: rotateY(180deg) translateZ(5px) !important;
}

.cube.frame-active.floor-active .cube-face-top {
    height: 20px !important;
    transform: rotateX(90deg) translateY(5px) !important;
    bottom: -10px !important;
}

.cube.frame-active.floor-active .cube-face-bottom {
    height: 20px !important;
    transform: rotateX(-90deg) translateY(-5px) !important;
    top: -10px !important;
}

.cube.frame-active.floor-active .cube-face-right {
    width: 20px !important;
    transform: rotateY(90deg) translateX(-5px) !important;
    left: -10px !important;
}

.cube.frame-active.floor-active .cube-face-left {
    width: 20px !important;
    transform: rotateY(-90deg) translateX(5px) !important;
    right: -10px !important;
}

/* === KANVAS MATERIAL STYLES === */
/* Applied when material contains "Kanvas Tablo" or "Canvas Frame" */
/* When .kanvas-material class is on .cube element */
.cube.kanvas-material .cube-face-bottom,
.cube.kanvas-material .cube-face-bottom.cube-face {
    width: 100% !important;
    height: 30px !important;
    transform: rotateX(90deg) translateY(0) !important;
    bottom: -15px !important;
    background-size: cover !important;
    background-position: bottom !important;
    background-image: var(--featured-image) !important;
}

.cube.kanvas-material .cube-face-top,
.cube.kanvas-material .cube-face-top.cube-face {
    width: 100% !important;
    height: 30px !important;
    transform: rotateX(-90deg) translateY(0) !important;
    top: -15px;
    background-size: cover !important;
    background-position: top !important;
    background-image: var(--featured-image) !important;
}

.cube.kanvas-material .cube-face-left,
.cube.kanvas-material .cube-face-left.cube-face {
    width: 30px !important;
    height: 100% !important;
    transform: rotateY(90deg) translateX(0) !important;
    left: -15px !important;
    background-position: left !important;
    background-size: cover !important;
    background-image: var(--featured-image) !important;
}

.cube.kanvas-material .cube-face-right,
.cube.kanvas-material .cube-face-right.cube-face {
    width: 30px !important;
    height: 100% !important;
    transform: rotateY(-90deg) translateX(0) !important;
    right: -15px !important;
    background-position: right !important;
    background-size: cover !important;
    background-image: var(--featured-image) !important;
}

.cube.kanvas-material .cube-face-back {
    transform: rotateY(180deg) translateZ(14.5px) !important;
}




/* === KANVAS MATERIAL STYLES === */
/* Applied when material contains "Kanvas Tablo" or "Canvas Frame" */
/* When .kanvas-material class is on .cube element */
@media (max-width: 768px) {
.cube.kanvas-material .cube-face-bottom,
.cube.kanvas-material .cube-face-bottom.cube-face {
    height: 20px !important;
    transform: rotateX(90deg) translateY(0) !important;
    bottom: -10px !important;
}

.cube.kanvas-material .cube-face-top,
.cube.kanvas-material .cube-face-top.cube-face {
    height: 20px !important;
    transform: rotateX(-90deg) translateY(0) !important;
    top: -10px !important;
}

.cube.kanvas-material .cube-face-left,
.cube.kanvas-material .cube-face-left.cube-face {
    width: 20px !important;
    transform: rotateY(90deg) translateX(0) !important;
    left: -10px !important;
}

.cube.kanvas-material .cube-face-right,
.cube.kanvas-material .cube-face-right.cube-face {
    width: 20px !important;
    transform: rotateY(-90deg) translateX(0) !important;
    right: -10px !important;
}

.cube.kanvas-material .cube-face-back {
    transform: rotateY(180deg) translateZ(10px) !important;
}

.cube.kanvas-material .cube-face-front {
    transform: rotateY(0deg) translateZ(10px);
}
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .cube-controls {
        bottom: 5px;
        left: 14% !important;
        transform: translateY(-50%);
    }
    
    .dpad-container {
        width: 100px;
        height: 100px;
    }
    
    .dpad-container::before {
        width: 70px;
        height: 18px;
    }
    
    .dpad-container::after {
        width: 18px;
        height: 70px;
    }
    
    .dpad-button {
        width: 30px;
        height: 30px;
    }
    
    .dpad-button .arrow {
        font-size: 16px;
    }
    
    .center-dot {
        width: 20px;
        height: 20px;
    }
}