/* PO Processor Styles - Compact Layout with Multiple File Support */

* {
    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;
    color: #333;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

.main-content {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    flex: 1;
}

.client-selector-container {
    position: relative;
}

.client-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.client-select:focus {
    outline: none;
    border-color: #667eea;
}

.client-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-section {
    margin-bottom: 20px;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
}

/* Store Selector Styles */
.store-selector-container {
    position: relative;
}

#store-search {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#store-search:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.store-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.store-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.store-option:hover,
.store-option.highlighted {
    background-color: #e3f2fd;
    transform: translateX(2px);
}

.store-option.no-results,
.store-option.loading-stores {
    color: #666;
    font-style: italic;
    cursor: default;
}

.store-option.no-results:hover,
.store-option.loading-stores:hover {
    background-color: transparent;
    transform: none;
}

/* File Upload Styles - Updated for Multiple Files */
.file-upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.file-upload-area:hover {
    border-color: #2980b9;
    background: #e3f2fd;
    transform: translateY(-1px);
}

.file-upload-area.drag-over {
    border-color: #27ae60;
    background: #e8f5e8;
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.file-upload-subtext {
    font-size: 0.85rem;
    color: #7f8c8d;
}

#file-input {
    display: none;
}

.file-info {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 500;
}

/* Selected Files Styles - New */
.selected-files {
    margin-top: 12px;
}

.selected-files-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.selected-files-list {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: white;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #e9ecef;
}

.selected-file-item:last-child {
    margin-bottom: 0;
}

.file-name {
    flex: 1;
    font-size: 0.85rem;
    color: #2c3e50;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.75rem;
    color: #6c757d;
    margin-right: 8px;
}

.remove-file-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-file-btn:hover {
    background: #c0392b;
}

.return-to-group {
    margin-bottom: 15px;
}

.return-to-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
}

.return-to-input {
    width: 200px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.return-to-input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

.checkbox-item label {
    font-size: 0.9rem;
    color: #2c3e50;
    cursor: pointer;
    margin: 0;
}

/* Process Button */
.process-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.process-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.process-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress Styles */
.progress-container {
    display: none;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Result Styles */
.result-container {
    display: none;
}

.success-message,
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.success-message {
    background: #d5f4e6;
    border: 1px solid #27ae60;
    color: #1e8449;
}

.error-message {
    background: #fadbd8;
    border: 1px solid #e74c3c;
    color: #c0392b;
}

.success-icon,
.error-icon {
    font-size: 1.2rem;
}

.success-text,
.error-text {
    flex: 1;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 15px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .selected-files-list {
        max-height: 120px;
    }
    
    .file-name {
        font-size: 0.8rem;
    }
}

/* Custom Scrollbar */
.store-dropdown::-webkit-scrollbar,
.selected-files-list::-webkit-scrollbar {
    width: 6px;
}

.store-dropdown::-webkit-scrollbar-track,
.selected-files-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.store-dropdown::-webkit-scrollbar-thumb,
.selected-files-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.store-dropdown::-webkit-scrollbar-thumb:hover,
.selected-files-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Vendor Management Styles */
.vendor-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.vendor-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.vendor-name {
    font-weight: 500;
    color: #007bff;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 4px;
    border: 1px solid #bbdefb;
}

.vendor-actions {
    display: flex;
    gap: 8px;
}

.vendor-button {
    padding: 6px 12px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.vendor-button:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

/* Vendor Resolution Form */
.vendor-resolution-form .form-group {
    margin-bottom: 16px;
}

.vendor-resolution-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.vendor-resolution-form input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
}

/* Vendor Management Tabs */
.vendor-management-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    font-weight: 500;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-button:hover {
    color: #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Vendor Lists */
.vendor-list {
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

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

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

.vendor-item-text {
    font-size: 14px;
    color: #495057;
}

.vendor-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
}

.vendor-item-remove:hover {
    background: #c82333;
}

/* Add Vendor Forms */
.add-vendor-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-vendor-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn-primary {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #545b62;
}

/* New Vendor Resolution Modal Styles */
.vendor-resolution-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.vendor-resolution-item:last-child {
    margin-bottom: 0;
}

.vendor-resolution-item .vendor-info {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.vendor-resolution-item .vendor-info strong {
    color: #495057;
}

.vendor-resolution-item .vendor-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vendor-resolution-item .vendor-input label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.vendor-resolution-item .vendor-input input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.vendor-resolution-item .vendor-input input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#unknown-vendors-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Reset Processor Button Styles */
.reset-container {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.reset-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.reset-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.reset-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}