/* 9Nex Tools - PDF Merger Styles */
:root {
    --primary-color: #206BC4;
    --primary-dark: #1a5aa0;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 28px;
}

.logo p {
    color: var(--secondary-color);
    font-size: 14px;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tool-header h2 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 14px;
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 20px;
    text-align: center;
    margin: 2rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light-color);
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.upload-content {
    max-width: 400px;
    margin: 0 auto;
}

.upload-icon {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-hint {
    color: var(--secondary-color);
    margin: 10px 0;
    font-size: 14px;
}

.file-restrictions {
    color: var(--secondary-color);
    font-size: 12px;
    margin-top: 10px;
}

#fileInput {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Controls Panel */
.controls-panel {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.control-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 107, 196, 0.1);
}

/* Files Container */
.files-container {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.files-header h3 {
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.files-count {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.files-list {
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* File Item */
.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.file-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.file-item.sortable-ghost {
    opacity: 0.4;
    background: #f0f7ff;
}

.file-handle {
    padding: 0 10px;
    cursor: move;
    color: var(--secondary-color);
    opacity: 0.5;
}

.file-item:hover .file-handle {
    opacity: 1;
}

.file-icon {
    padding: 0 15px;
    font-size: 24px;
    color: var(--danger-color);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size,
.file-pages {
    font-size: 12px;
    color: var(--secondary-color);
}

.file-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.password-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.password-input {
    width: 120px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.btn-icon {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--dark-color);
}

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

.btn-remove {
    color: var(--danger-color);
}

/* Range Panel */
.file-range-panel {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.range-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.range-controls label {
    font-size: 12px;
    font-weight: 500;
}

.range-input {
    flex: 1;
    min-width: 200px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.btn-small {
    padding: 5px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.btn-small:hover {
    background: var(--primary-dark);
}

.range-hint {
    font-size: 11px;
    color: var(--secondary-color);
    width: 100%;
}

/* Buttons */
.files-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Progress Container */
.progress-container {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.progress-bar {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4dabf7);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--secondary-color);
    font-size: 14px;
}

/* Result Container */
.result-container {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
}

.result-success i {
    font-size: 64px;
    color: var(--success-color);
    margin-bottom: 20px;
}

.result-success h3 {
    color: var(--success-color);
    margin-bottom: 10px;
}

.result-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.result-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-success .btn {
    margin: 10px;
    min-width: 200px;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.faq-section h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-item {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.faq-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 16px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--secondary-color);
    font-size: 14px;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .tool-header h2 {
        font-size: 24px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .control-group {
        grid-template-columns: 1fr;
    }
    
    .file-item {
        flex-wrap: wrap;
    }
    
    .file-controls {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
    }
    
    .files-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .result-success .btn {
        width: auto;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .files-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .range-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .range-input {
        min-width: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}