/* --- PHẦN 4: GIAO DIỆN MODAL NHIỆM VỤ (PHIÊN BẢN V2) --- */

/* <<< NÂNG CẤP: Loader với văn bản */
.nrc-task-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.85); 
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Khoảng cách giữa spinner và text */
}

.nrc-task-loader-spinner {
    width: 40px; height: 40px;
    border: 5px solid #f3f3f3; 
    border-top-color: var(--primary-color, #5a3a9a);
    border-radius: 50%; 
    animation: nrc-spin 1s linear infinite;
}

.nrc-task-loader-text {
    font-size: 1.1em;
    color: var(--primary-color, #5a3a9a);
    font-weight: 500;
    margin: 0;
    padding: 0;
    animation: nrc-fade-in 0.5s ease-in-out;
}

@keyframes nrc-spin { to { transform: rotate(360deg); } }
@keyframes nrc-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Lớp phủ modal */
.nrc-task-modal {
    display: none; position: fixed; z-index: 999998;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0, 0, 0, 0.6);
    font-family: "Roboto", Arial, sans-serif;
}

/* Khung nội dung chính */
.nrc-task-modal-content-v2 {
    background-color: #fff; margin: 20px auto;
    padding: 20px; border: 1px solid #888;
    width: 660px; text-align: center;
    font-size: 16px; border-radius: 7px;
    position: relative;
    animation: nrc-modal-appear 0.4s ease-out;
}
@keyframes nrc-modal-appear { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }

.nrc-modal-inner-content {
    width: 620px; margin: auto; text-align: left;
}

.nrc-task-modal-close {
    color: #aaa; float: right; font-size: 28px;
    font-weight: bold; cursor: pointer;
}
.nrc-task-modal-close:hover { color: black; }

/* Các thành phần nội dung */
.nrc-task-highlight {
    color: rgb(196, 0, 0); font-size: 15px;
    text-align: center; display: block;
    font-weight: 600;
}

.nrc-task-form-input {
    display: flex; margin: 8px auto;
    justify-content: space-evenly; align-items: center;
}
.nrc-input-ays {
    display: block; width: 250px;
    padding: 0.375rem 0.75rem; font-size: 1rem;
    border: 1px solid #ced4da; border-radius: 0.25rem;
    margin-right: 10px;
}
.nrc-input-ays:focus {
    border-color: #80bdff; outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.nrc-btn-ays-custom {
    background-color: #5d6cf9; color: #ffffff;
    font-size: 18px; padding: 6px 36px;
    border-radius: 8px; width: 250px;
    cursor: pointer; text-align: center;
}
.nrc-btn-ays-custom:disabled { background-color: #ccc; cursor: not-allowed; }

.nrc-task-step-container { margin-top: 10px; }
.nrc-task-step-label { font-weight: 600; }
.nrc-task-danger { color: rgb(196, 0, 0); font-weight: 600; }
.nrc-copy-keyword {
    font-size: 12px; color: #888; cursor: pointer;
    border: 1px solid #888; padding: 2px 10px;
    border-radius: 7px; display: inline-block; margin-left: 5px;
}
.nrc-copy-keyword:hover {
    color: #4d4d4d; background-color: #f7f7f7; border-color: #515151;
}

.nrc-task-image-demo-search {
    text-align: center; position: relative;
    margin-top: 10px;
}
.nrc-task-keyword-overlay {
    position: absolute; left: 156px; top: 99px; font-size: 15px;
}

.nrc-task-box-img-result { margin-top: 10px; }
.nrc-task-image-target {
    display: inline-block; border: 2px solid red;
    margin-top: 5px; margin-bottom: 10px;
}
.nrc-task-image-target img { max-width: 100%; display: block; }
.nrc-task-note-find {
    color: #007fff; text-align: center;
    margin: 0 0 10px;
}
.nrc-task-image-view-more {
    text-align: center; margin: 10px 0;
}

.nrc-task-final-instruction { display: block; text-align: center; }
.nrc-task-danger-mask-txt {
    margin-top: 5px; display: block; text-align: center;
}
.nrc-font-weight-bold { font-weight: bold; }
.nrc-task-box-danger-mask {
    background-color: red; border-radius: 7px;
    display: inline-block; width: 35px;
    height: 18px; vertical-align: sub;
    margin-left: -2px;
}
.nrc-task-change-task-container {
    text-align: center; margin-top: 10px;
}
.nrc-task-change-task-container span {
    font-size: 12px; color: #000000; cursor: pointer;
    border: 1px solid #000000; padding: 5px 23px;
    border-radius: 7px; opacity: .7;
}
.nrc-task-change-task-container span:hover {
    color: #4d4d4d; background-color: #f7f7f7; border-color: #515151;
    opacity: 1;
}

.nrc-task-iframe-tutorials {
    width: 620px; height: 350px; margin-top: 10px;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .nrc-task-modal-content-v2 {
        width: 95%; padding: 10px;
        height: 90vh; overflow: auto;
        margin: 4vh auto;
    }
    .nrc-modal-inner-content { width: 100%; }
    .nrc-task-keyword-overlay { left: 43px; top: 85px; font-size: 14px; }
    .nrc-task-form-input { justify-content: space-evenly; }
    .nrc-input-ays { margin-right: 0; max-width: 45%; }
    .nrc-btn-ays-custom { margin-left: 10px; padding: 7px 0; width: auto; flex-grow: 1; }
    .nrc-task-iframe-tutorials {
        width: 100%; height: calc(100vw / 16 * 9);
    }
}

/* --- BỔ SUNG: CSS CHO MODAL THUYẾT PHỤC HƠN --- */

.nrc-modal-title-persuasive {
    font-size: 22px;
    color: var(--primary-color, #5a3a9a);
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.nrc-value-proposition {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color, #5a3a9a);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.nrc-value-proposition p {
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.nrc-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nrc-features-list li {
    margin-bottom: 8px;
    font-size: 15px;
    color: #555;
}

.nrc-features-list li:last-child {
    margin-bottom: 0;
}

.nrc-features-list li strong {
    color: #000;
}

.nrc-task-instruction-intro {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-bottom: 15px;
}
/* --- KẾT THÚC BỔ SUNG --- */

/* --- BỔ SUNG V3: CSS CHO GHI CHÚ KINH PHÍ VÀ HƯỚỚNG DẪN ĐỔI NHIỆM VỤ --- */

.nrc-maintenance-funding-note {
    font-size: 14px;
    text-align: center;
    padding: 10px;
    background-color: #fffbe6; /* Màu vàng nhạt */
    border: 1px solid #ffe58f; /* Viền vàng */
    color: #8a6d3b; /* Chữ màu nâu */
    border-radius: 5px;
    margin-bottom: 20px; /* Khoảng cách với tiêu đề chính */
    line-height: 1.6;
}

.nrc-change-task-guidance {
    font-size: 13px;
    text-align: center;
    color: #777;
    margin-top: 10px; /* Khoảng cách với nút "Đổi nhiệm vụ" */
    padding: 0 15px; /* Thêm chút padding ngang để không bị sát lề */
    line-height: 1.5;
}

.nrc-change-task-guidance strong {
    color: #555;
}
/* --- KẾT THÚC BỔ SUNG V3 --- */

/* --- BỔ SUNG: CSS CHO SOCIAL PROOF TRONG MODAL --- */

.nrc-modal-social-proof {
    margin-bottom: 20px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden; /* Quan trọng cho hiệu ứng */
    min-height: 50px; /* Đảm bảo có không gian cho thông báo động */
}

.nrc-sp-total {
    font-size: 15px;
    color: #495057;
    transition: opacity 0.5s ease-in-out;
}

.nrc-sp-total strong {
    color: var(--primary-color, #5a3a9a);
    font-weight: 700;
}

.nrc-sp-recent {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideInUp 0.5s ease-out forwards;
}

@keyframes slideInUp {
    from {
        transform: translateY(120%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nrc-sp-inner {
    font-size: 14px;
    color: #555;
}

.nrc-sp-inner strong {
    color: #333;
    font-weight: 600;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .nrc-modal-social-proof {
        padding: 10px;
        min-height: 45px;
    }
    .nrc-sp-total {
        font-size: 14px;
    }
    .nrc-sp-recent {
        width: calc(100% - 16px);
        left: 8px;
        bottom: 8px;
    }
    .nrc-sp-inner {
        font-size: 13px;
    }
}