/* Custom CSS for PDF Viewer */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 600;
}

.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.pdf-viewer {
    min-height: 600px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    overflow: auto;
    position: relative;
}

.pdf-dual-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
    min-height: 600px;
}

.pdf-single-page-wrapper {
    text-align: center;
    padding: 20px;
    min-height: 600px;
}

.pdf-page-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-page-container.left-page,
.pdf-page-container.right-page {
    flex: 1;
    max-width: 45%;
}

.pdf-page-container.single-page {
    max-width: 90%;
    margin: 0 auto;
}

.pdf-canvas {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 10px auto 0;
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
}

.left-canvas {
    border-right: 2px solid #0d6efd;
}

.right-canvas {
    border-left: 2px solid #0d6efd;
}

.single-canvas {
    border: 2px solid #0d6efd;
}

.page-number-label {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.pdf-item {
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.8);
}

.pdf-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(5px);
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.upload-area:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

.upload-area.drag-over {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    transform: scale(1.02);
}

.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-dual-page-wrapper {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .pdf-page-container.left-page,
    .pdf-page-container.right-page {
        max-width: 100%;
        flex: none;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .pdf-viewer {
        min-height: 400px;
    }
    
    #pdfControls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    #pdfControls .btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .page-number-label {
        font-size: 10px;
        padding: 2px 8px;
    }
}

/* PDF.js custom styling */
.pdf-page-wrapper {
    margin: 20px auto;
    text-align: center;
}

.pdf-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    flex-direction: column;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alert styling */
.alert {
    border-radius: 12px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1edff 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
}