:root {
    --background-color: #8f9190;
    --font-color: #fff;
    --primary-color: #1DA1F2;
    --primary-border: #1A91DA;
    --secondary-color: rgba(117, 130, 139, 0.582);
}

/* Global page styling */
body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--font-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Vazir', Tahoma, sans-serif;
    direction: rtl;
}

/* Unified button styling (بخش‌های اصلی پروژه) */
.btn {
    font-size: 18px;
    line-height: 1.8;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--font-color);
    border: 1px solid var(--primary-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    font-family: inherit;
    text-align: center;
    margin: 20px auto 0;
}

.btn:hover {
    background-color: rgba(136, 153, 166, 0.5);
}

/* Welcome screen container */
#instructions-container {
    max-width: 600px;
    text-align: center;
    margin-bottom: 20px;
}

#instructions-container p {
    font-size: 24px;
    margin: 10px 0;
    line-height: 2;
}

.logo {
    max-width: 100px;
    display: block;
    margin: 0 auto 20px;
}

/* Main content container */
#main-content {
    display: none;
    max-width: 600px;
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

/* Demographics container styling */
#demographics-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 80px;
    border-radius: 8px;
    background-color: var(--secondary-color);
    border: 1px solid rgba(136, 153, 166, 0.4);
    text-align: center;
}

#demographics-container h2 {
    margin-bottom: 20px;
    font-size: 32px;
}

#demographics-container .privacy-note {
    font-size: 16px;
    margin-bottom: 15px;
}

#demographics-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#demographics-form label {
    font-size: 18px;
    margin-bottom: 4px;
    width: 100%;
    text-align: right;
}

#demographics-form input,
#demographics-form select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #fff;
    color: #000;
    transition: border-color 0.2s ease;
    text-align: right;
    direction: rtl;
    font-family: 'Vazir', Tahoma, sans-serif;
}

#demographics-form input:focus,
#demographics-form select:focus {
    border-color: #8899a6;
}

/* Group Intro container styling */
#group-intro-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 60px;
    background-color: var(--secondary-color);
    border: 1px solid rgba(136, 153, 166, 0.4);
    border-radius: 8px;
    text-align: center;
}

#sample-tweet-container {
    width: 100%;
    max-width: 560px;
    margin: 20px auto;
}

.icon-tooltip {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-tooltip .tooltip {
    margin-top: 5px;
    text-align: center;
}

#group-start-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    /* کل ارتفاع صفحه برای مرکزچین عمودی */
    background-color: var(--background-color);
    /* می‌توانید رنگ پس‌زمینه دلخواه تنظیم کنید */
}

.group-start-box {
    background-color: var(--secondary-color);
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.group-start-title {
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--font-color);
}

.group-start-text {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--font-color);
}

/* اگر لازم است دکمه نیز تغییر یابد */
#group-start-next-btn {
    padding: 12px 24px;
    font-size: 18px;
    background-color: var(--primary-color);
    color: var(--font-color);
    border: 1px solid var(--primary-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin: 0 auto;
}

#group-start-next-btn:hover {
    background-color: rgba(136, 153, 166, 0.5);
}

/* Tweet box styling */
.tweet {
    background-color: #1e2732;
    border: 1px solid #38444d;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.tweet-header.blur-effect {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 10px;
    filter: blur(5px);
    transition: filter 0.5s ease-in-out;
}

.tweet-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.tweet-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.tweet-info h3 {
    margin: 0;
    font-size: 16px;
}

.tweet-info p {
    margin: 0;
    color: #8899a6;
    font-size: 14px;
    text-align: left;
    direction: ltr;
}

.tweet-content {
    margin: 15px 0;
    font-size: 24px;
    line-height: 1.6;
}

.tweet-content.rtl {
    text-align: right;
    direction: rtl;
}

.tweet-content.ltr {
    text-align: left;
    direction: ltr;
}

.tweet-translation {
    background-color: #2e3740;
    padding: 10px;
    border-radius: 8px;
    font-size: 18px;
    margin-top: 10px;
    text-align: left;
    direction: ltr;
}

.tweet-translation p.translation-content {
    text-align: right;
    direction: rtl;
    margin-top: 5px;
}

.tweet-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #8899a6;
    font-size: 14px;
    margin-top: 10px;
}

.tweet-actions button {
    background: none;
    border: none;
    color: #8899a6;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
}

.tweet-footer {
    font-size: 14px;
    color: #8899a6;
    margin-top: 10px;
    text-align: left;
    direction: ltr;
}

.more-options {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}

.small-tweet {
    transform: scale(0.8);
    transition: transform 0.5s ease-in-out;
}

.reply-container {
    background-color: #1e2732;
    border: 1px solid #38444d;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
    /* راست چین شدن متن */
    direction: rtl;
}

.reply-text {
    flex: 1;
    width: 100%;
    min-height: 40px;
    /* ارتفاع مناسب برای ورود متن */
    background-color: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 18px;
    font-family: 'Vazir', Tahoma, sans-serif;
    resize: vertical;
    text-align: right;
    direction: rtl;
}

.reply-text::placeholder {
    color: #8899a6;
}

.reply-btn {
    padding: 10px 20px;
    align-self: left;
    font-size: 18px;
    background-color: #1e2732;
    color: #fff;
    border: 1px solid #38444d;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.reply-btn:hover {
    background-color: #38444d;
}

/* Questions container */
#question-container {
    font-size: 20px;
    text-align: right;
}

.radio-group {
    display: flex;
    gap: 12px;
    font-size: 12px;
    align-items: center;
    justify-content: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
}

/* Next button container */
.next-button-container {
    display: none;
    width: 100%;
    margin-top: 10px;
    justify-content: center;
}

.next-button {
    background-color: var(--primary-color);
    color: var(--font-color);
    border: 1px solid var(--primary-border);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 18px;
    cursor: not-allowed;
    opacity: 0.5;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.next-button.active {
    cursor: pointer;
    opacity: 1;
    background-color: rgba(136, 153, 166, 0.6);
}

/* Confirm button */
.confirm-button {
    background-color: var(--primary-color);
    color: var(--font-color);
    border: 1px solid var(--primary-border);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    cursor: not-allowed;
    opacity: 0.5;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    margin: 20px auto 0;
}

.confirm-button.active {
    cursor: pointer;
    opacity: 1;
    background-color: rgba(136, 153, 166, 0.6);
}

/* Final page container */
#final-page {
    display: none;
    max-width: 600px;
    text-align: center;
}

#final-page p {
    font-size: 24px;
    margin: 20px 0;
}

/* Final form styling */
#final-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
}

.final-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 22px;
    background-color: #fff;
    color: #000;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: right;
    direction: rtl;
}

.final-input:focus {
    border-color: #888;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.final-button {
    width: 100%;
    padding: 15px 20px;
    font-size: 22px;
    background-color: #fff;
    color: #000;
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    text-align: center;
}

.final-button:hover {
    background-color: #f5f5f5;
}

/* Notification area */
#notification-container {
    margin-bottom: 10px;
}

/* Extra Survey Styles */
.survey-transition {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(136, 153, 166, 0.4);
    text-align: center;
    max-width: 500px;
    margin: 20px auto;
}

.survey-transition h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.survey-transition p {
    font-size: 20px;
    margin-bottom: 20px;
}

.survey-progress-container {
    width: 100%;
    background-color: #444;
    border-radius: 5px;
    margin-bottom: 20px;
    height: 12px;
    overflow: hidden;
}

.survey-progress-bar {
    height: 100%;
    background-color: #00aaff;
    width: 0%;
    transition: width 0.3s ease;
}

.survey-question-box {
    background-color: #1e2732;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 22px;
    color: #f5f5f5;
    text-align: right;
    height: 200px;
    width: 700px;
    justify-content: space-between;
}

/* متن سؤال نظرسنجی */
.survey-question-text {
    margin-bottom: 15px;
    font-weight: bold;
}

/* گروه گزینه‌های رادیویی نظرسنجی با اعداد کنار گزینه‌ها */
.radio-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.radio-group label {
    font-size: 14px;
    text-align: center;
    flex: 1;
    cursor: pointer;
}

/* برچسب‌های زیر گزینه‌های رادیویی */
.radio-labels {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    margin-top: 5px;
    color: #f5f5f5;
}

/* دکمه "بعدی" ثابت و مرکزچین */
.survey-next-container {
    text-align: center;
    margin-top: 20px;
    background: #1e2732;
    border: none;
}

#next-extra-question {
    padding: 15px 30px;
    font-size: 22px;
    background-color: rgba(136, 153, 166, 0.5);
    ;
    color: #f5f5f5;
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin: 0 auto;
    box-shadow: none;
}

/* ==== Matrix Question (سوال ۱۵) ==== */
/* محدود کردن عرض کادر و وسط‌چین کردنش */
.survey-question-box {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
}

.matrix-table th,
.matrix-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
}

.survey-question-box.question14~.survey-next-container #next-extra-question {
    display: none;
}

/* مقیاس عددی زیر جدول (خیلی کم ... خیلی زیاد) */
.matrix-scale {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #f5f5f5;
}

/* ۲. کل جدول را با یک کادر رنگی دور می‌گیرد */
.survey-question-box.question15 .matrix-table {
    margin: 0 auto;
    border: 2px solid var(--primary-border);
    border-collapse: separate;
    /* برای اینکه حاشیه‌ی بیرونی نمایش داده شود */
}

/* ۳. سلول‌ها هم کمی فاصله داشته باشند تا کادر بیرونی نمایان‌تر باشد */
.survey-question-box.question15 .matrix-table th,
.survey-question-box.question15 .matrix-table td {
    border: 1px solid #444 var(--primary-border);
}

/* در سوال ۱۵ دومین ردیف هدر (labels) را ریزتر کن */
.survey-question-box.question15 .matrix-table thead tr:nth-child(2) th {
    font-size: 10px;
    padding: 6px;
}

.survey-question-box.question15 {
    /* غیرفعال کردن ارتفاع و عرض ثابت */
    width: auto !important;
    height: auto !important;

    /* حداکثر عرض دلخواه و وسط‌چین شدن */
    max-width: 800px;
    margin: 30px auto;

    /* فاصله داخلی تا جدول */
    padding: 20px;

    /* رنگ پس‌زمینه و کادر */
    background-color: #1e2732;
    border: 2px solid #444;
    border-radius: 10px;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    html {
        font-size: 18px;
    }

    #main-content {
        padding: 10px;
    }
}

@font-face {
    font-family: 'Vazir';
    src: url('./Vazir.woff2') format('woff2'),
        url('./Vazir.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}