/* Teacher Q&A System Styles - RTL */

.tqa-system {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    text-align: right;
}

/* ===== دکمه‌ها ===== */
.tqa-btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.tqa-btn-primary {
    background: #2271b1;
    color: #fff;
}
.tqa-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.tqa-btn-secondary {
    background: #f0f0f1;
    color: #3c434a;
    border: 1px solid #c3c4c7;
}
.tqa-btn-secondary:hover {
    background: #e0e0e0;
}

.tqa-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}
.tqa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== هدر ===== */
.tqa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}
.tqa-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

/* ===== جستجو ===== */
.tqa-search {
    position: relative;
    margin-bottom: 20px;
}
.tqa-search input[type="text"] {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

#tqa-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dcdcde;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#tqa-search-results .tqa-search-loading,
#tqa-search-results .tqa-search-empty {
    padding: 12px 16px;
    color: #787c82;
    text-align: center;
}
.tqa-search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tqa-search-results-list li {
    border-bottom: 1px solid #f0f0f1;
}
.tqa-search-results-list li:last-child {
    border-bottom: none;
}
.tqa-search-results-list a {
    display: block;
    padding: 8px 16px;
    color: #2271b1;
    text-decoration: none;
    transition: background 0.2s ease;
}
.tqa-search-results-list a:hover {
    background: #f0f6fc;
}

/* ===== فیلترها ===== */
.tqa-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tqa-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    flex-wrap: wrap;
}
.tqa-tabs li {
    margin: 0;
}
.tqa-tabs a {
    display: block;
    padding: 6px 14px;
    color: #3c434a;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}
.tqa-tabs a:hover {
    background: #f0f0f1;
}
.tqa-tabs a.active {
    background: #2271b1;
    color: #fff;
}

#tqa-show-unanswered {
    white-space: nowrap;
}
#tqa-show-unanswered.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ===== لیست سوالات ===== */
.tqa-grid {
    display: grid;
    gap: 16px;
}

.tqa-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    transition: box-shadow 0.2s ease;
}
.tqa-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tqa-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}
.tqa-card h3 a {
    color: #1d2327;
    text-decoration: none;
}
.tqa-card h3 a:hover {
    color: #2271b1;
}

.tqa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    color: #646970;
    margin-bottom: 10px;
}
.tqa-meta .tqa-author {
    font-weight: 500;
    color: #3c434a;
}

.tqa-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    margin-bottom: 10px;
}
.tqa-upvotes {
    color: #2271b1;
}
.tqa-answers.has-answers {
    color: #2e7d32;
}
.tqa-answers.no-answers {
    color: #757575;
}

.tqa-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== بارگذاری بیشتر ===== */
.tqa-load-more {
    text-align: center;
    margin-top: 24px;
}
.tqa-load-more .tqa-btn {
    padding: 10px 32px;
    font-size: 16px;
}

/* ===== مودال ===== */
.tqa-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.tqa-modal-content {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.tqa-modal-close {
    position: absolute;
    top: 12px;
    left: 20px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #757575;
    transition: color 0.2s ease;
}
.tqa-modal-close:hover {
    color: #1d2327;
}
.tqa-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
}

/* ===== فرم‌ها ===== */
.tqa-form-group {
    margin-bottom: 16px;
}
.tqa-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}
.tqa-form-group label .required {
    color: #d63638;
}
.tqa-form-group input[type="text"],
.tqa-form-group input[type="tel"],
.tqa-form-group select,
.tqa-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}
.tqa-form-group textarea {
    resize: vertical;
}
.tqa-form-group small {
    display: block;
    color: #646970;
    font-size: 12px;
    margin-top: 4px;
}

#tqa-form-message {
    margin-top: 12px;
}

/* ===== پیام‌ها ===== */
.tqa-success {
    padding: 10px 16px;
    background: #e8f5e9;
    color: #1b5e20;
    border-radius: 4px;
    border-right: 4px solid #2e7d32;
}
.tqa-error {
    padding: 10px 16px;
    background: #ffebee;
    color: #b71c1c;
    border-radius: 4px;
    border-right: 4px solid #d32f2f;
}

.tqa-loading {
    text-align: center;
    padding: 40px;
    color: #646970;
}
.tqa-no-questions {
    text-align: center;
    padding: 40px;
    color: #646970;
}

/* ===== واکنش‌گرا ===== */
@media (max-width: 768px) {
    .tqa-header {
        flex-direction: column;
        align-items: stretch;
    }
    .tqa-header h2 {
        text-align: center;
    }
    .tqa-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .tqa-tabs {
        justify-content: center;
    }
    #tqa-show-unanswered {
        align-self: center;
    }
    .tqa-modal-content {
        padding: 20px;
    }
}