* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    text-align: center;
    padding: 30px;
    font-size: 2.5em;
    margin: 0;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    padding: 20px 30px 0;
    border-bottom: 2px solid #f0f0f0;
}

h3 {
    color: #555;
    margin-bottom: 15px;
}

.search-section, .results-section {
    padding: 30px;
}

.search-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.search-textarea {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
    resize: vertical;
    min-height: 60px;
}

.search-textarea:focus {
    outline: none;
    border-color: #4ecdc4;
}

.search-btn {
    padding: 15px 30px;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    align-self: flex-start;
    margin-top: 0;
}

.search-btn:hover {
    transform: translateY(-2px);
}

.filters-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-group {
    display: inline-block;
    margin: 10px 20px 10px 0;
    vertical-align: top;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    min-width: 150px;
}

.results-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-fields {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.custom-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}

.custom-field label {
    font-weight: bold;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.custom-input:focus {
    outline: none;
    border-color: #4ecdc4;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.quantity-input label {
    font-weight: bold;
    color: #555;
}

.count-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 80px;
}

.download-btn {
    padding: 12px 25px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.copy-column8-btn {
    padding: 12px 25px;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.download-btn:hover:not(:disabled),
.copy-column8-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.download-btn:disabled,
.copy-column8-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4ecdc4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-table {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    text-align: center;
    vertical-align: middle;
    padding: 15px 8px;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Điều chỉnh width cột cho 13 cột với STT, checkbox và thumbnail */
td:nth-child(1) { width: 4%; text-align: center; } /* STT */
td:nth-child(2) { width: 4%; text-align: center; } /* Checkbox */
td:nth-child(3) { width: 8%; text-align: center; } /* Thumbnail */
td:nth-child(4) { width: 6%; } /* Từ khóa */
td:nth-child(5) { width: 15%; } /* Tiêu đề */
td:nth-child(6) { width: 7%; } /* Video ID */
td:nth-child(7) { width: 10%; } /* Video URL */
td:nth-child(8) { width: 8%; } /* Tên kênh */
td:nth-child(9) { width: 10%; } /* Link kênh */
td:nth-child(10) { width: 6%; } /* Thời lượng */
td:nth-child(11) { width: 7%; } /* Lượt xem */
td:nth-child(12) { width: 6%; } /* Comment */
td:nth-child(13) { width: 18%; } /* Tổng hợp */

.copy-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    margin-left: 5px;
}

.copy-btn:hover {
    background: #44a08d;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #ffcdd2;
}

.hidden {
    display: none;
}

.custom-fields {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.apply-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.apply-btn {
    padding: 8px 16px;
    background: linear-gradient(45deg, #ff9a56, #ff6b6b);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

.apply-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.apply-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.format-checkbox {
    margin-right: 8px;
    transform: scale(1.2);
}

.custom-field label {
    font-weight: bold;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.format-help {
    display: block;
    color: #666;
    font-style: italic;
    margin-top: 5px;
    font-size: 12px;
}

.custom-field:has(.format-checkbox) {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.format-options {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.format-title {
    font-weight: bold;
    color: #555;
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-label {
    font-weight: normal;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-text {
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.column-checkbox {
    margin: 5px auto;
    display: block;
    transform: scale(1.2);
    cursor: pointer;
}

/* Comment button styling */
.comment-btn {
    background: linear-gradient(45deg, #ff9a56, #ff6b6b);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
}

.comment-btn:hover {
    background: linear-gradient(45deg, #ff8a46, #ff5b5b);
    transform: translateY(-1px);
}

.comment-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Modal styling */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Cập nhật modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px 10px 0 0;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.comment-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comment-controls label {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.comment-limit-input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 12px;
    text-align: center;
}

.comment-limit-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: white;
}

.load-comments-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.load-comments-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.load-comments-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading state cho load button */
.load-comments-btn.loading {
    position: relative;
    color: transparent;
}

.load-comments-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.copy-all-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-all-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.copy-all-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ffcccb;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.video-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.video-info h4 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.video-info p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.comment-loading {
    text-align: center;
    padding: 40px;
}

/* Cập nhật comment list */
.comment-list {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
    padding: 5px;
}

.load-more-comments {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.load-more-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.load-more-btn:hover {
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.infinite-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    color: #666;
    font-size: 14px;
}

.infinite-loading .spinner {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.end-of-comments {
    text-align: center;
    padding: 15px;
    color: #888;
    font-style: italic;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

/* Cập nhật comment item để hiển thị 1 dòng */
.comment-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4ecdc4;
    transition: background-color 0.2s;
}

.comment-item:hover {
    background: #e9ecef;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0; /* Cho phép flex item shrink */
}

.comment-author {
    font-weight: bold;
    color: #333;
    font-size: 12px;
    margin-bottom: 2px;
}

.comment-text {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    line-height: 1.3;
}

.comment-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #888;
}

.comment-likes {
    display: flex;
    align-items: center;
    gap: 3px;
}

.comment-error {
    text-align: center;
    padding: 40px;
    color: #c62828;
}

/* Responsive modal */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 1.8em;
        padding: 20px;
    }
    
    .search-section, .results-section {
        padding: 20px;
    }
    
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-btn {
        align-self: stretch;
        margin-top: 10px;
    }
    
    .results-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .filter-group {
        display: block;
        margin: 10px 0;
    }
    
    table {
        font-size: 10px;
    }
    
    th, td {
        padding: 8px 4px;
    }

    .custom-fields {
        flex-direction: column;
        gap: 15px;
    }
    
    .custom-field {
        min-width: auto;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .modal-header-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .comment-controls {
        justify-content: center;
    }
    
    .copy-all-btn,
    .load-comments-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .comment-limit-input {
        width: 50px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .comment-item {
        padding: 6px 8px;
    }
    
    .comment-avatar {
        width: 25px;
        height: 25px;
        margin-right: 8px;
    }
    
    .comment-text {
        font-size: 12px;
    }
    
    .comment-meta {
        font-size: 10px;
    }
}

.api-key-section {
    padding: 25px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.api-key-input-group {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.api-key-field {
    flex: 2;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-key-info {
    flex: 1;
    min-width: 350px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
}

.api-key-field label {
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

.api-key-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    transition: border-color 0.3s;
    resize: vertical;
    min-height: 80px;
    max-height: 120px;
}

.api-key-textarea:focus {
    outline: none;
    border-color: #4ecdc4;
}

.api-key-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.validate-btn, .add-btn, .clear-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.validate-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.validate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.add-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.clear-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.api-key-count {
    font-size: 11px;
    color: #666;
    font-weight: bold;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.api-status-list {
    margin-top: 15px;
    background: #fafafa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    max-height: 200px;
    overflow-y: auto;
}

.api-status-list h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 13px;
}

.status-list {
    max-height: 200px;
    overflow-y: auto;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 11px;
    border-left: 3px solid transparent;
}

.api-key-item.valid {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.api-key-item.invalid {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.api-key-item.current {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
    font-weight: bold;
}

.api-key-item.checking {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.key-preview {
    font-family: monospace;
    font-size: 10px;
    flex: 1;
    margin-right: 8px;
}

.key-status {
    font-weight: bold;
    font-size: 10px;
    margin-right: 5px;
}

.key-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9px;
}

.key-remove:hover {
    background: #c82333;
}

.no-keys {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 15px 0;
    font-size: 12px;
}

.current-key-info {
    margin-top: 8px;
    padding: 6px 8px;
    background: #e8f5e8;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid #c3e6cb;
}

.current-key-info strong {
    color: #28a745;
}

@media (max-width: 768px) {
    .api-key-input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .api-key-field,
    .api-key-info {
        min-width: auto;
    }
    
    .api-key-controls {
        justify-content: center;
    }
}

.keyword-info {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4ecdc4;
}

.keyword-info p {
    margin: 0 0 10px 0;
    color: #333;
    font-weight: bold;
}

.keyword-info ul {
    margin: 0;
    padding-left: 20px;
}

.keyword-info li {
    margin: 5px 0;
    color: #555;
}

.keyword-info strong {
    color: #4ecdc4;
}

.comment-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    flex-shrink: 0;
}

.comment-copy-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.comment-item:hover .comment-copy-btn {
    opacity: 1;
}

.comment-copy-btn:hover {
    background: #44a08d;
}

/* Style cho checkbox */
.select-all-checkbox {
    transform: scale(1.3);
    cursor: pointer;
}

.row-checkbox {
    transform: scale(1.2);
    cursor: pointer;
    pointer-events: none; /* Ngăn double-click trên checkbox */
}

/* Style cho select all checkbox cell */
th .select-all-checkbox {
    transform: scale(1.3);
    cursor: pointer;
}

/* Style cho header checkbox */
th:has(.select-all-checkbox) {
    cursor: pointer;
    user-select: none;
}

th:has(.select-all-checkbox):hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Style cho button controls */
/* Xóa các style này */
/*
.select-control-btn {
    padding: 12px 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 14px;
}

.select-control-btn:hover {
    transform: translateY(-2px);
}
*/

/* Giữ lại style cho copy-selected-btn */
.copy-selected-btn {
    padding: 12px 25px;
    background: linear-gradient(45deg, #ff9a56, #ff6b6b);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 14px;
}

.copy-selected-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.copy-selected-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* STT styling */
.stt-cell {
    font-weight: bold;
    color: #666;
    background: #f8f9fa;
    text-align: center;
}

/* Cập nhật checkbox cell styling */
.checkbox-cell {
    text-align: center;
    padding: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-cell:hover {
    background-color: #f0f8ff;
}

.row-checkbox {
    transform: scale(1.2);
    cursor: pointer;
    pointer-events: none; /* Ngăn double-click trên checkbox */
}

/* Style cho select all checkbox cell */
th .select-all-checkbox {
    transform: scale(1.3);
    cursor: pointer;
}

/* Style cho header checkbox */
th:has(.select-all-checkbox) {
    cursor: pointer;
    user-select: none;
}

th:has(.select-all-checkbox):hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Selected row styling */
tr.selected {
    background-color: #e3f2fd !important;
    border-left: 4px solid #4ecdc4;
}

tr.selected:hover {
    background-color: #bbdefb !important;
}

tr.selected .checkbox-cell {
    background-color: #e3f2fd;
}

tr.selected .checkbox-cell:hover {
    background-color: #bbdefb;
}

/* STT cell styling - có thể click được */
.stt-cell {
    font-weight: bold;
    color: #666;
    background: #f8f9fa;
    text-align: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.stt-cell:hover {
    background-color: #e9ecef;
}

.stt-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.stt-cell:hover::before {
    background-color: rgba(78, 205, 196, 0.1);
}

/* Khi row được select, STT cũng thay đổi màu */
tr.selected .stt-cell {
    background-color: #e3f2fd;
    color: #1976d2;
}

tr.selected .stt-cell:hover {
    background-color: #bbdefb;
}

/* Visual feedback cho clickable areas */
.checkbox-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-cell:hover::before {
    background-color: rgba(78, 205, 196, 0.1);
}

.select-all-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.select-all-header:hover::before {
    background-color: rgba(255, 255, 255, 0.1);
}

.stt-header {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.stt-header:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.stt-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.stt-header:hover::before {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Kết hợp STT và checkbox thành một nhóm visual */
.stt-header,
.select-all-header {
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

/* Tooltip cho STT header */
.stt-header::after {
    content: 'Click để chọn tất cả';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.stt-header:hover::after {
    opacity: 1;
}

/* Video thumbnail styles */
.thumbnail-cell {
    text-align: center;
    padding: 8px;
    vertical-align: middle;
}

.video-thumbnail {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.video-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-thumbnail:active {
    transform: scale(0.95);
}

/* Responsive thumbnail */
@media (max-width: 768px) {
    .video-thumbnail {
        max-width: 80px;
    }
    
    .thumbnail-cell {
        padding: 4px;
    }
}

/* Thumbnail zoom modal styles */
.thumbnail-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
}

.thumbnail-modal-body {
    padding: 20px;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}

.thumbnail-zoom-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoomed-thumbnail {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.zoomed-thumbnail:hover {
    transform: scale(1.02);
}

.thumbnail-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
    text-align: left;
}

.thumbnail-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: bold;
}

.thumbnail-info p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.open-video-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.open-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Responsive thumbnail modal */
@media (max-width: 768px) {
    .thumbnail-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .thumbnail-modal-body {
        padding: 15px;
    }
    
    .zoomed-thumbnail {
        max-height: 50vh;
    }
    
    .open-video-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

