/* ==========================================================================
   ملف التنسيق الأساسي: instructions.css
   التصميم: واجهة تعليمات ونماذج أسئلة الشمعة والتفرد
   ========================================================================== */

:root {
    --bg-dark: #080514;
    --gold-title: #ffe69a;
    --gold-border: rgba(230, 197, 108, 0.35);
    --purple-border: rgba(168, 85, 247, 0.35);
    --cyan-border: rgba(34, 211, 238, 0.35);
    --warn-border: rgba(245, 158, 11, 0.35);
    --text-silver: #d5cee6;
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Tajawal', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: var(--font-body);
    color: #ffffff;
    overflow-x: hidden;
}

/* 1. إطار الشاشة مع خلفية النجوم الفلكية */
.instructions-screen {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    position: relative;
    padding: 16px 16px 40px 16px;
    display: flex;
    flex-direction: column;
    background-color: #070412;
    background-image: 
        radial-gradient(1px 1px at 35px 45px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 140px 90px, #ffe69a, transparent),
        radial-gradient(1px 1px at 290px 160px, #ffffff, transparent),
        radial-gradient(1.8px 1.8px at 70px 320px, rgba(216, 180, 254, 0.8), transparent),
        radial-gradient(1px 1px at 340px 450px, #ffffff, transparent),
        radial-gradient(circle at 50% 12%, rgba(68, 25, 115, 0.3) 0%, transparent 60%),
        linear-gradient(180deg, #070412 0%, #0e0824 50%, #05030e 100%);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
}

/* 2. شريط الرأس العلوي */
.inst-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 16px 0;
}

.inst-page-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-title);
    text-shadow: 0 0 10px rgba(230, 197, 108, 0.4);
}

.btn-back-inst {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-back-inst:hover {
    color: var(--gold-title);
}

.inst-spacer {
    width: 24px;
    height: 24px;
}

/* 3. صندوق التنبيه الأزرق */
.inst-notice-card {
    width: 100%;
    background: rgba(14, 22, 42, 0.65);
    border: 1px solid var(--cyan-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
}

.notice-icon-wrap {
    color: #38bdf8;
    flex-shrink: 0;
}

.notice-text {
    font-size: 13px;
    color: var(--text-silver);
    line-height: 1.5;
}

/* 4. الهيكل الموحد لبطاقات التعليمات */
.inst-card {
    width: 100%;
    border-radius: 18px;
    padding: 18px 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.card-title-group h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

/* بطاقة قواعد السؤال */
.card-rules {
    background: rgba(20, 15, 38, 0.65);
    border: 1px solid var(--gold-border);
}

.title-rules h2 {
    color: var(--gold-title);
}

/* بطاقة الشمعة الفلكية */
.card-candle {
    background: rgba(22, 14, 44, 0.65);
    border: 1px solid var(--purple-border);
}

.title-candle h2 {
    color: #d8b4fe;
}

/* بطاقة شيفرة التفرد */
.card-cipher {
    background: rgba(14, 22, 42, 0.65);
    border: 1px solid var(--cyan-border);
}

.title-cipher h2 {
    color: #67e8f9;
}

/* بطاقة التحذيرات */
.card-warnings {
    background: rgba(25, 18, 35, 0.65);
    border: 1px solid var(--warn-border);
}

.title-warnings h2 {
    color: #fbbf24;
}

/* 5. القوائم وعناصر النصوص */
.inst-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inst-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bullet-check {
    color: #ffe69a;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.bullet-key {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.inst-list-item p {
    font-size: 13.5px;
    color: var(--text-silver);
    line-height: 1.55;
}

/* 6. صناديق التحذيرات الفرعية */
.warning-boxes-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warning-box {
    background: rgba(35, 22, 35, 0.6);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.warn-icon {
    color: #fbbf24;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-box p {
    font-size: 13px;
    color: #fde68a;
    line-height: 1.55;
}

/* 7. قسم نماذج أسئلة — الشمعة الفلكية والأكورديون */
.sample-questions-section {
    width: 100%;
    margin-top: 8px;
}

.sample-section-cipher {
    margin-top: 24px;
}

.sample-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.purple-bar {
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #c084fc, #7c3aed);
    border-radius: 2px;
}

.bar-gold {
    background: linear-gradient(180deg, #fde047, #d97706);
}

.sample-section-header h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--gold-title);
}

.accordion-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    width: 100%;
    background: rgba(20, 15, 42, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.accordion-item.open {
    border-color: #c084fc;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
}

.accordion-trigger {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.question-mark-icon {
    width: 22px;
    height: 22px;
    border: 1px solid #ffe69a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffe69a;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.accordion-label {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    flex-grow: 1;
    text-align: right;
    padding: 0 12px;
}

.chevron-arrow {
    color: #c084fc;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-item.open .chevron-arrow {
    transform: rotate(180deg);
}

/* درج البرداية المنسدلة */
.accordion-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(12, 8, 28, 0.6);
}

.accordion-item.open .accordion-drawer {
    max-height: 1200px;
}

.drawer-inner-content {
    padding: 14px 16px 18px 16px;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
}

.placeholder-q {
    font-size: 13px;
    color: #d8b4fe;
    line-height: 1.5;
}

/* 8. قائمة ونماذج الأسئلة داخل الأكورديون */
.sample-q-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sample-q-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sample-q-item:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

/* شارة رقم السؤال */
.q-badge {
    width: 26px;
    height: 26px;
    background: #1e3a5f;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    margin-top: 2px;
}

/* نص السؤال */
.q-content {
    font-size: 13.5px;
    color: #e2d9f3;
    line-height: 1.65;
    flex-grow: 1;
    text-align: right;
    user-select: text;
}

/* زر نسخ السؤال */
.btn-copy-q {
    background: transparent;
    border: none;
    color: #c084fc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: color 0.2s, transform 0.2s;
}

.btn-copy-q svg {
    width: 20px;
    height: 20px;
    stroke: #c084fc;
    transition: stroke 0.2s;
}

.btn-copy-q:hover svg {
    stroke: var(--gold-title);
}

.btn-copy-q:active {
    transform: scale(0.9);
}

/* 9. صندوق التنبيه المخصص داخل قسم الرهانات */
.q-notice-box {
    margin-top: 14px;
    background: rgba(30, 20, 36, 0.65);
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-notice-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
}

.horn-icon {
    font-size: 16px;
}

.q-notice-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-notice-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.excl-mark {
    color: #fbbf24;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1.5;
}

.q-notice-list p {
    font-size: 12.5px;
    color: #fde68a;
    line-height: 1.55;
}

/* 10. إشعار النسخ المنبثق (Toast) */
.copy-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(18, 12, 38, 0.95);
    border: 1px solid #c084fc;
    color: var(--gold-title);
    padding: 9px 20px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}