.merge-pdf-main {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 2rem;
}

.header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.header-section h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-color);
    opacity: 0.8;
}

.merge-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 3rem;
}

.upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area.dragover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--secondary-color);
}

.upload-prompt i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 1rem 0;
}

.upload-btn:hover {
    background: var(--secondary-color);
}

.upload-hint {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.files-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.add-more-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-more-btn:hover {
    background: var(--primary-color);
    color: white;
}

.files-list {
    margin-bottom: 2rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: move;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    color: var(--primary-color);
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
}

.file-size {
    font-size: 0.875rem;
    color: #64748b;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-btn,
.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.preview-btn {
    color: var(--primary-color);
}

.remove-btn {
    color: #ef4444;
}

.preview-btn:hover {
    color: var(--secondary-color);
}

.remove-btn:hover {
    color: #dc2626;
}

.merge-options {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.option-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
}

.preview-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.preview-section h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.hint {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.all-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 0.75rem;
}

.pdf-preview-card {
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: transform 0.2s ease;
}

.pdf-preview-card:hover {
    transform: translateY(-2px);
}

.pdf-preview-card.sortable-ghost {
    opacity: 0.5;
    background: #e2e8f0;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-controls button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem;
}

.preview-container {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    min-height: 300px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

#pdfPreview {
    max-width: 100%;
    max-height: 450px;
    height: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.merge-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.merge-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.merge-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.instructions {
    margin-top: 4rem;
    text-align: center;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .merge-container {
        padding: 1rem;
    }
    
    .preview-header {
        flex-direction: column;
    }
    
    #previewFile {
        width: 100%;
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .files-preview-container {
        grid-template-columns: 1fr;
    }
    
    .files-list-container {
        order: 2;
    }
    
    .preview-section {
        order: 1;
    }
}

@media (max-width: 640px) {
    .preview-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-controls {
        width: 100%;
    }
    
    .file-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Update split button styles */
.split-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.split-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Update split options container */
.split-options {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .split-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .split-options {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .split-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .split-options {
        padding: 0.875rem;
        margin: 1rem 0;
    }
}

/* Add these styles for convert PDF functionality */
.convert-options {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.convert-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convert-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.convert-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .convert-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .convert-options {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .convert-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .convert-options {
        padding: 0.875rem;
        margin: 1rem 0;
    }
}

/* Add these styles for edit PDF functionality */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.page-container {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.page-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.page-container.selected {
    border: 2px solid var(--primary-color);
}

.page-container canvas,
.page-container img {
    width: 100%;
    height: auto;
    display: block;
}

.page-label {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.action-btn {
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.action-btn.delete-btn {
    color: #ef4444;
}

.action-btn.delete-btn:hover {
    background: #fee2e2;
}

.edit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.edit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.new-page {
    border: 2px dashed var(--primary-color);
    background: #f8fafc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
}

/* Text editor styles */
.text-editor {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.text-editor-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.text-editor input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    min-width: 200px;
}

.text-editor input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

.text-editor select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
}

.text-overlay {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 4px;
    border: 1px dashed transparent;
}

.text-overlay:hover {
    border-color: var(--primary-color);
}

.text-overlay .remove-text {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 12px;
    display: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.text-overlay:hover .remove-text {
    display: block;
}

.text-blocks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.text-block {
    cursor: pointer;
    padding: 2px;
    border: 1px solid transparent;
    position: absolute;
    pointer-events: auto;
    transition: all 0.2s ease;
}

.text-block:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.inline-text-editor {
    position: absolute;
    display: flex;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.inline-text-editor input {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    min-width: 100px;
}

.inline-text-editor button {
    border: none;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.inline-text-editor button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inline-text-editor button:last-child {
    background: #ef4444;
}

.compress-option-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.compress-option-group label {
    margin-bottom: 0;
    min-width: 120px;
}
.compress-option-group .dimension-input {
    flex: 1;
}
@media (max-width: 600px) {
    .compress-option-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .compress-option-group label {
        min-width: 0;
    }
    .compress-option-group .dimension-input {
        width: 100%;
    }
} 