/* Spin to Win 模态框样式 */

/* 模态框基础样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
    pointer-events: none;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    touch-action: none;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    background: linear-gradient(180deg, rgba(249, 3, 44, 0.87) 0%, rgba(252, 103, 43, 0.87) 100%);
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
}

/* 容器样式 */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 600px;
    padding: 10px 0;
}

.top-bg {
    position: absolute;
    top: 43px;
    left: 40px;
    right: 40px;
    height: 200px;
    background: url('/img/spin_to_win/ic_top_bg.svg') center top no-repeat;
    background-size: contain;
    z-index: 1;
    pointer-events: none;
}

.main-content {
    border-radius: 20px;
    padding: 20px 15px;
    margin: 10px;
    width: calc(100% - 20px);
    max-width: 380px;
    position: relative;
    z-index: 10;
}

.title {
    text-align: center;
    color: #fff;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: -10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.title img {
    width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.vip-description {
    text-align: center;
    color: #fff;
    font-size: 14px;
    margin: 10px 0;
}

/* 倒计时徽章 */
.countdown-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 8px auto 24px auto;
    padding: 0 12px 0 10px;
    height: 27px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: visible;
}

.countdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg, #FF7D49 0%, #FF4564 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(255, 69, 100, 0.35);
    flex-shrink: 0;
    margin-left: -12px;
    z-index: 1;
}

.countdown-icon img {
    width: 32px;
    height: 32px;
}

.countdown-time {
    font-weight: 800;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: 1px;
    color: #F9032C;
}

.time-bar {
    background: #fff;
    height: 8px;
    margin: 0 10px 25px;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid #FFCE9E;
}

.time-markers {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.time-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--progress-width, 0%);
    background: url('/img/spin_to_win/progress.svg') center center no-repeat;
    background-size: cover;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.time-marker {
    width: 12px;
    height: 12px;
    background: #FFCC7E;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #333;
    font-weight: bold;
    position: relative;
    z-index: 2;
    border: 2px solid #FFCC7E;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.time-marker.active {
    background: #fff3e0;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    border: 2px solid #fff;
}

.time-label {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 50px;
    white-space: nowrap;
}

.time-number {
    font-weight: bold;
    font-size: 12px;
}

.time-text {
    font-size: 8px;
    opacity: 0.9;
    white-space: nowrap;
    text-align: center;
}

/* 转盘样式 */
.wheel-container {
    margin: 70px 0 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spin-wheel {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    position: relative;
    background: url('/img/spin_to_win/wheel_bg.svg') center center no-repeat;
    background-size: cover;
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    touch-action: manipulation;
}

.wheel-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.wheel-segment:nth-child(1) .wheel-segment-text { transform: rotate(0deg) translateY(-160%); }
.wheel-segment:nth-child(2) .wheel-segment-text { transform: rotate(-60deg) translateY(-160%); }
.wheel-segment:nth-child(3) .wheel-segment-text { transform: rotate(-120deg) translateY(-160%); }
.wheel-segment:nth-child(4) .wheel-segment-text { transform: rotate(-180deg) translateY(-160%); }
.wheel-segment:nth-child(5) .wheel-segment-text { transform: rotate(-240deg) translateY(-160%); }
.wheel-segment:nth-child(6) .wheel-segment-text { transform: rotate(-300deg) translateY(-160%); }

.wheel-segment-text {
    position: relative;
    z-index: 50;
    font-weight: bold;
    color: #d32f2f;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 40px;
    min-height: 40px;
    text-align: center;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    z-index: 10;
}

.wheel-center .center-circle-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
}

.wheel-center .triangle-img {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 50%;
    width: 36px;
    height: auto;
}

/* 按钮样式 */
.spin-button {
    width: 258px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(75deg, #FF4564 9%, #FF7D49 84%);
    border: 2px solid rgba(255, 235, 188, 0.72);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin: 25px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.05s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: 0 8px 24px rgba(255, 69, 100, 0.4), 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.spin-button .ad-icon {
    width: 20px;
    height: 14px;
    display: none;
    margin-right: 8px;
}

.spin-button:hover {
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.4);
}

.spin-button.pressed:not(:disabled) {
    background: linear-gradient(75deg, #CC2A4A 9%, #CC5A2F 84%);
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(255, 69, 100, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
}

.spin-button.pressed:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    pointer-events: none;
}

.spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 说明文字 */
.instruction {
    position: relative;
    background: #8B0000;
    color: #F5F5F5;
    text-align: center;
    margin: 0 auto 20px;
    padding: 16px 0;
    border-radius: 12px;
    font-size: 10px;
    line-height: 1.5;
    max-width: 260px;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.instruction::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #8B0000;
}

/* 转盘动画 */
.spinning {
    animation: spin 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(var(--spin-degrees)); }
}

/* Spin to Win 按钮样式 */
.spin-to-win-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(37deg, #FF4564 5%, #FF7D49 91%);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0px 4px 10px 0px rgba(123, 7, 7, 0.51);
}

.spin-to-win-button:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 15px 0px rgba(123, 7, 7, 0.7);
}

.spin-to-win-button:active {
    transform: scale(0.95);
}

.spin-to-win-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .spin-to-win-button {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }

    .spin-to-win-icon {
        width: 40px;
        height: 40px;
    }

    .spin-to-win-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .content {
        width: 95%;
        max-width: 350px;
    }

    .main-content {
        padding: 15px 10px;
    }

    .title {
        font-size: 24px;
    }

    .spin-wheel {
        width: 280px;
        height: 280px;
    }

    .spin-button {
        width: 220px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .main-content {
        padding: 15px 10px;
    }

    .title {
        font-size: 22px;
    }

    .spin-wheel {
        width: 260px;
        height: 260px;
    }

    .time-marker {
        width: 10px;
        height: 10px;
        font-size: 8px;
    }

    .time-label {
        font-size: 9px;
    }
}

/* ==================== RTL（阿拉伯语）适配 ==================== */

/* Close button - RTL adaptation */
[dir="rtl"] .close-btn,
[lang="ar"] .close-btn {
    right: auto;
    left: 15px;
}

/* Floating button - RTL adaptation */
[dir="rtl"] .spin-to-win-button,
[lang="ar"] .spin-to-win-button {
    right: auto;
    left: 20px;
}

/* Countdown icon - RTL adaptation */
[dir="rtl"] .countdown-icon,
[lang="ar"] .countdown-icon {
    margin-left: auto;
    margin-right: -12px;
}

/* Progress bar - RTL adaptation */
[dir="rtl"] .time-bar::before,
[lang="ar"] .time-bar::before {
    left: auto;
    right: 0;
    transform-origin: right;
}

/* Time markers - RTL adaptation */
[dir="rtl"] .time-label,
[lang="ar"] .time-label {
    direction: ltr;
}

/* Ad icon - RTL adaptation */
[dir="rtl"] .spin-button .ad-icon,
[lang="ar"] .spin-button .ad-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Responsive - Mobile RTL */
@media (max-width: 768px) {
    [dir="rtl"] .spin-to-win-button,
    [lang="ar"] .spin-to-win-button {
        right: auto;
        left: 15px;
    }
}

