/* 7B2抽奖插件增强样式 - v1.1.0 */

/* 积分不足动画效果 */
.insufficient-points-shake {
    animation: shake 0.5s ease-in-out 3;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.insufficient-points-highlight {
    animation: points-highlight 1s ease-in-out 2;
    color: #ff4757 !important;
    font-weight: bold;
}

@keyframes points-highlight {
    0%, 100% { 
        background-color: transparent;
        transform: scale(1);
    }
    50% { 
        background-color: rgba(255, 71, 87, 0.2);
        transform: scale(1.1);
        border-radius: 8px;
        padding: 4px 8px;
    }
}

.btn-shake {
    animation: btn-shake 0.3s ease-in-out 4;
}

@keyframes btn-shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    75% { transform: translateX(5px) rotate(2deg); }
}

/* 动画消息样式 */
.lottery-animated-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
}

.lottery-animated-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.lottery-animated-message.insufficient-points .message-content {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    animation: message-bounce 0.6s ease-out;
}

@keyframes message-bounce {
    0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.message-icon {
    font-size: 24px;
    animation: icon-pulse 1s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 飘动积分图标 */
.floating-points-icon {
    position: absolute;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.floating-points-icon.floating {
    opacity: 1;
    animation: float-up 3s ease-out forwards;
}

@keyframes float-up {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) rotate(360deg);
        opacity: 0;
    }
}

.floating-points-icon .points-icon {
    font-size: 24px;
    display: block;
    animation: icon-spin 2s linear infinite;
}

.floating-points-icon .points-text {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-top: 4px;
}

@keyframes icon-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 优化抽奖界面整体设计 */
.b7b2-lottery-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    margin: 20px auto;
    max-width: 600px;
}

.b7b2-lottery-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: bg-rotate 20s linear infinite;
    z-index: 0;
}

@keyframes bg-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lottery-grid {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.lottery-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: 3px solid #fff;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lottery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.lottery-item:hover::before {
    left: 100%;
}

.lottery-item.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
}

.lottery-draw-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border: none;
    color: white;
    font-size: 18px;
    font-weight: 700;
    padding: 15px 40px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
    margin: 20px auto;
    display: block;
}

.lottery-draw-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.lottery-draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.4);
}

.lottery-draw-btn:hover::before {
    left: 100%;
}

.lottery-draw-btn:active {
    transform: translateY(0);
}

.lottery-draw-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 用户信息区域美化 */
.lottery-user-info {
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.user-points, .remaining-draws {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.user-points::before {
    content: '💰';
    font-size: 20px;
}

.remaining-draws::before {
    content: '🎯';
    font-size: 20px;
}

/* 统计信息美化 */
.lottery-stats {
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stats-item {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stats-item:hover {
    transform: translateY(-5px);
}

.stats-value {
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.stats-label {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .b7b2-lottery-container {
        padding: 20px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .lottery-user-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .lottery-draw-btn {
        font-size: 16px;
        padding: 12px 30px;
    }
    
    .lottery-animated-message.insufficient-points .message-content {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .floating-points-icon .points-icon {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .lottery-user-info,
    .lottery-stats {
        background: rgba(30, 30, 30, 0.9);
        color: #fff;
    }
    
    .user-points, .remaining-draws {
        color: #fff;
    }
    
    .lottery-grid {
        background: rgba(30, 30, 30, 0.95);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .lottery-item {
        border-width: 4px;
    }
    
    .lottery-draw-btn {
        border: 2px solid #fff;
    }
    
    .lottery-animated-message.insufficient-points .message-content {
        border: 3px solid #fff;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .insufficient-points-shake,
    .btn-shake,
    .message-bounce,
    .icon-pulse,
    .float-up,
    .icon-spin,
    .bg-rotate {
        animation: none;
    }
    
    .lottery-item,
    .lottery-draw-btn,
    .stats-item {
        transition: none;
    }
}