/* --- استایل‌های انکپسوله شده --- */
#moniran-widget-root {
    --color-primary: #005D89;       /* آبی منیران */
    --color-primary-dark: #004a6e;
    --color-primary-light: #e0f2fe;
    --color-secondary: #FBC62C;     /* زرد منیران */
    --color-secondary-hover: #e5b21e;
    --color-success: #48B988;       /* سبز منیران */
    --color-bg: #f8fafc;
    --color-text: #334155;
    
    /* رنگ‌های شبکه اجتماعی */
    --color-telegram: #229ED9;
    --color-whatsapp: #25D366;
    --color-eitaa: #E37B21;
    --color-rubika: #9625BA;
    --color-shad: #3D5A80;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 93, 137, 0.15), 0 4px 6px -2px rgba(0, 93, 137, 0.1);
    --shadow-glow: 0 0 20px rgba(251, 198, 44, 0.5);
    --radius-lg: 24px;
    --radius-md: 16px;
    
    /* فونت پیش‌فرض */
    --font-main: inherit; /* استفاده از فونت قالب وردپرس */
    
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    text-align: right;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    max-width: 1100px;
    margin: 40px auto;
    position: relative;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 700px;
    direction: rtl; /* اجبار جهت راست چین */
}

#moniran-widget-root * {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* --- نوار عنوان داخلی (جایگزین هدر) --- */
#moniran-widget-root .widget-title-bar {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: 20px 30px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#moniran-widget-root .integrated-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    color: white !important;
}

#moniran-widget-root .widget-title-bar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

/* دکمه بازگشت */
#moniran-widget-root .btn-home {
    background: var(--color-secondary);
    color: #0f172a;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(251, 198, 44, 0.4);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    left: 20px;
}

#moniran-widget-root .btn-home:hover {
    background: var(--color-secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(251, 198, 44, 0.5);
}

/* --- محتوای اصلی --- */
#moniran-widget-root .main-content {
    padding: 30px;
    flex-grow: 1;
    position: relative;
}

/* --- فوتر --- */
#moniran-widget-root .app-footer {
    text-align: center;
    padding: 15px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    flex-shrink: 0;
}
#moniran-widget-root .app-footer span {
    color: var(--color-primary);
    text-decoration: none;
}

/* --- صفحه اصلی --- */
#moniran-widget-root .hero-section {
    text-align: center;
    margin-bottom: 40px;
}

#moniran-widget-root h2 { color: var(--color-primary); font-weight: 800; margin-bottom: 10px; font-size: 1.8rem; }
#moniran-widget-root h3 { color: var(--color-primary); font-weight: 800; margin-bottom: 10px; font-size: 1.6rem; }
#moniran-widget-root .subtitle { color: #64748b; font-size: 1.1rem; font-weight: 500; }

/* کارت شروع */
#moniran-widget-root .card-iq-wrapper { display: flex; justify-content: center; margin-bottom: 50px; }

#moniran-widget-root .card-btn {
    background: white;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 300px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

#moniran-widget-root .card-btn::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 6px;
    background: var(--color-primary); transition: height 0.3s ease;
}

#moniran-widget-root .card-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--color-primary-light);
}
#moniran-widget-root .card-btn:hover::after { height: 100%; opacity: 0.05; }

#moniran-widget-root .icon-circle {
    width: 80px; height: 80px; background: var(--color-primary-light);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px; transition: transform 0.3s ease;
}
#moniran-widget-root .card-btn:hover .icon-circle { transform: scale(1.1) rotate(5deg); background: #d0e8fc; }
#moniran-widget-root .card-btn h4 { margin: 0 0 8px; font-size: 1.3rem; color: var(--color-primary); font-weight: 700; }

/* --- لیدربرد (۳ ستون) --- */
#moniran-widget-root .leaderboards { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    width: 100%; 
}

@media (max-width: 768px) {
    #moniran-widget-root .leaderboards { 
        grid-template-columns: 1fr; 
    }
}

#moniran-widget-root .leaderboard-box {
    background: white; border-radius: var(--radius-md); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid #f1f5f9;
    height: 100%;
}
#moniran-widget-root .lb-header {
    padding: 15px; background: linear-gradient(to left, #f0f9ff, white);
    color: var(--color-primary); font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px;
    border-bottom: 1px solid #e2e8f0; font-size: 1rem; text-align: center;
}
#moniran-widget-root .lb-easy .lb-header { background: linear-gradient(to left, #ecfdf5, white); color: #059669; }
#moniran-widget-root .lb-medium .lb-header { background: linear-gradient(to left, #fff7ed, white); color: #ea580c; }
#moniran-widget-root .lb-hard .lb-header { background: linear-gradient(to left, #eff6ff, white); color: #2563eb; }

#moniran-widget-root .lb-item {
    padding: 10px 15px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s;
}
#moniran-widget-root .lb-item:last-child { border-bottom: none; }
#moniran-widget-root .lb-item:hover { background: #f8fafc; }
#moniran-widget-root .rank-badge {
    width: 24px; height: 24px; background: #f1f5f9; color: #64748b; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; margin-left: 8px;
}
#moniran-widget-root .rank-1 { background: var(--color-secondary); color: white; }
#moniran-widget-root .rank-2 { background: #94a3b8; color: white; }
#moniran-widget-root .rank-3 { background: #cbd5e1; color: white; }
#moniran-widget-root .lb-name { font-weight: 600; color: #334155; font-size: 0.9rem; }
#moniran-widget-root .lb-grade { font-size: 0.7rem; background: #e2e8f0; padding: 2px 6px; border-radius: 10px; margin-right: 5px; color: #64748b; }
#moniran-widget-root .lb-score { font-weight: 800; color: var(--color-primary); font-size: 1rem; }

/* --- فرم ورودی --- */
#moniran-widget-root .input-container {
    max-width: 450px; margin: 20px auto; background: white; padding: 40px;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-md); text-align: center;
    position: relative; overflow: hidden;
}
#moniran-widget-root .input-container::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
}
#moniran-widget-root .form-group { margin-bottom: 24px; text-align: right; }
#moniran-widget-root label { display: block; margin-bottom: 8px; font-weight: 700; color: #475569; font-size: 0.95rem; }
#moniran-widget-root input, #moniran-widget-root select {
    width: 100%; padding: 14px; border: 2px solid #e2e8f0; border-radius: 12px;
    font-family: inherit; font-size: 1rem; background: #f8fafc; transition: all 0.3s; color: #334155;
}
#moniran-widget-root input:focus, #moniran-widget-root select:focus {
    border-color: var(--color-primary); background: white; box-shadow: 0 0 0 4px var(--color-primary-light);
}
#moniran-widget-root .btn-submit {
    width: 100%; padding: 16px; background: linear-gradient(135deg, var(--color-secondary), #f59e0b);
    color: white; border: none; border-radius: 12px; font-weight: 800; font-size: 1.1rem;
    cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    display: flex; justify-content: center; align-items: center; gap: 10px;
}
#moniran-widget-root .btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4); }

/* --- صفحه آزمون --- */
#moniran-widget-root .quiz-container { max-width: 650px; margin: 0 auto; }
#moniran-widget-root .quiz-header {
    display: flex; justify-content: space-between; margin-bottom: 15px; font-weight: 700;
    color: #64748b; background: white; padding: 10px 20px; border-radius: 50px; box-shadow: var(--shadow-sm);
}
#moniran-widget-root .progress-container {
    background: #e2e8f0; height: 12px; border-radius: 50px; margin-bottom: 30px; overflow: hidden;
}
#moniran-widget-root .progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--color-primary), #3b82f6);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 50px;
}
#moniran-widget-root .question-box {
    background: white; padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); text-align: center;
}
#moniran-widget-root .question-text { 
    font-size: 1.3rem; font-weight: 800; margin-bottom: 35px; color: #1e293b; line-height: 1.8;
}
#moniran-widget-root .options-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media(max-width: 500px) { #moniran-widget-root .options-grid { grid-template-columns: 1fr; } }
#moniran-widget-root .option-btn {
    background: #f8fafc; border: 2px solid #e2e8f0; padding: 20px; border-radius: 16px;
    cursor: pointer; font-family: inherit; font-size: 1.05rem; font-weight: 500;
    color: #475569; transition: all 0.2s; position: relative;
}
#moniran-widget-root .option-btn:hover { 
    background: white; border-color: var(--color-primary); color: var(--color-primary);
    transform: translateY(-2px); box-shadow: 0 4px 12px var(--color-primary-light);
}
#moniran-widget-root .option-btn:active { transform: scale(0.98); }

/* --- صفحه نتایج مدرن --- */
#moniran-widget-root .result-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: none;
    box-shadow: 0 15px 35px rgba(0, 93, 137, 0.15);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(circle at top right, #f8fcff, white);
}

#moniran-widget-root .result-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 8px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
}

#moniran-widget-root .score-circle {
    width: 140px; height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 93, 137, 0.15);
    border: 4px solid var(--color-primary-light);
    position: relative;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
}

#moniran-widget-root .score-display {
    font-size: 3.5rem; font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary), #2563eb);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1;
}

#moniran-widget-root .score-label { font-size: 0.8rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

#moniran-widget-root .res-name { margin: 0; font-size: 1.6rem; color: #1e293b; font-weight: 800; }
#moniran-widget-root .res-grade { color: #64748b; margin: 5px 0 20px; font-weight: 500; font-size: 1rem; }

#moniran-widget-root .res-msg-box {
    background: #ecfdf5; padding: 15px; border-radius: 12px; color: #059669;
    margin-top: 20px; font-weight: 700; border: 1px solid #d1fae5;
}

/* دکمه‌های اشتراک‌گذاری */
#moniran-widget-root .share-title { font-size: 0.9rem; color: #64748b; font-weight: 600; margin: 30px 0 15px; text-align: center; }

#moniran-widget-root .share-buttons {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

#moniran-widget-root .btn-share {
    width: 50px; height: 50px; border-radius: 12px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; color: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#moniran-widget-root .btn-share:hover { transform: translateY(-3px); filter: brightness(1.1); }

#moniran-widget-root .bg-telegram { background-color: var(--color-telegram); }
#moniran-widget-root .bg-whatsapp { background-color: var(--color-whatsapp); }
#moniran-widget-root .bg-eitaa { background-color: var(--color-eitaa); }
#moniran-widget-root .bg-rubika { background-color: var(--color-rubika); }
#moniran-widget-root .bg-shad { background-color: var(--color-shad); }

#moniran-widget-root .btn-return {
    margin-top: 30px; background: #f1f5f9; color: #475569; width: 100%; padding: 14px;
    border-radius: 12px; border: none; font-weight: 700; cursor: pointer; transition: 0.2s;
}
#moniran-widget-root .btn-return:hover { background: #e2e8f0; color: #334155; }

/* انیمیشن‌ها */
.hidden-section { display: none !important; }
.fade-in { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }