* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h1 i {
    margin-right: 10px;
    color: #e74c3c;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    justify-content: center;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom: 3px solid #e74c3c;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    position: relative;
}

.upload-area:hover {
    background-color: #f8f9fa;
    border-color: #2980b9;
}

.upload-area i {
    font-size: 50px;
    color: #3498db;
    margin-bottom: 10px;
}

.upload-area p {
    margin-bottom: 0;
    color: #7f8c8d;
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    margin-bottom: 20px;
}

.file-list h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.file-list ul {
    list-style: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.file-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list li i {
    color: #e74c3c;
    cursor: pointer;
    margin-left: 10px;
}

.file-list li i:hover {
    opacity: 0.8;
}

.merge-options, .split-options {
    margin-top: 15px;
}

.merge-options label, .split-options label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.merge-options input, .split-options input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border 0.3s;
}

.merge-options input:focus, .split-options input:focus {
    border-color: #3498db;
    outline: none;
}

.split-options-container {
    margin-top: 15px;
    background: #f9fbfd;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.split-mode-selector {
    margin-bottom: 15px;
}

.split-mode-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border 0.3s;
    background-color: white;
    color: #333;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

.split-mode-input {
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.split-mode-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.split-mode-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border 0.3s;
}

.split-mode-input input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

.hint-text {
    display: block;
    color: #7f8c8d;
    margin-top: 8px;
    font-size: 13px;
    font-style: italic;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn i {
    font-size: 14px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 25px;
    border-radius: 10px;
    width: 85%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

/* Preview tabs */
.preview-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    padding-bottom: 5px;
}

.preview-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
}

.preview-tab:hover {
    background-color: #f1f1f1;
}

.preview-tab.active {
    border-color: #ddd;
    border-bottom-color: #fff;
    background: #fff;
    font-weight: bold;
    color: #3498db;
}

.preview-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #3498db;
}

#pdf-preview-container {
    width: 100%;
    height: 60vh;
    position: relative;
    background-color: #f1f1f1;
    border-radius: 5px;
    overflow: hidden;
}

#pdf-preview {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    text-align: center;
}

.preview-page-info {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* PDF Page Styles */
#pdf-preview canvas {
    display: block;
    margin: 0 auto 20px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    background-color: white;
    border: 1px solid #ddd;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #3498db;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 40px;
    font-size: 16px;
    font-weight: bold;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Drag and Drop Highlight */
.highlight {
    background-color: #e3f2fd;
    border-color: #2196f3 !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        margin: 15px;
        padding: 15px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }
    
    #pdf-preview-container {
        height: 50vh;
    }
    
    .preview-tabs {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-area i {
        font-size: 40px;
    }
    
    .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    #pdf-preview-container {
        height: calc(100vh - 200px);
    }
    
    .preview-page-info {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* PDF Page Transition */
.pdf-page {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.pdf-page.loaded {
    opacity: 1;
}

/* Thêm vào phần CSS */
.header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.refresh-btn {
    background-color: #b6230d;
    padding: 8px 15px;
    font-size: 14px;
}

.refresh-btn:hover {
    background-color: #27ae60;
}

.refresh-btn i {
    margin-right: 5px;
}

/* Animation khi làm mới */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.refreshing i {
    animation: spin 1s linear infinite;
}

/* Tracker Stats CSS */
.tracker-stats {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
}
.tracker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.tracker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.tracker-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tracker-values {
    display: flex;
    width: 100%;
    justify-content: space-around;
}
.val-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.val-col span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.val-col small {
    font-size: 0.75rem;
    color: #94a3b8;
}
@media (max-width: 600px) {
    .tracker-grid {
        grid-template-columns: 1fr;
    }
}