/**
 * استایل ویجت همیار معلم
 * طراحی مینیمال با رنگ‌های سفید، آبی و خاکستری
 */

/* ===== تنظیمات پایه ===== */
.ht-btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    line-height: 1.4;
}

.ht-btn-primary {
    background-color: #1A73E8;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.2);
}

.ht-btn-primary:hover {
    background-color: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.ht-btn-secondary {
    background-color: #F1F3F4;
    color: #202124;
}

.ht-btn-secondary:hover {
    background-color: #E8EAED;
}

.ht-btn-text {
    background: none;
    color: #5F6368;
    text-decoration: underline;
    padding: 8px 12px;
    font-weight: 400;
}

.ht-btn-text:hover {
    color: #202124;
}

/* ===== حالت ۱: نوار هشدار ===== */
.ht-bar {
    position: sticky;
    top: 0;
    z-index: 99999;
    background-color: #E8F0FE;
    border-bottom: 2px solid #1A73E8;
    padding: 8px 20px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ht-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
    flex-wrap: wrap;
}

.ht-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #202124;
    flex-wrap: wrap;
}

.ht-bar-icon {
    font-size: 22px;
    line-height: 1;
}

.ht-bar-title {
    font-weight: 600;
    color: #1A73E8;
    font-size: 15px;
}

.ht-bar-stats {
    color: #5F6368;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 12px;
    border-radius: 12px;
}

.ht-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ht-bar-question {
    font-size: 14px;
    color: #202124;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.ht-bar-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5F6368;
    padding: 0 6px;
    line-height: 1;
}

.ht-bar-close:hover {
    color: #202124;
}

/* ===== حالت ۲: کارت سایدبار ===== */
.ht-sidebar-widget {
    background: #ffffff;
    border-radius: 10px;
    padding: 4px 0;
}

.ht-widget-subtitle {
    color: #5F6368;
    font-size: 13px;
    margin: -6px 0 14px 0;
}

.ht-widget-stats {
    background: #F8F9FA;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #202124;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid #E8EAED;
}

/* ===== کارت سوال ===== */
.ht-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 0;
    border: 1px solid #E8EAED;
    transition: box-shadow 0.25s ease;
}

.ht-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ht-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ht-badge {
    background: #E8F0FE;
    color: #1A73E8;
    font-size: 11px;
    padding: 2px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.ht-score {
    font-size: 13px;
    color: #5F6368;
}

.ht-title {
    font-size: 16px;
    font-weight: 600;
    margin: 6px 0 8px 0;
    line-height: 1.5;
}

.ht-title a {
    color: #202124;
    text-decoration: none;
}

.ht-title a:hover {
    color: #1A73E8;
}

.ht-excerpt {
    color: #5F6368;
    font-size: 14px;
    line-height: 1.7;
    margin: 6px 0 10px 0;
}

.ht-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #80868B;
    margin: 10px 0 14px 0;
    flex-wrap: wrap;
}

.ht-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ht-actions .ht-btn {
    font-size: 13px;
    padding: 6px 14px;
}

.ht-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #F1F3F4;
    text-align: center;
}

.ht-footer small {
    color: #9AA0A6;
    font-size: 11px;
}

/* ===== حالت ۳: جعبه درون‌متن ===== */
.ht-inline-box {
    background: #ffffff;
    border-right: 4px solid #1A73E8;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 28px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ht-inline-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.ht-inline-icon {
    font-size: 32px;
    line-height: 1;
}

.ht-inline-header h4 {
    margin: 0;
    font-size: 17px;
    color: #202124;
    font-weight: 600;
}

.ht-inline-header p {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: #5F6368;
}

.ht-inline-box .ht-card {
    border: none;
    padding: 0;
    box-shadow: none;
}

.ht-inline-box .ht-card:hover {
    box-shadow: none;
}
/* ===== استایل لودینگ ===== */
.ht-loading {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ht-loading .ht-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

.ht-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #E8EAED;
    border-top: 4px solid #1A73E8;
    border-radius: 50%;
    animation: ht-spin 0.8s linear infinite;
}

@keyframes ht-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ht-loading-content {
    text-align: center;
    padding: 30px 20px;
    animation: ht-fade-in 0.3s ease;
}

@keyframes ht-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ht-error {
    text-align: center;
    padding: 20px;
    color: #EA4335;
    background: #FCE8E6;
    border-radius: 8px;
    margin: 10px 0;
}

.ht-error .ht-btn {
    margin-top: 10px;
}
/* ===== حالت ۴: دکمه شناور ===== */
.ht-floating-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ht-floating-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background-color: #1A73E8;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.ht-floating-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 28px rgba(26, 115, 232, 0.5);
}

.ht-floating-icon {
    font-size: 30px;
    line-height: 1;
}

.ht-floating-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EA4335;
    color: #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(234, 67, 53, 0.4);
}

.ht-floating-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
    width: 360px;
    max-width: 92vw;
    margin-bottom: 14px;
    padding: 4px 0 6px 0;
    animation: ht-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
/* ===== آمار مینی‌مال در حالت جعبه درون‌متن ===== */
.ht-inline-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    padding: 6px 0;
    font-size: 13px;
    color: #80868B;
    flex-wrap: wrap;
    border-bottom: 1px solid #F1F3F4;
}

.ht-inline-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

/* ===== واکنش‌گرایی ===== */
@media (max-width: 480px) {
    .ht-inline-stats {
        gap: 12px;
        font-size: 12px;
    }
}
@keyframes ht-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ht-floating-card .ht-card {
    border: none;
    box-shadow: none;
    padding: 12px 16px 16px 16px;
}

/* ===== مودال ===== */
.ht-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ht-fade-in 0.25s ease;
}

@keyframes ht-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ht-modal {
    background: #ffffff;
    border-radius: 14px;
    padding: 30px 34px;
    max-width: 540px;
    width: 94%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: ht-modal-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 92vh;
    overflow-y: auto;
}

@keyframes ht-modal-in {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ht-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ht-modal-title {
    font-size: 21px;
    font-weight: 700;
    color: #202124;
    margin: 0;
}

.ht-modal-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #5F6368;
    padding: 0 6px;
    line-height: 1;
}

.ht-modal-close:hover {
    color: #202124;
}

.ht-modal .ht-form-group {
    margin-bottom: 16px;
}

.ht-modal .ht-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 5px;
}

.ht-modal textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #DADCE0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    background: #FAFBFC;
}

.ht-modal textarea:focus {
    outline: none;
    border-color: #1A73E8;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.ht-modal input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #DADCE0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    background: #FAFBFC;
}

.ht-modal input[type="text"]:focus {
    outline: none;
    border-color: #1A73E8;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.ht-modal-submit {
    background-color: #1A73E8;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
}

.ht-modal-submit:hover {
    background-color: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.35);
}

.ht-modal-success {
    text-align: center;
    padding: 20px 0 10px 0;
    font-size: 18px;
    color: #202124;
}

.ht-no-questions {
    text-align: center;
    padding: 24px 12px;
    color: #5F6368;
    background: #F8F9FA;
    border-radius: 8px;
}

.ht-no-questions p {
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: 500;
}

/* ===== واکنش‌گرایی ===== */
@media (max-width: 768px) {
    .ht-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .ht-bar-left {
        justify-content: center;
    }
    
    .ht-bar-right {
        justify-content: center;
    }
    
    .ht-bar-question {
        max-width: 200px;
    }
    
    .ht-floating-container {
        bottom: 20px;
        right: 20px;
    }
    
    .ht-floating-btn {
        width: 56px;
        height: 56px;
    }
    
    .ht-floating-card {
        width: 320px;
    }
    
    .ht-modal {
        padding: 22px 20px;
    }
    
    .ht-actions {
        flex-direction: column;
    }
    
    .ht-actions .ht-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ht-floating-container {
        bottom: 14px;
        right: 14px;
    }
    
    .ht-floating-btn {
        width: 50px;
        height: 50px;
    }
    
    .ht-floating-icon {
        font-size: 22px;
    }
    
    .ht-floating-card {
        width: 94vw;
        max-width: 340px;
    }
}