/*
 * CSS for the Manus 3D Dice Roller WordPress Plugin
 * Original code extracted and adapted for plugin use.
 */

.manus-dice-roller-container {
    /* Scoping the styles to the container */
    max-width: 800px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: white;
    margin: 20px auto; /* Added margin for better display on a page */
}

.manus-dice-roller-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.manus-dice-roller-container .subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.manus-dice-roller-container .dice-container {
    perspective: 1000px;
    margin: 30px auto;
    width: 200px;
    height: 200px;
    position: relative;
}

.manus-dice-roller-container .dice {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-out;
}

.manus-dice-roller-container .dice.rolling {
    animation: rollDice 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.manus-dice-roller-container .dice.landing {
    animation: diceLand 0.8s ease-out;
}

.manus-dice-roller-container .face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: white;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
    border: 3px solid #FF3838;
}

.manus-dice-roller-container .face::before {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent);
    pointer-events: none;
}

.manus-dice-roller-container .dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
    position: absolute;
}

/* Dice face positions */
.manus-dice-roller-container .front { transform: translateZ(100px); }
.manus-dice-roller-container .back { transform: rotateY(180deg) translateZ(100px); }
.manus-dice-roller-container .right { transform: rotateY(90deg) translateZ(100px); }
.manus-dice-roller-container .left { transform: rotateY(-90deg) translateZ(100px); }
.manus-dice-roller-container .top { transform: rotateX(90deg) translateZ(100px); }
.manus-dice-roller-container .bottom { transform: rotateX(-90deg) translateZ(100px); }

/* Dice dot positions for each face - Kept original for simplicity */
.manus-dice-roller-container .face-1 .dot:nth-child(1) { top: 50%; left: 50%; transform: translate(-50%, -50%); }

.manus-dice-roller-container .face-2 .dot:nth-child(1) { top: 25%; left: 25%; }
.manus-dice-roller-container .face-2 .dot:nth-child(2) { bottom: 25%; right: 25%; }

.manus-dice-roller-container .face-3 .dot:nth-child(1) { top: 25%; left: 25%; }
.manus-dice-roller-container .face-3 .dot:nth-child(2) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.manus-dice-roller-container .face-3 .dot:nth-child(3) { bottom: 25%; right: 25%; }

.manus-dice-roller-container .face-4 .dot:nth-child(1) { top: 25%; left: 25%; }
.manus-dice-roller-container .face-4 .dot:nth-child(2) { top: 25%; right: 25%; }
.manus-dice-roller-container .face-4 .dot:nth-child(3) { bottom: 25%; left: 25%; }
.manus-dice-roller-container .face-4 .dot:nth-child(4) { bottom: 25%; right: 25%; }

.manus-dice-roller-container .face-5 .dot:nth-child(1) { top: 25%; left: 25%; }
.manus-dice-roller-container .face-5 .dot:nth-child(2) { top: 25%; right: 25%; }
.manus-dice-roller-container .face-5 .dot:nth-child(3) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.manus-dice-roller-container .face-5 .dot:nth-child(4) { bottom: 25%; left: 25%; }
.manus-dice-roller-container .face-5 .dot:nth-child(5) { bottom: 25%; right: 25%; }

.manus-dice-roller-container .face-6 .dot:nth-child(1) { top: 25%; left: 25%; }
.manus-dice-roller-container .face-6 .dot:nth-child(2) { top: 25%; right: 25%; }
.manus-dice-roller-container .face-6 .dot:nth-child(3) { top: 50%; left: 25%; transform: translateY(-50%); }
.manus-dice-roller-container .face-6 .dot:nth-child(4) { top: 50%; right: 25%; transform: translateY(-50%); }
.manus-dice-roller-container .face-6 .dot:nth-child(5) { bottom: 25%; left: 25%; }
.manus-dice-roller-container .face-6 .dot:nth-child(6) { bottom: 25%; right: 25%; }

.manus-dice-roller-container .controls {
    margin: 30px 0;
}

.manus-dice-roller-container .roll-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.manus-dice-roller-container .roll-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(255, 71, 87, 0.6);
}

.manus-dice-roller-container .roll-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.manus-dice-roller-container .roll-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.manus-dice-roller-container .roll-btn:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

.manus-dice-roller-container .result {
    font-size: 1.5rem;
    margin-top: 20px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.manus-dice-roller-container .result.show {
    opacity: 1;
}

.manus-dice-roller-container .stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
}

.manus-dice-roller-container .stat-item {
    text-align: center;
}

.manus-dice-roller-container .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FF6B6B;
}

.manus-dice-roller-container .stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

@keyframes rollDice {
    0% {
        transform: rotateX(0) rotateY(0) rotateZ(0) scale(1);
    }
    25% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(180deg) scale(1.1);
    }
    50% {
        transform: rotateX(1440deg) rotateY(720deg) rotateZ(360deg) scale(1.2);
    }
    75% {
        transform: rotateX(2160deg) rotateY(1080deg) rotateZ(540deg) scale(1.1);
    }
    100% {
        transform: rotateX(2880deg) rotateY(1440deg) rotateZ(720deg) scale(1);
    }
}

@keyframes diceLand {
    0% {
        transform: scale(1.2) rotateZ(45deg);
    }
    100% {
        transform: scale(1) rotateZ(0deg);
    }
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.manus-dice-roller-container .confetti {
    position: fixed; /* Confetti should be fixed relative to viewport */
    width: 10px;
    height: 10px;
    background: #FF6B6B;
    top: 0;
    opacity: 0;
}

.manus-dice-roller-container .history {
    margin-top: 30px;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
}

.manus-dice-roller-container .history-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.manus-dice-roller-container .history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.manus-dice-roller-container .history-item {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 600px) {
    .manus-dice-roller-container {
        padding: 20px;
    }
    
    .manus-dice-roller-container h1 {
        font-size: 2rem;
    }
    
    .manus-dice-roller-container .dice-container {
        width: 150px;
        height: 150px;
    }
    
    .manus-dice-roller-container .face {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
    
    .manus-dice-roller-container .front { transform: translateZ(75px); }
    .manus-dice-roller-container .back { transform: rotateY(180deg) translateZ(75px); }
    .manus-dice-roller-container .right { transform: rotateY(90deg) translateZ(75px); }
    .manus-dice-roller-container .left { transform: rotateY(-90deg) translateZ(75px); }
    .manus-dice-roller-container .top { transform: rotateX(90deg) translateZ(75px); }
    .manus-dice-roller-container .bottom { transform: rotateX(-90deg) translateZ(75px); }
    
    .manus-dice-roller-container .dot {
        width: 20px;
        height: 20px;
    }
}

/* The original code had a body background, which is inappropriate for a plugin. 
   I will add a background to the container for visual consistency, but the page body 
   should be left to the theme. */
/* Removed original body styles */
