/* Reset input styles để tránh conflict */
.chp-container input[type="text"],
.chp-container input[type="password"],
.chp-container input[type="email"],
.chp-container textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    cursor: text !important;
}

/* Container chính */
.chp-container {
    margin: 20px 0;
    position: relative;
}

/* Box khi nội dung bị khóa */
.chp-locked-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: visible; /* Changed from hidden to visible */
}

.chp-locked-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none !important; /* Allow clicking through this element */
    z-index: 0 !important;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header chứa icon và text */
.chp-lock-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* Icon khóa */
.chp-lock-icon {
    font-size: 24px;
    margin-right: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    display: inline-block;
}

/* Message */
.chp-lock-message {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
}

/* Nút mở khóa chung */
.chp-unlock-btn {
    background: #ffffff;
    color: #764ba2;
    border: none;
    padding: 10px 25px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.chp-unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    background: #f0f0f0;
}

.chp-unlock-btn:active {
    transform: translateY(0);
}

.chp-unlock-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form password */
.chp-password-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.chp-password-input {
    background: rgba(255,255,255,0.95) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    border-radius: 25px !important;
    width: 250px !important;
    max-width: 100% !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.chp-password-input:focus {
    outline: none !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3) !important;
}

/* Form email */
.chp-email-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.chp-email-input {
    background: rgba(255,255,255,0.95) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    border-radius: 25px !important;
    width: 300px !important;
    max-width: 100% !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.chp-email-input:focus {
    outline: none !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3) !important;
}

/* Container hướng dẫn */
.chp-guide-container {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    text-align: left;
    position: relative;
    z-index: 2;
}

.chp-guide-icon {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.chp-guide-content {
    flex: 1;
}

.chp-guide-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chp-guide-text {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    opacity: 0.95;
}

.chp-code-input {
    background: rgba(255,255,255,0.95) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    border-radius: 25px !important;
    width: 250px !important;
    max-width: 100% !important;
    color: #333 !important;
    margin-right: 10px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    pointer-events: auto !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.chp-code-input:focus {
    outline: none !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3) !important;
}

/* Nội dung đã mở khóa */
.chp-unlocked-content {
    animation: fadeInUp 0.5s ease;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    margin-top: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .chp-locked-box {
        padding: 15px;
    }
    
    .chp-lock-header {
        margin-bottom: 15px;
    }
    
    .chp-lock-icon {
        font-size: 20px;
        margin-right: 8px;
    }
    
    .chp-lock-message {
        font-size: 16px;
    }
    
    .chp-guide-container {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .chp-guide-icon {
        font-size: 20px;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .chp-guide-title {
        font-size: 13px;
    }
    
    .chp-guide-text {
        font-size: 14px;
    }
    
    .chp-password-input,
    .chp-email-input,
    .chp-code-input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .chp-unlock-btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chp-unlocked-content {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }
}

/* Modal Unlock Styles */
.chp-unlock-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.3s ease;
}

.chp-unlock-modal {
    background: white !important;
    border-radius: 12px !important;
    max-width: 400px !important;
    width: 90% !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chp-unlock-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.chp-unlock-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.chp-unlock-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff4444;
    background: white;
    border: 2px solid #ff4444;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.chp-unlock-modal-close:hover {
    background: #ff4444;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

.chp-unlock-modal-body {
    padding: 30px;
}

.chp-unlock-modal-body input {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
    transition: border-color 0.3s !important;
}

.chp-unlock-modal-body input:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.chp-modal-submit-btn {
    width: 100% !important;
    padding: 14px 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

.chp-modal-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.chp-modal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

/* Hướng dẫn trong modal */
.chp-modal-guide-container {
    background: #f8f4ff;
    border: 2px solid #e0d5ff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

.chp-modal-guide-icon {
    font-size: 20px;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.chp-modal-guide-content {
    flex: 1;
}

.chp-modal-guide-title {
    color: #764ba2;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chp-modal-guide-text {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

/* HTML Content trong hướng dẫn */
.chp-html-content {
    color: #333;
}

.chp-html-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.chp-html-content strong,
.chp-html-content b {
    font-weight: 600;
    color: #222;
}

.chp-html-content em,
.chp-html-content i {
    font-style: italic;
}

.chp-html-content u {
    text-decoration: underline;
}

.chp-html-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    display: block;
}

.chp-html-content a {
    color: #667eea;
    text-decoration: underline;
}

.chp-html-content a:hover {
    color: #764ba2;
}

.chp-html-content ul,
.chp-html-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.chp-html-content li {
    margin: 5px 0;
    line-height: 1.5;
}

.chp-html-content h1,
.chp-html-content h2,
.chp-html-content h3,
.chp-html-content h4,
.chp-html-content h5,
.chp-html-content h6 {
    margin: 15px 0 10px 0;
    color: #333;
    font-weight: 600;
}

.chp-html-content h1 { font-size: 20px; }
.chp-html-content h2 { font-size: 18px; }
.chp-html-content h3 { font-size: 16px; }
.chp-html-content h4 { font-size: 15px; }
.chp-html-content h5 { font-size: 14px; }
.chp-html-content h6 { font-size: 13px; }

.chp-html-content blockquote {
    margin: 15px 0;
    padding: 10px 15px;
    background: #f5f5f5;
    border-left: 3px solid #667eea;
    font-style: italic;
}

.chp-html-content pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.chp-html-content code {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9em;
}

/* Modal rộng cho hướng dẫn */
.chp-unlock-modal-wide {
    max-width: 900px !important;
    width: 95% !important;
}

.chp-unlock-modal-wide .chp-unlock-modal-body {
    padding: 20px 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Container cho nội dung hướng dẫn rộng */
.chp-modal-guide-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chp-modal-guide-container {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
}

.chp-modal-guide-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

/* Phần input mã xác minh */
.chp-modal-input-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.chp-modal-input-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.chp-modal-input-section .chp-modal-code-input {
    width: 300px !important;
    max-width: 100% !important;
    margin: 0 auto 15px !important;
    display: block !important;
}

.chp-modal-input-section .chp-modal-submit-btn {
    width: auto !important;
    padding: 12px 30px !important;
}

/* Hiển thị ảnh trong hướng dẫn */
.chp-modal-guide-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: zoom-in;
}

.chp-modal-guide-content h1,
.chp-modal-guide-content h2,
.chp-modal-guide-content h3 {
    color: #764ba2;
    margin-top: 25px;
    margin-bottom: 15px;
}

.chp-modal-guide-content p {
    margin-bottom: 15px;
}

.chp-modal-guide-content ul,
.chp-modal-guide-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.chp-modal-guide-content li {
    margin: 8px 0;
}

.chp-modal-guide-content strong {
    color: #667eea;
    font-weight: 600;
}

/* Responsive cho modal rộng */
@media (max-width: 768px) {
    .chp-unlock-modal-wide {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
    
    .chp-unlock-modal-wide .chp-unlock-modal-header {
        border-radius: 0 !important;
    }
    
    .chp-unlock-modal-wide .chp-unlock-modal-body {
        max-height: calc(100vh - 80px);
        padding: 15px;
    }
    
    .chp-modal-guide-wrapper {
        gap: 15px;
    }
    
    .chp-modal-guide-container {
        padding: 15px;
    }
    
    .chp-modal-input-section {
        padding: 15px;
    }
}

/* Hiệu ứng scroll smooth */
.chp-unlock-modal-body {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

.chp-unlock-modal-body::-webkit-scrollbar {
    width: 8px;
}

.chp-unlock-modal-body::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.chp-unlock-modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.chp-unlock-modal-body::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Style cho links trong hướng dẫn */
.chp-modal-guide-content a,
.chp-html-content a {
    color: #2271b1;
    text-decoration: underline;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
    display: inline-block;
    padding-right: 18px;
}

.chp-modal-guide-content a:hover,
.chp-html-content a:hover {
    color: #764ba2;
    text-decoration: none;
}

/* Icon external link cho links mở tab mới */
.chp-modal-guide-content a[target="_blank"]::after,
.chp-html-content a[target="_blank"]::after {
    content: "\2197";
    position: absolute;
    right: 2px;
    top: -2px;
    font-size: 14px;
    font-weight: normal;
    color: #4a90e2;
}

/* Hiệu ứng hover cho link */
.chp-modal-guide-content a[target="_blank"]:hover::after,
.chp-html-content a[target="_blank"]:hover::after {
    color: #764ba2;
    transform: translate(2px, -2px);
}
