/**
 * استایل Lucky Box - جعبه شانس
 */

/* کانتینر جعبه‌ها */
.anamis-lucky-box-container {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 5px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.anamis-lucky-boxes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0 10px 0;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
}

/* هر جعبه */
.anamis-box {
    width: 130px;
    height: 150px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.anamis-box:hover {
    transform: translateY(-10px) scale(1.05);
}

.anamis-box-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.anamis-box.opened .anamis-box-inner {
    transform: rotateY(180deg);
}

.anamis-box.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

/* جلو و پشت جعبه */
.anamis-box-front,
.anamis-box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.anamis-box-front {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.anamis-box-back {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    transform: rotateY(180deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* درب جعبه */
.anamis-box-lid {
    width: 100%;
    height: 30px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    border-radius: 15px 15px 0 0;
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.anamis-box-lid::before {
    content: '🎀';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

/* بدنه جعبه */
.anamis-box-body {
    width: 100%;
    height: calc(100% - 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.anamis-box-icon {
    font-size: 50px;
    margin-bottom: 6px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.anamis-box-number {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* محتوای جایزه */
.anamis-prize-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.anamis-prize-icon {
    font-size: 50px;
    margin-bottom: 8px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.anamis-prize-text {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    line-height: 1.2;
}

/* دستورالعمل */
.anamis-box-instruction {
    font-size: 16px;
    color: #fff;
    margin: 10px 0 0 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

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

/* جعبه‌های باز شده */
.anamis-box.opened {
    pointer-events: none;
}

.anamis-box:not(.opened) {
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

/* حالت غیرفعال */
.anamis-box.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .anamis-lucky-boxes {
        gap: 12px;
    }
    
    .anamis-box {
        width: 120px;
        height: 140px;
    }
    
    .anamis-box-icon {
        font-size: 45px;
    }
    
    .anamis-box-number {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .anamis-lucky-box-container {
        padding: 5px 0;
        width: 100%;
    }
    
    .anamis-lucky-boxes {
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: center;
        padding: 0 5px;
        margin: 12px 0 8px 0;
    }
    
    .anamis-box {
        width: 110px;
        height: 130px;
        flex-shrink: 1;
    }
    
    .anamis-box-icon {
        font-size: 40px;
    }
    
    .anamis-box-number {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
    
    .anamis-prize-icon {
        font-size: 45px;
    }
    
    .anamis-prize-text {
        font-size: 14px;
    }
    
    .anamis-box-instruction {
        font-size: 15px;
        padding: 0 10px;
        margin: 8px 0 0 0;
    }
}

@media (max-width: 480px) {
    .anamis-lucky-box-container {
        padding: 5px 0;
        width: 100%;
    }
    
    .anamis-lucky-boxes {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        flex-wrap: nowrap;
        padding: 0;
        margin: 10px 0 5px 0;
    }
    
    .anamis-box {
        width: 95px;
        height: 115px;
        flex-shrink: 1;
    }
    
    .anamis-box-icon {
        font-size: 32px;
    }
    
    .anamis-box-number {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-width: 2px;
    }
    
    .anamis-prize-icon {
        font-size: 38px;
    }
    
    .anamis-prize-text {
        font-size: 12px;
    }
    
    .anamis-box-instruction {
        font-size: 13px;
        padding: 0 5px;
        margin: 8px 0 0 0;
    }
    
    .anamis-box-lid {
        height: 25px;
    }
    
    .anamis-box-lid::before {
        font-size: 20px;
    }
}

/* افکت کنفتی */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f093fb;
    z-index: 9999;
    pointer-events: none;
}
