/* IRANSans Font */
@font-face {
  font-family: 'IRANSans';
  src: url('fonts/IRANSansWeb.woff2') format('woff2'),
       url('fonts/IRANSansWeb.woff') format('woff'),
       url('fonts/IRANSansWeb.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Apply to all text */
* {
  font-family: 'IRANSans', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#body {
    margin: 0;
    font-family: 'IRANSans', Tahoma, sans-serif;
    background: #f3f6fb;
    color: #333;
    direction: rtl;
}

body {
    font-family: 'IRANSans', Tahoma, sans-serif;
    background: linear-gradient(135deg, #00a89c 0%, #bfe9e6 100%);
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 15px;
}

.form-wrapper, .result-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.main-title {
    margin: 0 0 20px;
    text-align: center;
    font-size: 26px;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #00a89c 0%, #40beb5 100%);
    transition: width 0.3s ease;
}

.question-counter {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.form-title {
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
}

.personal-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.required {
    color: #dc3545;
}

.error-text {
    display: none;
    color: #dc3545;
    font-size: 12px;
    margin-top: 6px;
}

.form-group input.error {
    border-color: #dc3545;
}

/* مراحل */
.form-step { display: none; }
.form-step.active { display: block; }

.step-description {
    color: #666;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 25px;
}

/* دکمه‌ها */
.navigation {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.navigation.single {
    justify-content: flex-end;
}

.btn {
    flex: 1;
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'IRANSans', Tahoma, sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #00a89c;
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* انتخاب حوزه */
.category-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.category-card {
    flex: 1 1 220px;
    background: #00a89c1a;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px;
    text-align: right;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 150px;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102,126,234,0.2);
}

.category-card.selected {
    border-color: #00a89c;
    background: linear-gradient(135deg, #00a89c7a 0%, #bfe9e69c 100%)
}


.category-title {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.category-desc {
    display: block;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

/* بخش سوالات */
.skills-header {
    display: grid;
    grid-template-columns: 1fr repeat(4, 50px);
    gap: 8px;
	align-items: center;
    padding: 10px 0;
	border-radius: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
    text-align: center;
	font-size: 15px;
}

.skills-header .header-text {
    flex: 1;
}

.skills-header .header-options {
    display: flex;
    gap: 8px;
}

.skills-header .header-option {
    width: 45px;
    text-align: center;
    font-size: 12px;
}

.skill-row {
    display: flex;              /* flex به جای grid */
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.skill-row:last-child {
    border-bottom: none;
}

.skill-row:hover {
    background: #fafafa;
}

.skill-text {
    flex: 1;                    /* فضای باقی‌مانده رو می‌گیره */
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    padding-left: 15px;        /* فاصله از دکمه‌ها (RTL: padding-left) */
}

.skill-options {
    display: flex;
    gap: 8px;
    flex-shrink: 0;            /* از فشرده شدن جلوگیری می‌کنه */
}

.square-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 1px solid #dcdfe6;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.square-btn:hover {
    border-color: #7fd3cd;
    background: #7fd3cd;
}

.square-btn.selected {
    background: #00a89c;
    color: #fff;
    border-color: #00a89c;
}

/* ============================================================
   RESPONSIVE - تبلت (768px)
   ============================================================ */
@media (max-width: 768px) {
    /* هدر همچنان flex می‌مونه */
    .skills-header {
        padding: 8px 10px;
    }

    .skills-header .header-option {
        width: 38px;
    }

    .skill-row {
        padding: 10px;
    }

    .square-btn {
        width: 38px;
        height: 38px;
    }
}

/* ============================================================
   RESPONSIVE - موبایل (600px)
   سوال در خط بالا، گزینه‌ها در خط پایین پخش‌شده
   ============================================================ */
@media (max-width: 600px) {

    /* هدر در موبایل مخفی میشه */
    .skills-header {
        display: none;
    }

    /* هر ردیف سوال: ستونی میشه */
    .skill-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 10px;
    }

    /* متن سوال: عرض کامل + فاصله پایین */
    .skill-text {
        width: 100%;
        padding-left: 0;
        margin-bottom: 12px;
        font-size: 14px;
    }

    /* گزینه‌ها: عرض کامل + پخش یکنواخت */
    .skill-options {
        width: 100%;
        justify-content: space-between;
        gap: 0;
    }

    /* دکمه‌ها: عرض درصدی برای پر کردن فضا */
    .square-btn {
        width: 18%;
        height: 40px;
        margin: 0;
        font-size: 13px;
    }
}

/* نمایش سوالات هر دسته */
.category-questions { display: none; }
.category-questions.active { display: block; }

/* نتیجه */
.result-content {
    text-align: center;
}

.result-category {
    margin: 15px 0 25px;
    font-size: 18px;
    color: #555;
}

.score-display {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.score-number {
    font-size: 48px;
    color: #00a89c;
    margin: 10px 0;
}

.result-badge {
    display: inline-block;
    background: #00a89c;
    color: #fff;
    padding: 8px 15px;
    border-radius: 999px;
    margin: 15px 0;
}

.restart-btn {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(40,167,69,0.3);
}

@media (max-width: 768px) {
    .skills-header, .skill-row {
        grid-template-columns: 1fr repeat(4, 40px);
    }
    .square-btn {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 600px) {
    .navigation {
        flex-direction: column;
    }
    .category-card {
        flex: 1 1 100%;
    }
}
