/* ============================================
   فایل استایل مشترک برای تمام تست‌ها و بازی‌های سامانه
   مسیر موفقیت - نسخه ۱.۰
   تاریخ: خرداد ۱۴۰۵
   ============================================ */

/* ---------- فونت و ریشه ---------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}

:root {
    --primary: #1e3a8a;
    --primary-dark: #0d2b6e;
    --primary-light: #2d4da8;
    --secondary: #facc15;
    --success: #10b981;
    --danger: #ef4444;
    --info: #3b82f6;
    --warning: #f59e0b;
    --gray-light: #f3f4f6;
    --gray-border: #e5e7eb;
    --text-dark: #1f2937;
    --text-gray: #4b5563;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

/* ---------- تنظیمات پایه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    min-height: 100vh;
    direction: rtl;
    line-height: 1.6;
    color: var(--text-dark);
}

/* ---------- هدر ---------- */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.header-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    transition: transform 0.2s;
}

.header-logo img:hover {
    transform: rotate(5deg) scale(1.05);
}

.header-logo span {
    color: var(--secondary);
    font-size: 1.4rem;
    font-weight: 900;
    white-space: nowrap;
}

.back-home {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

/* ---------- کانتینر اصلی ---------- */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ---------- کارت تست و بازی ---------- */
.test-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-card:hover {
    box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.15);
}

.test-title {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    border-right: 5px solid var(--secondary);
    padding-right: 1rem;
    font-weight: 800;
}

.test-desc {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    padding-right: 1rem;
    font-size: 0.95rem;
}

/* ---------- باکس محتوای سئو ---------- */
.seo-box {
    background: #f0f4fa;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    border-right: 4px solid var(--secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.seo-box h3 {
    color: var(--primary);
    margin-bottom: 0.7rem;
    font-size: 1.2rem;
}

.seo-box a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

/* ---------- نوار پیشرفت ---------- */
.progress-bar {
    background: var(--gray-border);
    border-radius: 20px;
    height: 10px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    height: 100%;
    transition: width 0.3s;
}

/* ---------- سوالات ---------- */
.question {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-border);
}

.question-text {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.options {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.5rem 1.2rem;
    background: var(--gray-light);
    border-radius: 40px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.option.selected {
    background: var(--primary);
    color: white;
}

.option input {
    margin: 0;
    cursor: pointer;
}

/* ---------- دکمه‌ها ---------- */
.btn {
    padding: 0.7rem 1.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 40px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #0ea37a;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background: var(--warning);
}

.btn-danger {
    background: var(--danger);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

/* ---------- بخش اطلاعات کاربر ---------- */
.user-info {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--gray-border);
}

.user-info label {
    font-weight: 600;
    color: var(--primary);
}

.user-info input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    font-size: 0.9rem;
}

/* ---------- تایمر و نشانگر بخش ---------- */
.timer {
    background: #1e293b;
    color: var(--secondary);
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-badge {
    display: inline-block;
    background: var(--info);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    margin-right: 0.5rem;
}

/* ---------- نتیجه تست ---------- */
.result-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #fefce8 100%);
    border-right: 5px solid var(--success);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.factor-result {
    margin-bottom: 1.2rem;
    border-right: 3px solid var(--secondary);
    padding-right: 1rem;
}

.factor-result h4 {
    color: var(--primary);
    margin-bottom: 0.4rem;
}

/* ---------- نمایشگر IQ ---------- */
.iq-gauge {
    background: var(--gray-border);
    border-radius: 30px;
    height: 20px;
    margin: 1rem 0;
    overflow: hidden;
}

.iq-fill {
    background: linear-gradient(90deg, var(--primary), var(--info));
    height: 100%;
    border-radius: 30px;
    transition: width 0.6s ease-out;
}

.iq-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

.score-card {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-weight: bold;
    margin-left: 0.5rem;
}

.category-highlight {
    background: #dbeafe;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-weight: bold;
    color: var(--primary);
}

/* ---------- دکمه چاپ و دانلود ---------- */
.print-btn {
    background-color: #4b5563;
    margin-left: 1rem;
}

.print-btn:hover {
    background-color: #374151;
    transform: translateY(-2px);
}

/* ---------- لینک بازگشت و CTA ---------- */
.cta-button {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 1rem;
    text-align: center;
    transition: all 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* ---------- فوتر ---------- */
footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--primary-dark);
    color: white;
    margin-top: 2rem;
    font-size: 0.85rem;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 768px) {
    .test-card {
        padding: 1.2rem;
    }
    .test-title {
        font-size: 1.4rem;
    }
    .options {
        gap: 0.5rem;
    }
    .option {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    .btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.8rem;
    }
    .user-info {
        flex-direction: column;
        align-items: stretch;
    }
    .user-info input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-logo span {
        font-size: 1rem;
    }
    .header-logo img {
        width: 32px;
        height: 32px;
    }
    .back-home {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    .test-title {
        font-size: 1.2rem;
    }
    .timer {
        font-size: 0.9rem;
    }
}

/* ---------- تنظیمات چاپ ---------- */
@media print {
    header, footer, .nav-buttons, .btn:not(.print-action), 
    .back-link, .cta-button, .test-title, .test-desc, 
    .print-btn, .user-info, .seo-box {
        display: none !important;
    }
    .result-box {
        margin: 0;
        padding: 0;
        background: white;
        border: none;
        box-shadow: none;
    }
    .container {
        margin: 0;
        padding: 0;
    }
    .test-card {
        padding: 0;
        background: white;
        box-shadow: none;
    }
    body {
        background: white;
    }
}

/* ---------- کلاس‌های کمکی ---------- */
.text-center {
    text-align: center;
}
.mt-2 {
    margin-top: 1rem;
}
.mb-2 {
    margin-bottom: 1rem;
}
.d-none {
    display: none;
}
.d-block {
    display: block;
}

/* ---------- استایل‌های خاص بازی حافظه و تطابق ---------- */
.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 2rem 0;
}
.card-item {
    background: var(--primary);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: 0.3s;
    box-shadow: var(--shadow-sm);
}
.card-item.flipped, .card-item.matched {
    background: var(--success);
    transform: scale(0.98);
}
.card-item.matched {
    background: #9ca3af;
    cursor: default;
    opacity: 0.6;
}
@media (max-width: 550px) {
    .card-item {
        height: 70px;
        font-size: 1.5rem;
    }
}

/* ---------- استایل‌های ویژه بازی حدس کلمات ---------- */
.guess-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.letter-tile {
    width: 60px;
    height: 60px;
    background: var(--gray-light);
    border: 2px solid #d1d5db;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    transition: 0.2s;
}
.letter-tile.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.letter-tile.present {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #1e293b;
}
.letter-tile.absent {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}
.keyboard {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.key {
    background: var(--gray-border);
    border: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.1s;
}
.key:active { transform: scale(0.95); }
.key.correct { background: var(--success); color: white; }
.key.present { background: var(--secondary); color: #1e293b; }
.key.absent { background: #6b7280; color: white; }
@media (max-width: 550px) {
    .letter-tile { width: 45px; height: 45px; font-size: 1.3rem; }
    .key { padding: 8px 12px; font-size: 0.8rem; }
}

/* ---------- استایل برنامه‌ریز مطالعه ---------- */
.plan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    direction: rtl;
}
.plan-table th, .plan-table td {
    border: 1px solid #d1d5db;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.9rem;
}
.plan-table th {
    background: var(--primary);
    color: white;
}
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-family: 'Vazirmatn', sans-serif;
}

/* ---------- استایل سوالات انگلیسی (چپ‌چین) ---------- */
.english-question-text {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    direction: ltr;
    text-align: left;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------- استایل دکمه‌های گزینه تست هالند ---------- */
.option-btn {
    padding: 0.7rem 1.2rem;
    background: var(--gray-light);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
}
.option-btn.selected {
    background: var(--primary);
    color: white;
}