/* 
==================================================
CSS CHO MODAL NHIỆM VỤ HUB WEB - WPQIB
==================================================
*/

/* Container chính của Modal */
.wpqib-hub-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none; /* Sẽ được hiện bởi JS */
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Lớp nền mờ */
.wpqib-hub-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
}

/* Khung nội dung trắng */
.wpqib-hub-content {
    position: relative;
    background: #fff;
    width: 92%;
    max-width: 550px;
    max-height: 92vh;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
    animation: wpqib-modal-fadein 0.3s ease-out;
}

@keyframes wpqib-modal-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Nút đóng */
.wpqib-hub-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}
.wpqib-hub-close:hover {
    color: #333;
}

/* Body bên trong modal */
.wpqib-hub-body {
    padding: 25px;
}

.wpqib-hub-header-text {
    font-size: 16px;
    line-height: 1.5;
    color: #d63031;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    display: block;
}

/* KHU VỰC NHẬP MÃ (ĐƯA LÊN ĐẦU) */
.wpqib-hub-verify-box {
    background: #f1f2f6;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #dfe6e9;
}

.wpqib-hub-verify-box input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.wpqib-hub-verify-box input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
}

.wpqib-hub-btn-primary {
    width: 100%;
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.wpqib-hub-btn-primary:hover {
    background-color: #0056b3;
}

.wpqib-hub-error-msg {
    color: #d63031;
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
}

/* CÁC BƯỚC HƯỚNG DẪN */
.wpqib-hub-steps {
    font-size: 15px;
    line-height: 1.6;
    color: #2d3436;
}

.wpqib-hub-steps p {
    margin: 12px 0;
}

.wpqib-hub-keyword-wrap {
    display: flex;
    margin-top: 8px;
    gap: 5px;
}

.wpqib-hub-keyword-wrap input {
    flex: 1;
    padding: 10px;
    background: #fff8f8;
    border: 1px dashed #d63031;
    color: #d63031;
    font-weight: 700;
    border-radius: 4px;
    font-size: 16px;
}

.wpqib-hub-btn-copy {
    background: #2d3436;
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.wpqib-hub-btn-copy:hover {
    background: #000;
}

/* Ảnh hướng dẫn */
.wpqib-hub-steps img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px auto;
    border: 2px solid #eee;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wpqib-hub-note-blue {
    color: #0984e3;
    font-weight: 600;
    font-style: italic;
    font-size: 14px;
}

/* Footer & Nút đổi nhiệm vụ */
.wpqib-hub-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.wpqib-hub-btn-secondary {
    background: none;
    border: 1px solid #b2bec3;
    color: #636e72;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.wpqib-hub-btn-secondary:hover {
    background: #f1f2f6;
    color: #2d3436;
    border-color: #2d3436;
}

/* Trạng thái Loading */
.wpqib-hub-loading {
    text-align: center;
    padding: 40px 0;
    color: #636e72;
    font-weight: 600;
}

.wpqib-hub-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: wpqib-spin 1s linear infinite;
}

@keyframes wpqib-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ngăn cuộn trang khi mở modal */
body.wpqib-modal-open {
    overflow: hidden;
}

/* Responsive cho Mobile */
@media screen and (max-width: 480px) {
    .wpqib-hub-content {
        padding: 0;
    }
    .wpqib-hub-body {
        padding: 20px 15px;
    }
    .wpqib-hub-header-text {
        font-size: 15px;
    }
    .wpqib-hub-verify-box {
        padding: 15px;
    }
}