/* slw.css - نسخه نهایی با دکمه وسط‌چین */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray: #6b7280;
    --light-gray: #9ca3af;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #4b5563;
    --radius: 12px;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--text-dark);
    min-height: 100vh;
    direction: rtl;
    line-height: 1.6;
}

/* کانتینر اصلی - مرکزگرا */
.container {
    max-width: 500px;
    margin: 0 auto;
}

/* ===== گردونه ===== */
#wheelContainer {
    position: relative;
    max-width: 400px;
    margin: 1.5rem auto;
    text-align: center;
    background: transparent;
}

#luckyWheel {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

/* دکمه چرخش - کاملاً وسط */
#spinBtn {
    display: block;
    width: 200px;
    margin: 25px auto 20px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59,130,246,0.4);
    text-align: center;
}

#spinBtn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(59,130,246,0.5);
}

#spinBtn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* نتیجه گردونه - باکس زیبا */
#wheelResult {
    margin: 20px auto 0;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    direction: rtl;
    max-width: 380px;
}

#wheelResult div:first-child {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--success);
    margin-bottom: 15px;
}

/* کد تخفیف - قابل کپی */
#wheelResult div[style*="ltr"] {
    background: #eff6ff;
    padding: 14px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all;
    direction: ltr;
    text-align: center;
}

/* ===== مودال‌ها ===== */
.slw-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.slw-modal-content {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

/* ===== فرم ثبت‌نام ===== */
#registerSection {
    max-width: 450px;
    margin: 0 auto 2rem;
    background: var(--bg-white);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-md);
}

#registerSection h2 {
    margin: 0 0 1.5rem;
    font-size: 1.6rem;
    color: var(--text-dark);
    text-align: center;
}

#registerSection input,
#registerSection select {
    width: 100%;
    padding: 14px 16px;
    margin: 10px 0;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    transition: all 0.2s ease;
}

#registerSection input:focus,
#registerSection select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* دکمه دریافت کد */
.button-wrapper {
    margin: 25px auto 20px;
    text-align: center;
}

.btn-submit {
    width: 100%;
    max-width: 280px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59,130,246,0.3);
}

/* ===== مودال OTP ===== */
.otp-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1.8rem;
}

.btn-confirm,
.btn-resend,
.btn-cancel {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm {
    background: var(--success);
    color: white;
}

.btn-resend {
    background: var(--warning);
    color: white;
}

.btn-resend:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-cancel {
    background: var(--danger);
    color: white;
}

/* ===== آمار تخفیف‌ها ===== */
#discountStats {
    max-width: 450px;
    margin: 2rem auto;
    text-align: right;
}

.discount-item {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

.discount-item strong {
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.winners-list {
    margin-top: 10px;
    padding-right: 15px;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ===== باکس توضیحات سرویس‌ها ===== */
.service-summary {
    margin: 25px 0 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
}

.service-box h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.service-box li {
    margin-bottom: 4px;
    padding-right: 20px;
    position: relative;
}

.service-box li:before {
    content: "•";
    color: #10b981;
    position: absolute;
    right: 0;
}

/* ===== وضعیت غیرفعال ===== */
#registerSection input:disabled,
#registerSection select:disabled {
    background: #f3f4f6;
    opacity: 0.7;
    cursor: not-allowed;
}

#registerSection.verified-hidden,
#serviceSummary.verified-hidden {
    display: none !important;
}

/* ===== ریسپانسیو موبایل ===== */
@media (max-width: 550px) {
    body {
        padding: 12px;
    }

    #registerSection {
        padding: 1.5rem 1rem;
        margin: 0 auto 1.5rem;
    }

    #registerSection h2 {
        font-size: 1.4rem;
    }

    input, select, .btn-submit {
        font-size: 0.95rem;
        padding: 12px 14px;
    }

    #wheelContainer {
        max-width: 320px;
        margin: 1rem auto;
    }

    #luckyWheel {
        max-width: 300px;
    }

    #spinBtn {
        width: 170px;
        padding: 12px 24px;
        font-size: 1rem;
        margin: 20px auto 15px;
    }

    #wheelResult {
        padding: 15px;
        max-width: 320px;
    }

    #wheelResult div:first-child {
        font-size: 1.4rem;
    }

    .discount-item {
        padding: 1rem;
    }

    .service-box {
        padding: 12px;
    }
}

/* برای صفحات بسیار کوچک (موبایل‌های قدیمی) */
@media (max-width: 380px) {
    #wheelContainer {
        max-width: 280px;
    }

    #luckyWheel {
        max-width: 260px;
    }

    #spinBtn {
        width: 150px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* انیمیشن ملایم */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#wheelContainer {
    animation: fadeInUp 0.5s ease;
}