/* PDF Splitter Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

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

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

/* Upload Section */
.upload-section {
    padding: 40px;
}

.upload-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.upload-area {
    border: 3px dashed #ff6b6b;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    background: #f8fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #ee5a24;
    background: #fff5f5;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #00c851;
    background: #e8f5e8;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.upload-text h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.upload-text p {
    color: #7f8c8d;
    font-size: 1rem;
}

.browse-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.browse-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.file-info {
    text-align: center;
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* File Info Section */
.file-info-section {
    padding: 0 40px 40px;
}

.file-info-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.pdf-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-row .label {
    font-weight: 600;
    color: #495057;
}

.detail-row .value {
    color: #ff6b6b;
    font-weight: 600;
}

.file-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Split Options Section */
.split-options-section {
    padding: 0 40px 40px;
}

.split-options-section h2 {
    margin-bottom: 30px;
    color: #2c3e50;
}

.options-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.split-mode-selector h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mode-option {
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mode-option input[type="radio"]:checked + .mode-card {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
}

.mode-card:hover {
    border-color: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.mode-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.mode-desc {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Range Options */
.range-options,
.interval-options,
.output-options {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.range-options h3,
.interval-options h3,
.output-options h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.range-input-container {
    margin-bottom: 15px;
}

.range-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.range-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-input-group label {
    min-width: 70px;
    font-weight: 600;
    color: #495057;
}

.range-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.range-input:focus {
    outline: none;
    border-color: #ff6b6b;
}

.remove-range {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.remove-range:hover {
    background: #c82333;
}

.range-help {
    color: #6c757d;
    font-size: 0.9rem;
}

.interval-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.interval-controls label {
    font-weight: 600;
    color: #495057;
}

.interval-controls input[type="number"] {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    width: 100px;
    transition: border-color 0.2s ease;
}

.interval-controls input[type="number"]:focus {
    outline: none;
    border-color: #ff6b6b;
}

.output-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.output-controls label {
    font-weight: 600;
    color: #495057;
}

.output-controls input[type="text"] {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.output-controls input[type="text"]:focus {
    outline: none;
    border-color: #ff6b6b;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff6b6b;
}

.split-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Page Preview Section */
.page-preview-section {
    padding: 40px;
    background: #f8f9fa;
}

.page-preview-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.page-navigation,
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.nav-btn:hover {
    background: #ee5a24;
}

.nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.page-info,
.zoom-info {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 10px;
}

.preview-container {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: auto;
    max-height: 600px;
}

#previewCanvas {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Processing Section */
.processing-section {
    padding: 60px 40px;
    background: #f8f9fa;
    text-align: center;
}

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

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e9ecef;
    border-top: 6px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#processingTitle {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

#processingDescription {
    color: #7f8c8d;
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ee5a24);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    color: #ff6b6b;
}

/* Results Section */
.results-section {
    padding: 40px;
    background: #f8f9fa;
}

.results-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.results-content h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #27ae60;
}

.split-summary {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.summary-item .label {
    font-weight: 600;
    color: #2c3e50;
}

.summary-item .value {
    color: #ff6b6b;
    font-weight: 600;
}

.download-section {
    margin-bottom: 30px;
}

.download-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.download-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.file-list-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.split-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.split-file-item:last-child {
    border-bottom: none;
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.file-item-details {
    font-size: 0.9rem;
    color: #6c757d;
}

.file-download-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.file-download-btn:hover {
    background: #ee5a24;
}

.download-all-individual-btn {
    width: 100%;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-all-individual-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.additional-actions {
    display: flex;
    justify-content: center;
}

/* Error Section */
.error-section {
    padding: 60px 40px;
    background: #f8f9fa;
    text-align: center;
}

.error-content {
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #e74c3c;
}

.error-content p {
    color: #7f8c8d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.download-icon {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-section,
    .file-info-section,
    .split-options-section,
    .page-preview-section,
    .processing-section,
    .results-section,
    .error-section {
        padding: 30px 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .mode-options {
        grid-template-columns: 1fr;
    }
    
    .file-actions,
    .split-controls,
    .download-options,
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .preview-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .page-navigation,
    .zoom-controls {
        justify-content: center;
    }
    
    .range-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .range-input-group label {
        min-width: auto;
    }
    
    .interval-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .interval-controls input[type="number"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-text h3 {
        font-size: 1.2rem;
    }
    
    .mode-icon {
        font-size: 2rem;
    }
    
    .mode-title {
        font-size: 1.1rem;
    }
    
    .mode-desc {
        font-size: 0.85rem;
    }
}
