/* -- CÁC LỚP TIỆN ÍCH VÀ HIỆU ỨNG -- */
/* Các lớp này giữ nguyên vì vẫn cần thiết */
.htg-custom-notification { 
    position: fixed; 
    top: 20px; 
    right: 10%; 
    background-color: #4caf50; 
    color: white; 
    padding: 10px 20px; 
    border-radius: 5px; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); 
    font-size: 14px; 
    z-index: 10000001; 
    display: none; 
}

.htg-loading-spinner { 
    /* margin: 100px auto; -- Bỏ dòng này */
    width: 50px; 
    height: 50px; 
    border: 5px solid #f3f3f3; 
    border-top: 5px solid #3498db; 
    border-radius: 50%; 
    animation: htg-spin 1s linear infinite; 
}

/* ========== CODE THÊM MỚI BẮT ĐẦU ========== */

/* -- Container cho trạng thái Loading -- */
.htg-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.htg-loading-text {
    margin-top: 15px;
    font-size: 16px;
    color: #555;
    font-style: italic;
}

/* ========== CODE THÊM MỚI KẾT THÚC ========== */

@keyframes htg-spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.htg-d-block { display: block; }
.htg-font-weight-bold { font-weight: bold; }
.htg-text-center { text-align: center; }
.htg-view-counter { text-align: center; margin-bottom: 10px; color: #555; font-style: italic; }

/* -- BỐ CỤC KHỐI HƯỚNG DẪN -- */
.htg-guide-content {
    background-color: #fff;
    border: 2px solid #4caf50; /* Thêm viền để nổi bật */
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto; /* Căn giữa và tạo khoảng cách */
    max-width: 700px; /* Giới hạn chiều rộng */
    text-align: center;
    font-size: 16px;
    font-family: "Roboto", Arial, sans-serif;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.htg-inner-content {
    width: 100%;
    margin: auto;
    text-align: left;
}

/* -- NỘI DUNG KHỐI HƯỚNG DẪN -- */
.htg-mobile-hint { 
    background-color: #ffc107; 
    color: #333; 
    font-weight: bold; 
    padding: 10px; 
    margin: -20px -20px 20px -20px; 
    border-radius: 7px 7px 0 0; 
}

.htg-txt-highlight { 
    color: rgb(196, 0, 0); 
    font-size: 15px; 
    text-align: center; 
    display: block; 
    font-weight: 600; 
    margin-bottom: 15px; 
}

.htg-step-container { margin-bottom: 10px; }
.htg-txt-step { font-weight: 600; }
.htg-step-container a { color: #007fff; text-decoration: none; }
.htg-txt-danger, #htg-keyword-text { color: rgb(196, 0, 0); font-weight: 600; }

#htg-copy-keyword { 
    font-size: 12px; 
    color: #888; 
    cursor: pointer; 
    border: 1px solid #888; 
    padding: 2px 10px; 
    border-radius: 7px; 
    display: inline-block; 
    vertical-align: text-bottom; 
}
#htg-copy-keyword:hover { 
    color: #4d4d4d; 
    transition: .5s; 
    background-color: #f7f7f7; 
    border-color: #515151; 
}

/* -- HÌNH ẢNH MINH HỌA -- */
.htg-image-demo-search { 
    text-align: center; 
    position: relative; 
}
.htg-image-demo-search img, .htg-box-img-result img { 
    width: 100%; 
    display: block; 
    margin: 0 auto;
}
.htg-keyword-overlay { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 220px; 
    text-align: left; 
    padding-left: 10px; 
    top: 170px; 
    font-size: 15px; 
}
.htg-box-img-result .htg-image-wrapper { 
    display: inline-block; 
    border: 2px solid red; 
    margin-top: 5px; 
    margin-bottom: 10px; 
}
.htg-image-view-more { 
    text-align: center; 
    margin: 10px 0px; 
}
.htg-note-find-txt { 
    color: #007fff; 
    text-align: center; 
    margin: 0 0 10px; 
}

/* -- GỢI Ý MÃ -- */
.htg-danger-mask-txt { 
    margin-top: 5px; 
    display: block; 
    text-align: center; 
}
.htg-box-danger-mask { 
    background-color: red; 
    border-radius: 7px; 
    display: inline-block; 
    width: 35px; 
    height: 18px; 
    vertical-align: sub; 
    margin-left: -2px; 
}

/* -- VIDEO HƯỚNG DẪN -- */
.htg-iframe-tutorials { 
    width: 100%; 
    max-width: 620px; 
    height: 350px; 
    margin-top: 10px; 
}

/* -- RESPONSIVE -- */
@media screen and (max-width: 700px) {
    .htg-guide-content { 
        width: 95%; 
        padding: 10px; 
        margin: 10px auto; 
    }
    .htg-keyword-overlay { 
        width: 60%; 
        top: 26%; 
        left: 49%; 
    }
    .htg-iframe-tutorials { 
        width: 100%; 
        height: calc(90vw / 16 * 9); 
    }
}

/* Thêm vào cuối file htg-style.css */
.htg-error-message {
    color: red;
    text-align: center;
    font-weight: bold;
    background-color: #ffebee;
    border: 1px solid red;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* ========== CODE THÊM MỚI BẮT ĐẦU ========== */

/* -- FORM NHẬP MÃ MỞ KHÓA -- */
.htg-unlock-form {
    border: 2px dashed #3498db;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #f0f8ff;
}

.htg-form-title {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.htg-input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#htg-task-key-input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 250px;
    text-align: center;
}

#htg-verify-key-btn {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #2ecc71;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#htg-verify-key-btn:hover {
    background-color: #27ae60;
}

#htg-verify-key-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.htg-form-message {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    height: 20px;
}

.htg-form-message.error {
    color: red;
}

/* -- MÀN HÌNH THÀNH CÔNG -- */
.htg-success-view {
    padding: 30px;
    text-align: center;
    background-color: #e8f5e9;
    border-radius: 8px;
}

.htg-success-view h3 {
    color: #27ae60;
    font-size: 28px;
    margin-top: 0;
}

.htg-success-view p {
    font-size: 18px;
    color: #333;
}

.htg-unlock-key-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background-color: #fff;
    border: 2px dashed #27ae60;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

#htg-final-unlock-key {
    font-size: 32px;
    font-weight: bold;
    color: #c0392b;
    letter-spacing: 2px;
}

#htg-copy-unlock-key {
    padding: 8px 15px;
    font-size: 14px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.htg-success-note {
    font-style: italic;
    color: #7f8c8d;
}

/* ========== CODE THÊM MỚI KẾT THÚC ========== */

/* ========== CODE THÊM MỚI BẮT ĐẦU ========== */

/* -- KHỐI ĐỔI NHIỆM VỤ VÀ VIDEO -- */
.htg-change-task-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.htg-change-task-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

#htg-change-task-btn {
    display: inline-block;
    padding: 8px 25px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#htg-change-task-btn:hover {
    background-color: #f7f7f7;
    border-color: #999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.htg-iframe-tutorials {
    width: 100%;
    max-width: 600px; /* Giới hạn chiều rộng video */
    aspect-ratio: 16 / 9; /* Giữ tỷ lệ khung hình 16:9 */
    border: none;
    border-radius: 8px;
}

/* ========== CODE THÊM MỚI KẾT THÚC ========== */