/* ╔═══════════════════════════════════════════════╗ */
/* ║  قضية — توكنات AI — الواجهة الأمامية         ║ */
/* ╚═══════════════════════════════════════════════╝ */

/* === صفحة التوليد === */
.qtok-page {
    max-width: 700px;
    margin: 30px auto;
    padding: 0 16px;
    direction: rtl;
}

/* بطاقة الرصيد */
.qtok-balance-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.qtok-balance-icon {
    font-size: 40px;
    line-height: 1;
}
.qtok-balance-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.qtok-balance-label {
    font-size: 13px;
    opacity: .85;
}
.qtok-balance-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}
.qtok-buy-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    background: #f59e0b;
    color: #1e1b2e !important;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform .15s, background .2s;
    white-space: nowrap;
}
.qtok-buy-btn:hover {
    background: #d97706;
    transform: scale(1.04);
    color: #1e1b2e !important;
}

/* التبويبات */
.qtok-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.qtok-tab {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #3b3560;
    border-radius: 12px;
    background: #1e1b30;
    color: #ccc;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.qtok-tab:hover {
    border-color: #7c3aed;
    color: #fff;
}
.qtok-tab.active {
    border-color: #7c3aed;
    background: #2d2750;
    color: #fff;
}
.qtok-cost {
    font-size: 11px;
    background: rgba(124, 58, 237, .3);
    padding: 2px 10px;
    border-radius: 20px;
    color: #c4b5fd;
}
.qtok-tab.active .qtok-cost {
    background: #7c3aed;
    color: #fff;
}

/* الفورم */
.qtok-form {
    padding: 24px;
    border-radius: 16px;
    background: #1e1b30;
    border: 1px solid #2d2750;
    margin-bottom: 20px;
}
.qtok-form h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #fff;
}
.qtok-desc {
    color: #9ca3af;
    font-size: 13px;
    margin: 0 0 20px;
}
.qtok-label {
    display: block;
    color: #d1d5db;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 12px;
}
.qtok-select,
.qtok-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #3b3560;
    background: #12101f;
    color: #fff;
    font-size: 14px;
    direction: rtl;
    transition: border-color .2s;
}
.qtok-select:focus,
.qtok-input:focus {
    outline: none;
    border-color: #7c3aed;
}

/* زر التوليد */
.qtok-generate-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, opacity .2s;
}
.qtok-generate-btn:hover:not(:disabled) {
    transform: scale(1.02);
}
.qtok-generate-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* مؤشر التحميل */
.qtok-loading {
    text-align: center;
    padding: 40px;
    color: #c4b5fd;
    font-size: 14px;
}
.qtok-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #3b3560;
    border-top-color: #7c3aed;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: qtokSpin .8s linear infinite;
}
@keyframes qtokSpin {
    to { transform: rotate(360deg); }
}

/* النتيجة */
.qtok-result {
    padding: 24px;
    border-radius: 16px;
    background: #1e1b30;
    border: 2px solid #22c55e;
    margin-bottom: 20px;
}
.qtok-result-title {
    font-size: 18px;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 12px;
}
.qtok-result-text {
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}
.qtok-result-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.qtok-result-option {
    padding: 12px 16px;
    border-radius: 10px;
    background: #2d2750;
    border: 1px solid #3b3560;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
}
.qtok-result-option:hover {
    border-color: #7c3aed;
}
.qtok-result-option.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, .15);
}
.qtok-result-option.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, .1);
}
.qtok-result-explanation {
    padding: 14px;
    border-radius: 10px;
    background: rgba(124, 58, 237, .1);
    border: 1px solid rgba(124, 58, 237, .3);
    color: #c4b5fd;
    font-size: 13px;
    line-height: 1.6;
    display: none;
}
.qtok-result-again-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #7c3aed;
    background: transparent;
    color: #c4b5fd;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: all .2s;
}
.qtok-result-again-btn:hover {
    background: #7c3aed;
    color: #fff;
}

/* رسالة تسجيل الدخول */
.qtok-login-msg {
    text-align: center;
    padding: 60px 20px;
    color: #d1d5db;
}
.qtok-login-msg h2 {
    color: #fff;
    margin-bottom: 10px;
}
.qtok-login-msg .btn-primary {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 28px;
    border-radius: 10px;
    background: #7c3aed;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

/* ╔═══════════════════════════════════════════════╗ */
/* ║  البانر الترويجي                              ║ */
/* ╚═══════════════════════════════════════════════╝ */
.qtok-promo-banner {
    margin: 24px auto;
    max-width: 900px;
    padding: 0 16px;
}
.qtok-promo-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e1b30 0%, #2d2750 100%);
    border: 1px solid #7c3aed;
    flex-wrap: wrap;
}
.qtok-promo-icon {
    font-size: 36px;
    line-height: 1;
}
.qtok-promo-text {
    flex: 1;
    min-width: 200px;
}
.qtok-promo-text strong {
    display: block;
    color: #fff;
    font-size: 16px;
    margin-bottom: 4px;
}
.qtok-promo-text span {
    color: #9ca3af;
    font-size: 13px;
}
.qtok-promo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.qtok-promo-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s;
}
.qtok-promo-btn:hover { transform: scale(1.04); }
.qtok-promo-btn-primary {
    background: #7c3aed;
    color: #fff !important;
}
.qtok-promo-btn-secondary {
    background: transparent;
    border: 2px solid #7c3aed;
    color: #c4b5fd !important;
}
.qtok-promo-btn-secondary:hover {
    background: #7c3aed;
    color: #fff !important;
}

/* زر عائم */
.qtok-float-promo {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 30px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(124, 58, 237, .4);
    z-index: 999;
    animation: qtokFloat 3s ease-in-out infinite;
    transition: transform .15s;
}
.qtok-float-promo:hover {
    transform: scale(1.1);
    color: #fff !important;
}
.qtok-float-icon { font-size: 20px; }
@keyframes qtokFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ╔═══════════════════════════════════════════════╗ */
/* ║  Light Theme Support                          ║ */
/* ╚═══════════════════════════════════════════════╝ */
[data-theme="light"] .qtok-tab {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}
[data-theme="light"] .qtok-tab.active {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #5b21b6;
}
[data-theme="light"] .qtok-form {
    background: #fff;
    border-color: #e5e7eb;
}
[data-theme="light"] .qtok-form h3 { color: #111827; }
[data-theme="light"] .qtok-select,
[data-theme="light"] .qtok-input {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}
[data-theme="light"] .qtok-result {
    background: #fff;
    border-color: #22c55e;
}
[data-theme="light"] .qtok-result-text { color: #374151; }
[data-theme="light"] .qtok-result-option {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}
[data-theme="light"] .qtok-promo-inner {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #7c3aed;
}
[data-theme="light"] .qtok-promo-text strong { color: #111827; }
[data-theme="light"] .qtok-promo-text span { color: #6b7280; }

/* ╔═══════════════════════════════════════════════╗ */
/* ║  Responsive                                   ║ */
/* ╚═══════════════════════════════════════════════╝ */
@media (max-width: 600px) {
    .qtok-balance-card { flex-direction: column; text-align: center; }
    .qtok-balance-number { font-size: 28px; }
    .qtok-promo-inner { flex-direction: column; text-align: center; }
    .qtok-promo-actions { justify-content: center; }
    .qtok-float-text { display: none; }
    .qtok-float-promo { padding: 12px; border-radius: 50%; }
}
