/* =============================================================== */
/* === PDF TASK EMBEDDER - FINAL RESPONSIVE LAYOUT (v2.0) === */
/* =============================================================== */

/* --- Styles mặc định cho DESKTOP (màn hình > 768px) --- */
.pte-embed-container {
    border: 1px solid #ddd;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0;
    overflow: hidden; /* Rất quan trọng để bo góc hoạt động */
}

.pte-pdf-wrapper {
    width: 100%; /* Vừa khít container cha */
    height: 600px;
    position: relative;
    border: none;
    margin-bottom: 0;
}

.pte-download-wrapper {
    text-align: center;
    padding: 15px; /* Thêm padding để nút không bị dính lề */
}

/* --- Áp dụng Kỹ thuật "Full Bleed" CHỈ DÀNH CHO MOBILE (màn hình <= 768px) --- */
@media (max-width: 768px) {
    .pte-embed-container {
        /* Ghi đè các style trên để tràn lề */
        width: 150vw;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0; /* Bỏ bo góc trên mobile cho đẹp */
        border-left: none; /* Bỏ viền trái/phải */
        border-right: none;
    }
    
    .pte-disclaimer-block {
         /* Ghi đè các style trên để tràn lề */
        width: 100vw;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0; /* Bỏ bo góc trên mobile cho đẹp */
        border-left: none; /* Bỏ viền trái/phải */
        border-right: none;
}
}

.pte-pdf-viewer {
    width: 65%;
    height: 100%;
    border: none;
}

.pte-security-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background-color: transparent;
}

.pte-note,
.pte-download-instruction {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

/* --- Modal Styles --- */
body.pte-body-no-scroll {
    overflow: hidden;
}

.pte-modal-container {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.pte-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 660px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}

.pte-modal-body {
    padding-right: 15px;
}

.pte-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.pte-modal-close:hover,
.pte-modal-close:focus {
    color: black;
    text-decoration: none;
}

/* --- Modal Content Styles --- */
.pte-txt-highlight {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--pte-danger-color); /* Theme Color */
    margin-bottom: 20px;
}

.pte-form-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: stretch;
}

.pte-keypass-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.pte-btn-submit {
    padding: 10px 15px;
    background-color: var(--pte-success-color); /* Theme Color */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: bold;
    transition: background-color 0.2s;
}
.pte-btn-submit:hover { background-color: #4cae4c; } /* Giữ màu hover cố định */
.pte-btn-submit:disabled { background-color: #999; cursor: not-allowed; }

.pte-step-container, .pte-box-img-result {
    margin-top: 15px;
    line-height: 1.6;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.pte-txt-step {
    color: var(--pte-primary-color); /* Theme Color */
    font-weight: bold;
}

.pte-txt-danger,
.pte-keyword-text,
.pte-keypass-warning {
    color: var(--pte-danger-color); /* Theme Color */
    font-weight: bold;
}

.pte-keypass-warning {
    margin-bottom: 15px;
    text-align: center;
    display: none;
}

.pte-box-img-result .pte-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    margin: 10px auto;
    display: block;
}

.pte-note-find-txt {
    font-style: italic;
    color: #555;
    text-align: center;
}

/* --- Copy Button & Task Images --- */
.pte-copy-keyword-btn {
    display: inline-block;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.pte-copy-keyword-btn:hover { background-color: #e0e0e0; }

.pte-image-demo-search {
    position: relative;
    margin: 15px 0;
    text-align: center;
}

.pte-image-demo-search img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

.pte-keyword-overlay {
    position: absolute;
    top: 75%;
    left: 45%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2px 10px;
    color: black;
    font-size: 14px;
    width: 250px;
}

.pte-modal-content .pte-box-danger-mask {
    background-color: var(--pte-danger-color); /* Theme Color */
    border-radius: 7px;
    display: inline-block;
    width: 35px;
    height: 18px;
    vertical-align: sub;
    margin-left: -2px;
}

.pte-masked-code-display {
    text-align: center;
    font-size: 16px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.pte-change-task-container { text-align: center; margin-top: 20px; }
#pte-change-task-btn {
    background-color: #fff;
    padding: 5px 15px;
    border: 1px solid #888;
    text-align: center;
    font-size: 15px;
    border-radius: 7px;
    cursor: pointer;
}

.pte-change-task-guidance {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 10px;
    padding: 0 15px;
}

.pte-iframe-tutorials {
    width: 100%;
    height: 315px;
    margin-top: 20px;
}

/* --- CTA Button & Social Proof --- */
.pte-download-trigger {
    background-color: var(--pte-primary-color); /* Theme Color */
    box-shadow: 0 4px 15px var(--pte-primary-shadow); /* Theme Color */
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: pte-pulse 2s infinite;
}

.pte-download-trigger:hover {
    background-color: var(--pte-primary-hover); /* Theme Color */
    box-shadow: 0 6px 20px var(--pte-primary-shadow-hover); /* Theme Color */
    transform: translateY(-3px);
}

.pte-download-trigger:disabled {
    background-color: #999;
    cursor: not-allowed;
    animation: none;
    box-shadow: none;
}

.pte-download-trigger svg {
    width: 20px;
    height: 20px;
}

@keyframes pte-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pte-social-proof {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pte-star-rating {
    font-size: 18px;
    color: #FFD700;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.pte-download-counter {
    font-size: 14px;
    color: #333;
    background-color: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    margin-top: 0;
}

.pte-download-counter .pte-count-number {
    font-weight: bold;
    color: var(--pte-primary-color); /* Theme Color */
}


/* --- Responsive Styles for Mobile --- */
@media screen and (max-width: 500px) {
    .pte-form-input {
        flex-direction: column;
        gap: 12px;
    }
    .pte-keypass-input,
    .pte-btn-submit {
        width: 100%;
    }
}

/* --- Admin Styles --- */
.pte-reset-button {
    background-color: #fbeaea !important;
    border-color: #d9534f !important;
    color: #d9534f !important;
    text-shadow: none !important;
}
.pte-reset-button:hover {
    background-color: #d9534f !important;
    color: #fff !important;
}

/* --- Disclaimer Block --- */
.pte-disclaimer-block {
    margin: 20px 0;
    padding: 15px;
    background-color: #fffbe6; /* Màu nền vàng nhạt */
    border-left: 4px solid #ffc107; /* Viền trái màu vàng đậm */
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 12px; /* Khoảng cách giữa icon và nội dung */
}

.pte-disclaimer-block svg {
    flex-shrink: 0; /* Không co icon lại */
    width: 20px;
    height: 20px;
    color: #ffc107; /* Màu icon trùng màu viền */
    margin-top: 3px;
}

.pte-disclaimer-block p {
    margin: 0 0 5px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    text-align: justify;
}

.pte-disclaimer-block p:last-child {
    margin-bottom: 0;
}

.pte-disclaimer-block p strong {
    color: #333;
}