.documentupload {
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #0088CC;
    background-color: #f8f9fa;
}

.upload-content {
    color: #666;
}

.upload-text {
    margin-top: 15px;
    font-size: 0.9em;
}

.upload-formats {
    color: #999;
    font-size: 0.85em;
}

.hidden-upload {
    display: none;
}

.file-preview {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-file {
    margin-left: auto;
    color: #999;
    border: none;
    background: none;
    cursor: pointer;
}

.remove-file:hover {
    color: #dc3545;
}

.processing-status {
    margin: 15px 0;
}

.progress-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

.progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #0088CC;
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.result-summary {
    margin: 15px 0;
    padding: 15px;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
    color: #3c763d;
}

.scaninfo {
    margin-top: 15px;
    padding-left: 20px;
}

.scaninfo li {
    margin-bottom: 8px;
    position: relative;
}

.scaninfo li:before {
    content: "•";
    position: absolute;
    left: -15px;
    color: #0088CC;
}

.processing-button {
    position: relative;
    pointer-events: none;
}

.processing-button .fas.fa-spinner {
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

.viewer-dialog {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    background: #fff;
    z-index: 1050;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    display: none;
}

.viewer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.viewer-header {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-content {
    flex: 1;
    position: relative;
}

.viewer-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.viewer-footer {
    padding: 10px 15px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-selector input {
    width: 150px;
}

.file-preview {
    margin: 1em 0;
    padding: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.file-info i {
    font-size: 1.2em;
}

.remove-file {
    margin-left: auto;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
}

.remove-file:hover {
    color: #bd2130;
}

.stat-box {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #444;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.progress-bar {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 3px;
    margin-top: 10px;
}

.progress-fill {
    background-color: #007bff;
    height: 20px;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* MODIFIED: Updated select2 styles for better dropdown behavior */
.scandoc-modern .select2-container .select2-selection--single {
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    height: 38px !important; /* ADDED: Fixed height */
    line-height: 36px !important; /* ADDED: Proper line height */
}

.scandoc-modern .select2-container .select2-selection__rendered {
    cursor: pointer !important;
    padding-left: 12px !important; /* ADDED: Left padding */
    padding-right: 20px !important; /* ADDED: Right padding for arrow */
    padding-top: 6px !important; /* ADDED: Top padding */
    padding-bottom: 6px !important; /* ADDED: Bottom padding - fixes your issue */
    line-height: 24px !important; /* ADDED: Proper line height for text */
}

/* ADDED: Fix for placeholder styling */
.scandoc-modern .select2-container .select2-selection__placeholder {
    color: #9ca3af !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 24px !important;
}

/* MODIFIED: Removed problematic placeholder rule */
.scandoc-modern .select2-container--default .select2-selection--single:focus {
    border-color: #4299e1 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2) !important; /* ADDED: Focus ring */
}

/* MODIFIED: Better arrow positioning */
.scandoc-modern .select2-container .select2-selection__arrow {
    display: block !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important; /* ADDED: Better centering */
    height: 20px !important; /* ADDED: Fixed height */
    width: 20px !important; /* ADDED: Fixed width */
}

.scandoc-modern .select2-container .select2-selection__arrow b {
    border-color: #4a5568 transparent transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 4px 0 4px !important;
    height: 0 !important;
    left: 50% !important;
    margin-left: -4px !important;
    margin-top: -2px !important;
    position: absolute !important;
    top: 50% !important;
    width: 0 !important;
}

/* ADDED: Dropdown container styles */
.scandoc-modern .select2-dropdown {
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* ADDED: Option styles */
.scandoc-modern .select2-results__option {
    padding: 8px 12px !important;
    line-height: 1.5 !important;
}

.scandoc-modern .select2-results__option--highlighted {
    background-color: #4299e1 !important;
    color: white !important;
}

/* ADDED: Ensure dropdown closes properly */
.scandoc-modern .select2-container--open .select2-dropdown {
    z-index: 9999 !important;
}

/* MODIFIED: Remove problematic ajax loader rules */
.scandoc-modern .select2-container .select2-selection__clear {
    cursor: pointer !important;
    float: right !important;
    font-weight: bold !important;
    margin-right: 10px !important;
}

/* ADDED: Hide loading indicator that might cause issues */
.scandoc-modern .select2-selection__choice__remove,
.scandoc-modern .select2-search__field {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* ADDED: Prevent text selection issues */
.scandoc-modern .select2-container {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.text-success { 
    color: #28a745 !important; 
}

.text-danger { 
    color: #dc3545 !important; 
}

.text-warning { 
    color: #ffc107 !important; 
}