* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.upload-section {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(45deg, #f8f9ff, #ffffff);
}

.upload-section:hover {
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.upload-section.dragover {
    border-color: #764ba2;
    background: linear-gradient(45deg, #f0f4ff, #f8f9ff);
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.upload-subtext {
    color: #666;
    font-size: 1rem;
}

#fileInput {
    display: none;
}

.pdf-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.pdf-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.pdf-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-icon {
    color: #e74c3c;
    font-size: 1.5rem;
}

.remove-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: linear-gradient(45deg, #ff5252, #e74c3c);
    transform: scale(1.05);
}

.page-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.page-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9ff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e0e6ff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-checkbox:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-checkbox input {
    cursor: pointer;
}

.page-checkbox input:checked + .page-checkbox,
.page-checkbox:has(input:checked) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #333;
}

.control-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.control-btn:disabled {
    background: linear-gradient(45deg, #ccc, #999);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.merge-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.merge-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

.merge-btn:disabled {
    background: linear-gradient(45deg, #ccc, #999);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress {
    display: none;
    margin-top: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.pdf-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.pdf-list::-webkit-scrollbar {
    width: 8px;
}

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

.pdf-list::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-content {
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
    }

    .page-selection {
        justify-content: center;
    }
}
