        :root {
            --primary: #4361ee;
            --primary-dark: #3a56d4;
            --secondary: #3f37c9;
            --success: #4cc9f0;
            --danger: #f72585;
            --warning: #f8961e;
            --info: #4895ef;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #6c757d;
            --light-gray: #e9ecef;
            --white: #ffffff;
            --black: #000000;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', sans-serif;
            line-height: 1.6;
            color: var(--dark);
            background-color: #f5f7fa;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .headerp {
            text-align: center;
            margin: 1rem 0;
            padding: 1rem 1rem;
            background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
            color: white;
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
        }

        .headerp h1 {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
            font-weight: 700;
        }

        .headerp p {
            font-size: 1rem;
            opacity: 0.9;
            max-width: 700px;
            margin: 0 auto;
        }

        .tool-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
            margin-bottom: 40px;
        }

        @media (max-width: 768px) {
            .tool-container {
                grid-template-columns: 1fr;
            }
        }

        .panel {
            background-color: var(--white);
            border-radius: 12px;
            box-shadow: var(--shadow-md);
            overflow: hidden;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .panel:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        }

        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 25px;
            background-color: var(--primary);
            color: white;
        }

        .panel-title {
            display: flex;
            align-items: center;
            font-weight: 600;
            font-size: 1.1rem;
        }

        .panel-title i {
            margin-right: 12px;
            font-size: 1.2rem;
        }

        .panel-actions {
            display: flex;
            gap: 10px;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px 18px;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            font-size: 0.95rem;
        }

        .btn i {
            margin-right: 8px;
        }

        .btn-sm {
            padding: 8px 14px;
            font-size: 0.9rem;
        }

        .btn-primary {
            background-color: white;
            color: var(--primary);
            font-weight: 600;
        }

        .btn-primary:hover {
            background-color: rgba(255,255,255,0.9);
        }

        .btn-secondary {
            background-color: rgba(255,255,255,0.1);
            color: white;
            border: 1px solid rgba(255,255,255,0.3);
        }

        .btn-secondary:hover {
            background-color: rgba(255,255,255,0.2);
        }

        .btn-danger {
            background-color: var(--danger);
            color: white;
        }

        .btn-danger:hover {
            background-color: #e5177b;
        }

        .upload-section {
            padding: 40px 25px;
            text-align: center;
        }

        .upload-option {
            border: 2px dashed rgba(67, 97, 238, 0.3);
            border-radius: 10px;
            padding: 40px 30px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            background-color: rgba(67, 97, 238, 0.03);
        }

        .upload-option:hover {
            border-color: var(--primary);
            background-color: rgba(67, 97, 238, 0.08);
        }

        .upload-icon {
            font-size: 3rem;
            color: var(--primary);
            margin-bottom: 20px;
            opacity: 0.8;
        }

        .upload-text {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--dark);
        }

        .upload-subtext {
            font-size: 0.95rem;
            color: var(--gray);
            margin-bottom: 20px;
        }

        #fileInput {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            opacity: 0;
            cursor: pointer;
        }

        .uploaded-files {
            border-top: 1px solid var(--light-gray);
        }

        .uploaded-files-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 25px;
            border-bottom: 1px solid var(--light-gray);
        }

        .uploaded-files-title {
            font-weight: 600;
            color: var(--dark);
        }

        .uploaded-files-count {
            background-color: var(--primary);
            color: var(--white);
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
        }

        .uploaded-files-list {
            padding: 15px;
            min-height: 200px;
            max-height: 400px;
            overflow-y: auto;
        }

        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 200px;
            color: var(--gray);
            text-align: center;
        }

        .empty-state i {
            font-size: 3rem;
            margin-bottom: 15px;
            color: var(--light-gray);
            opacity: 0.5;
        }

        .empty-state p {
            font-size: 1rem;
            color: var(--gray);
        }

        .file-item {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            border-radius: 8px;
            margin-bottom: 10px;
            background-color: var(--light);
            transition: all 0.2s ease;
            border: 2px solid transparent;
            position: relative;
        }

        .file-item.dragging {
            opacity: 0.5;
            background-color: rgba(67, 97, 238, 0.1);
        }

        .file-item.selected {
            border-color: var(--primary);
            background-color: rgba(67, 97, 238, 0.1);
        }

        .file-item:last-child {
            margin-bottom: 0;
        }

        .file-icon {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: rgba(67, 97, 238, 0.1);
            border-radius: 6px;
            margin-right: 15px;
            color: var(--primary);
            font-size: 1.2rem;
        }

        .file-info {
            flex: 1;
            min-width: 0;
        }

        .file-name {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 3px;
        }

        .file-size {
            font-size: 0.85rem;
            color: var(--gray);
        }

        .file-actions {
            display: flex;
            gap: 8px;
        }

        .file-action-btn {
            background: none;
            border: none;
            color: var(--gray);
            cursor: pointer;
            font-size: 1rem;
            padding: 5px;
            transition: color 0.2s ease;
        }

        .file-action-btn:hover {
            color: var(--danger);
        }

        .file-drag-handle {
            cursor: move;
            color: var(--gray);
            margin-right: 10px;
            padding: 5px;
        }

        .options-container {
            padding: 25px 25px 25px;
        }

        .option-group {
            margin-bottom: 25px;
        }

        .option-group-title {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            font-weight: 600;
            color: var(--dark);
        }

        .option-group-title i {
            margin-right: 10px;
            color: var(--primary);
        }

        .checkbox-option {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }

        .checkbox-option input {
            margin-right: 10px;
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
        }

        .checkbox-option label {
            font-weight: 500;
            color: var(--dark);
            cursor: pointer;
        }

        .radio-group {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 15px;
        }

        .radio-option {
            display: flex;
            align-items: center;
        }

        .radio-option input {
            margin-right: 10px;
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
        }

        .radio-option label {
            font-weight: 500;
            color: var(--dark);
            cursor: pointer;
        }

        .controls {
            display: flex;
            justify-content: space-between;
            padding: 0 25px 25px;
            gap: 15px;
        }

        .controls .btn {
            flex: 1;
            padding: 12px;
            font-size: 1rem;
            font-weight: 600;
        }

        .btn-reset {
            background-color: var(--light-gray);
            color: var(--dark);
        }

        .btn-reset:hover {
            background-color: #e2e6ea;
        }

        .btn-merge {
            background-color: var(--primary);
            color: white;
        }

        .btn-merge:hover {
            background-color: var(--primary-dark);
        }

        /* Compact Results Section */
        .results-container {
            background-color: var(--white);
            border-radius: 12px;
            box-shadow: var(--shadow-md);
            margin-bottom: 40px;
            overflow: hidden;
            display: none;
            max-width: 1200px;
            margin: 0 auto 40px;
        }

        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background-color: var(--primary);
            color: white;
        }

        .results-title {
            display: flex;
            align-items: center;
            font-weight: 600;
            font-size: 1rem;
        }

        .results-title i {
            margin-right: 10px;
            font-size: 1rem;
        }

        .results-count {
            font-size: 0.85rem;
            opacity: 0.9;
        }

        .results-content {
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .result-card {
            width: 100%;
            background: linear-gradient(135deg, rgba(67, 97, 238, 0.05) 0%, rgba(76, 201, 240, 0.05) 100%);
            border-radius: 10px;
            padding: 20px;
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            border: 1px solid rgba(67, 97, 238, 0.1);
        }

        .result-icon {
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: rgba(67, 97, 238, 0.1);
            border-radius: 8px;
            margin-right: 15px;
            color: var(--primary);
            font-size: 1.5rem;
        }

        .result-details {
            flex: 1;
        }

        .result-name {
            font-weight: 600;
            margin-bottom: 5px;
            font-size: 0.95rem;
        }

        .result-meta {
            display: flex;
            gap: 15px;
        }

        .meta-item {
            display: flex;
            align-items: center;
            font-size: 0.85rem;
            color: var(--gray);
        }

        .meta-item i {
            margin-right: 5px;
            font-size: 0.9rem;
        }

        .result-actions {
            display: flex;
            gap: 10px;
        }

        .action-btn {
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: all 0.2s ease;
        }

        .download-btn {
            background-color: var(--primary);
            color: white;
            border: none;
        }

        .download-btn:hover {
            background-color: var(--primary-dark);
        }

        .new-btn {
            background-color: white;
            color: var(--primary);
            border: 1px solid var(--primary);
        }

        .new-btn:hover {
            background-color: rgba(67, 97, 238, 0.1);
        }

        .loading {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px;
            text-align: center;
        }

        .spinner {
            width: 50px;
            height: 50px;
            border: 5px solid rgba(67, 97, 238, 0.1);
            border-left-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading-text {
            font-weight: 500;
            margin-bottom: 15px;
            color: var(--dark);
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background-color: var(--light-gray);
            border-radius: 4px;
            margin-top: 15px;
            overflow: hidden;
        }

        .progress {
            height: 100%;
            background: linear-gradient(90deg, #4361ee 0%, #4cc9f0 100%);
            width: 0%;
            transition: width 0.3s ease;
        }

        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            padding: 15px 25px;
            border-radius: 8px;
            background-color: var(--dark);
            color: var(--white);
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            transform: translateX(150%);
            transition: transform 0.3s ease;
            max-width: 350px;
        }

        .toast.show {
            transform: translateX(0);
        }

        .toast.success {
            background-color: #2ecc71;
        }

        .toast.error {
            background-color: var(--danger);
        }

        .toast.warning {
            background-color: var(--warning);
        }

        .toast.info {
            background-color: var(--info);
        }

        .toast i {
            margin-right: 12px;
            font-size: 1.2rem;
        }

        .toast-close {
            background: none;
            border: none;
            color: inherit;
            cursor: pointer;
            margin-left: 20px;
            font-size: 1.1rem;
            opacity: 0.7;
            transition: opacity 0.2s ease;
        }

        .toast-close:hover {
            opacity: 1;
        }

        @media (max-width: 768px) {
            .headerp h1 {
                font-size: 1.8rem;
            }
            
            .headerp p {
                font-size: 1rem;
            }
            
            .panel-header {
                padding: 15px 20px;
            }
            
            .upload-section {
                padding: 30px 20px;
            }
            
            .upload-option {
                padding: 30px 20px;
            }
            
            .result-card {
                flex-direction: column;
                text-align: center;
            }
            
            .result-icon {
                margin-right: 0;
                margin-bottom: 15px;
            }
            
            .result-meta {
                justify-content: center;
                margin-bottom: 15px;
            }
            
            .result-actions {
                width: 100%;
                justify-content: center;
            }

            .toast {
                max-width: 280px;
                padding: 12px 20px;
            }
        }

        /* Drag and drop styling */
        .upload-option.drag-over {
            border-color: var(--primary);
            background-color: rgba(67, 97, 238, 0.1);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
        }

        /* Page range selector */
        .page-range-container {
            margin-top: 15px;
            display: none;
        }

        .page-range-input {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .page-range-input input {
            padding: 8px 12px;
            border: 1px solid var(--light-gray);
            border-radius: 6px;
            width: 80px;
            text-align: center;
        }

        .page-range-input span {
            color: var(--gray);
            font-size: 0.9rem;
        }

        .page-range-note {
            font-size: 0.85rem;
            color: var(--gray);
            font-style: italic;
        }
        .info-container {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 40px;
}

.info-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.info-header i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-right: 15px;
}

.info-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.info-card {
    background-color: var(--light);
    border-radius: 10px;
    padding: 25px;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.3rem;
}

.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.info-card p {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.5;
}
