/* Split PDF Specific Styles */

.file-info-section {
    margin: 2rem 0;
}

.page-selection-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.page-selection-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.selection-methods {
    margin-bottom: 2rem;
}

.method-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.method-tab {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.method-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.method-tab:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.selection-method {
    display: none;
}

.selection-method.active {
    display: block;
}

.method-description {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.page-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.page-thumbnail {
    aspect-ratio: 3/4;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-thumbnail.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.page-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-thumbnail.selected::after {
    opacity: 0.2;
}

.page-thumbnail canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-number {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-base);
    font-size: 0.8rem;
    font-weight: 600;
}

.page-thumbnail.selected .page-number {
    background: var(--primary-color);
}

.page-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.page-thumbnail:hover .page-check,
.page-thumbnail.selected .page-check {
    opacity: 1;
}

.page-thumbnail.selected .page-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.selection-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.input-help {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

.selected-info {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

/* Loading thumbnails */
.thumbnail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.thumbnail-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Range validation */
.input-group input.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.input-error.show {
    display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
        max-height: 300px;
    }
    
    .method-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .method-tab {
        text-align: center;
    }
    
    .selection-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .selection-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        padding: 0.75rem;
    }
    
    .page-selection-section {
        padding: 1.5rem;
    }
}
