/* --- TỐI ƯU GIAO DIỆN TẠO ĐỀ THI CÁC MÔN --- */
.creation-layout {
    background: linear-gradient(120deg, #e0e7ff 0%, #f9fafb 100%);
}

.page-header-new {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 1.5rem 2rem 1rem 2rem;
    margin-bottom: 2rem;
    border-bottom: none;
}

.page-title-new {
    color: #00468c;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.page-subtitle-new {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 500;
}

.form-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 123, 255, 0.07);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.part-container {
    background: #f7fafd;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.04);
    padding: 1.5rem 1rem 1.5rem 1rem;
    margin-bottom: 2rem;
    border-top: 3px solid var(--primary);
}

.part-container h4 {
    color: #00468c;
    font-size: 1.2rem;
    font-weight: 800;
}

.add-question-btn {
    background: linear-gradient(90deg, #00c6ff 0%, var(--primary) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 22px;
    margin-top: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.08);
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.add-question-btn:hover {
    background: linear-gradient(90deg, #0056b3 0%, var(--primary) 100%);
}

#progress-tracker-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: none;
    margin-left: 2rem;
    padding: 2rem 1.5rem;
    width: 340px;
}

#progress-bar-container {
    background: #e0e7ff;
    border-radius: 8px;
    height: 12px;
    margin-bottom: 0.5rem;
}

#progress-bar {
    background: linear-gradient(90deg, #00c6ff 0%, var(--primary) 100%);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s;
}

#settings-panel {
    background: #f7fafd;
    border-radius: 10px;
    padding: 1.2rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.04);
}

#settings-panel h4 {
    color: #00468c;
    font-size: 1.1rem;
    font-weight: 700;
}

.form-group label {
    color: #00468c;
    font-weight: 700;
}

.form-group input,
.form-group select {
    border-radius: 6px;
    border: 1.5px solid #b6d4fe;
    font-size: 1rem;
    padding: 0.7rem 0.9rem;
    margin-top: 0.2rem;
    background: #fafdff;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border: 1.5px solid var(--primary);
    outline: none;
}

.button-primary,
.button.button-primary {
    background: linear-gradient(90deg, var(--primary) 0%, #00c6ff 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 12px 32px;
    margin-top: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.08);
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.button-primary:hover,
.button.button-primary:hover {
    background: linear-gradient(90deg, #0056b3 0%, var(--primary) 100%);
}

.button-secondary,
.button.button-secondary {
    background: #e0e7ff;
    color: #00468c;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 22px;
    margin-top: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.04);
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.button-secondary:hover,
.button.button-secondary:hover {
    background: #d0e6ff;
}

@media (max-width: 1100px) {
    .creation-layout {
        flex-direction: column;
    }

    #progress-tracker-container {
        width: 100%;
        margin-left: 0;
        margin-top: 2rem;
        position: static;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
}

@media (max-width: 700px) {

    .main-content-wrapper,
    .form-container,
    #progress-tracker-container {
        padding: 1rem !important;
    }

    .page-header-new {
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }

    .part-container {
        padding: 1rem 0.5rem;
    }

    #settings-panel {
        padding: 0.7rem 0.5rem;
    }

    .button-primary,
    .button.button-primary,
    .button-secondary,
    .button.button-secondary {
        font-size: 1rem;
        padding: 10px 10px;
    }
}

/* --- CẤU TRÚC LAYOUT CHÍNH --- */
.creation-layout {
    display: flex;
    min-height: calc(100vh - 100px);
    /* Chiều cao tối thiểu để footer ở cuối trang */
    background-color: #f9fafb;
    /* Màu nền xám nhạt */
}

.main-content-wrapper {
    flex-grow: 1;
    /* Phần nội dung chính chiếm phần lớn không gian */
    padding: 2rem;
    overflow-y: auto;
    /* Cho phép cuộn nếu nội dung dài */
}

#progress-tracker-container {
    flex-shrink: 0;
    /* Không co lại */
    width: 320px;
    /* Chiều rộng cố định */
    background-color: #ffffff;
    border-left: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    /* Dính lại khi cuộn */
    top: 100px;
    /* Đẩy xuống dưới header (chiều cao header là 80px) */
    height: calc(100vh - 100px - 3rem);
    /* Chiều cao trừ header và padding */
    overflow-y: auto;
    /* Tự cuộn nếu nội dung dài */
}

/* --- TIÊU ĐỀ TRANG --- */
.page-header-new {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.page-title-new {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.page-subtitle-new {
    font-size: 1rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* --- FORM CHUNG --- */
.form-container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-group-inline {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.form-group-inline input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
}

/* --- CÁC PHẦN CÂU HỎI --- */
.part-container {
    margin-bottom: 2.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.part-container h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.part-instructions {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Khoảng cách giữa các câu hỏi */
}

/* --- KHỐI CÂU HỎI --- */
.question-block {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    /* Để bo góc hoạt động */
    transition: all 0.3s ease;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}

.question-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.question-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collapse-icon {
    font-size: 1rem;
    color: #6b7280;
    transition: transform 0.3s;
}

.delete-question-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

.delete-question-btn:hover {
    color: #dc2626;
}

/* Thu gọn câu hỏi */
.question-block.collapsed .form-group,
.question-block.collapsed .mcq-options-container,
.question-block.collapsed .true-false-options-container {
    display: none;
}

.question-block.collapsed .collapse-icon i {
    transform: rotate(180deg);
}

/* --- CSS MỚI CHO CÂU HỎI ĐÚNG/SAI ĐƠN GIẢN --- */
.true-false-options-container.simple-tf {
    flex-direction: row;
    /* Sắp xếp các lựa chọn theo hàng ngang */
    gap: 2rem;
    /* Tăng khoảng cách */
    padding: 0.5rem 1.25rem;
    /* Giảm padding cho gọn hơn */
}

.true-false-options-container.simple-tf .mcq-option {
    gap: 0.5rem;
    /* Giảm khoảng cách giữa radio và label */
}

.true-false-options-container.simple-tf .mcq-option label {
    font-weight: normal;
    /* Chữ không cần in đậm */
    cursor: pointer;
}

/* --- PHẦN ĐIỂM CÂU HỎI (Cải tiến) --- */
.question-points-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    /* Giảm gap */
    background-color: #f3f4f6;
    /* Nền xám nhẹ */
    padding: 4px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.question-points-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px hsla(210, 100%, 50%, 0.15);
}

.points-adjust-btn {
    width: 24px;
    height: 24px;
    border: none;
    background-color: #fff;
    color: var(--color-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.points-adjust-btn:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.points-adjust-btn:active {
    background-color: var(--color-primary);
    color: white;
}

.question-points {
    width: 50px;
    text-align: center;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 1rem;
    padding: 0 0.25rem;
}

.question-points:focus {
    outline: none;
}

.question-points-wrapper span {
    font-size: 0.85rem;
    color: #6b7280;
    margin-left: 0.25rem;
}

/* --- CÁC LOẠI CÂU HỎI --- */
.mcq-options-container,
.true-false-options-container {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mcq-option,
.true-false-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mcq-option input[type="radio"],
.true-false-option input[type="radio"] {
    flex-shrink: 0;
}

.mcq-option .option-text,
.true-false-option .sub-question-prompt {
    flex-grow: 1;
}

/* --- NÚT BẤM --- */
.add-question-btn {
    margin-top: 1rem;
}

/* --- THANH TIẾN ĐỘ (BÊN PHẢI) --- */
#progress-tracker-container h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

#progress-bar-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 999px;
    height: 10px;
    margin-bottom: 0.5rem;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    border-radius: 999px;
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* --- PANEL CÀI ĐẶT & NHẬP FILE --- */
#settings-panel,
#import-panel {
    margin-bottom: 1.5rem;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

#import-panel .import-instructions {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* --- MODAL XEM TRƯỚC --- */
.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    /* Ẩn mặc định */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.preview-modal-content {
    background-color: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.preview-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
}

.preview-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-question-block {
    border-bottom: 1px dashed #d1d5db;
    padding-bottom: 1.5rem;
}

.preview-question-block:last-child {
    border-bottom: none;
}

.preview-question-block h4 {
    margin-bottom: 1rem;
}

.preview-mcq-option {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.preview-mcq-option.correct-answer {
    background-color: #d1fae5;
    /* Màu xanh lá cây nhạt */
    font-weight: bold;
}

.correct-icon {
    color: #10b981;
    /* Màu xanh lá cây đậm */
    margin-left: auto;
}

.preview-notice {
    color: #ef4444;
    /* Màu đỏ */
    margin-top: 0.5rem;
}

.preview-answer-key {
    margin-top: 0.75rem;
    background-color: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* --- NÚT CUỘN --- */
.scroll-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.scroll-buttons button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.scroll-buttons button:hover {
    background-color: var(--primary-color-dark);
}

/* --- MODAL CHIA SẺ LINK --- */
#share-link-modal .modal-content {
    text-align: center;
}

#share-link-modal h2 {
    color: var(--primary-color);
}

.share-link-input-wrapper {
    display: flex;
    margin-top: 1rem;
}

#shareable-link-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    background-color: #f4f4f4;
}

#copy-link-btn {
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #e9e9e9;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

#copy-link-btn:hover {
    background-color: #ddd;
}

#qrcode-container {
    margin: 1.5rem auto;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    display: inline-block;
}

#qr-code-downloadable-area {
    padding: 1rem;
    background-color: white;
    display: inline-block;
    /* Để vừa với nội dung */
    margin-bottom: 1rem;
    border: 1px solid #eee;
}

.qr-logo {
    max-width: 150px;
    margin-bottom: 10px;
}

/* --- PHẦN ĐIỂM CÂU HỎI --- */
.question-points-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.question-points {
    width: 60px;
    text-align: center;
    border: none;
    background: none;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Ẩn mũi tên tăng giảm của input number */
.question-points::-webkit-outer-spin-button,
.question-points::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.question-points[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}


.question-points-wrapper span {
    font-size: 0.85rem;
    color: #6b7280;
}

/* --- TỔNG ĐIỂM --- */
.total-points-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 1.1rem;
}

#total-points-display {
    font-weight: bold;
    color: var(--primary-color);
    background-color: #e0e7ff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* --- PHÂN CHIA CÁC PHẦN THI --- */
.section-divider {
    border: none;
    border-top: 2px dashed #d1d5db;
    margin: 3rem 0;
}

h2 {
    text-align: center;
    color: #4b5563;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* --- NHÓM NÚT --- */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button-tertiary {
    background-color: #f0fdf4;
    /* Màu xanh lá cây rất nhạt */
    color: #16a34a;
    /* Màu xanh lá cây đậm */
    border: 1px solid #bbf7d0;
}

.button-tertiary:hover {
    background-color: #dcfce7;
}

/* --- KHỐI ĐOẠN VĂN --- */
.passage-block .question-header {
    background-color: #fefce8;
    /* Màu vàng nhạt */
    border-bottom-color: #fde047;
}

.passage-block .question-header h4 {
    color: #a16207;
    /* Màu vàng đậm */
}

/* --- CSS MỚI CHO TRÌNH SOẠN THẢO ĐƠN GIẢN --- */

/* Biến div contenteditable thành một ô nhập liệu */
.question-prompt[contenteditable="true"] {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.6;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow-y: auto;
    /* Cho phép cuộn nếu nội dung dài */
    -webkit-user-select: text;
    /* Cho phép chọn văn bản */
    user-select: text;
}

.question-prompt[contenteditable="true"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Tạo placeholder cho div contenteditable */
.question-prompt[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
    pointer-events: none;
    display: block;
    /* Required for content to show */
}

/* Định dạng hình ảnh bên trong trình soạn thảo */
.question-prompt[contenteditable="true"] img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Căn chỉnh label và nút chèn ảnh trên cùng một hàng */
.prompt-label-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.prompt-label-group label {
    margin-bottom: 0;
}

.upload-image-btn i.fa-spinner {
    animation: fa-spin 1.5s infinite linear;
}

/* --- Progress Tracker --- */
#progress-tracker-container {
    background-color: #fff;
    padding: 1rem;
    border-radius: var(--border-radius-soft);
    box-shadow: var(--shadow-subtle);
    margin-bottom: 1rem;
}

#progress-tracker-container h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--color-text-secondary);
}

#progress-bar-container {
    width: 100%;
    background-color: var(--color-surface-soft);
    border-radius: var(--border-radius-hard);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

#progress-bar {
    width: 0%;
    height: 10px;
    background-color: var(--color-success);
    transition: width 0.3s ease-in-out;
}

/* --- English Test Grid Layout --- */
#english-test-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.skill-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius-soft);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.skill-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.skill-card-header i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.skill-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.skill-card-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Đẩy button group xuống dưới */
}

.skill-card .questions-container {
    margin-bottom: 1rem;
}

/* Responsive for English Test Grid */
@media (max-width: 992px) {
    #english-test-grid {
        grid-template-columns: 1fr;
    }
}

/* --- English Test Preview Specifics --- */
.passage-preview,
.audio-preview {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
}

.audio-preview audio {
    width: 100%;
}

/* --- HSK Test Creation Specifics --- */
.hsk-level-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius-soft);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.hsk-level-title {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

/* Modal chia sẻ đề thi */
.share-modal {
    max-width: 600px;
    width: 90%;
    border-radius: 16px;
    overflow: hidden;
}

.share-modal .modal-header {
    background: linear-gradient(135deg, #00468c 0%, #0066cc 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.share-modal .modal-header .fa-check-circle {
    color: #4ade80;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.share-modal .modal-body {
    padding: 2rem;
}

.share-instructions {
    text-align: center;
    color: #4b5563;
    margin-bottom: 2rem;
}

.sharing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 640px) {
    .sharing-options {
        grid-template-columns: 1fr;
    }
}

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#qr-code-downloadable-area {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.qr-logo {
    max-width: 150px;
    height: auto;
}

.link-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-section label {
    font-weight: 600;
    color: #374151;
}

.share-link-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}

.share-link-input-wrapper:focus-within {
    border-color: #00468c;
}

#shareable-link-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #1f2937;
}

.copy-btn {
    background: #f3f4f6;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.copy-btn:hover {
    background: #e5e7eb;
}

.copy-btn .tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.copy-btn.copied .tooltip {
    opacity: 1;
    visibility: visible;
}

#download-qr-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    gap: 0.5rem;
}

/* Device Check Modal */
.device-check-modal {
    max-width: 500px;
    width: 90%;
    border-radius: 16px;
    overflow: hidden;
}

.device-check-modal .modal-header {
    background: linear-gradient(135deg, #00468c 0%, #0066cc 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.device-check-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.device-check-modal .modal-header .fa-exclamation-circle {
    color: #fde047;
}

.device-check-modal .modal-body {
    padding: 2rem;
    background: white;
}

.device-check-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.device-check-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    color: #334155;
}

.device-check-list li i {
    font-size: 1.25rem;
    color: #00468c;
    width: 24px;
    text-align: center;
}

.device-check-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .device-check-actions {
        flex-direction: column;
    }

    .device-check-actions button {
        width: 100%;
    }
}

/* CSS cho Modal (thêm vào file .css của bạn) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 800px;
    /* Kích thước lớn hơn cho modal hướng dẫn */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #000;
}

.modal-body pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    white-space: pre-wrap;
    /* Giúp code không bị tràn */
    word-break: break-all;
    font-size: 0.9em;
}

.modal-actions {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}