/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Status Message */
.status-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1000;
    min-width: 300px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.status-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.status-message.success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.status-message.warning {
    background: rgba(245, 158, 11, 0.95);
    color: white;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.status-message.info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Upload Area - Match Original Design */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 16px;
    padding: 32px 24px;
    margin: 20px 0;
    background: linear-gradient(135deg, #fafbfc, #f1f5f9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over,
.upload-area.dragover {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    transform: scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.25), 0 10px 10px -5px rgba(99, 102, 241, 0.1);
}

.upload-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.upload-icon {
    font-size: 3.5rem;
    color: #6366f1;
    margin-bottom: 16px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-text {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-subtext {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.upload-hint {
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* Confidence Indicators */
.confidence-display {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.confidence-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 120px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.confidence-card.high {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
}

.confidence-card.medium {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(217, 119, 6, 0.05));
}

.confidence-card.low {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05));
}

.confidence-score {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.confidence-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* AI Badges */
.ai-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* File Queue */
.file-queue {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.queue-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.queue-count {
    background: #6366f1;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.queue-item:last-child {
    margin-bottom: 0;
}

.queue-item:hover {
    background: #f1f5f9;
}

.queue-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.queue-item-icon {
    font-size: 1.2rem;
}

.queue-item-name {
    font-weight: 500;
    color: #1e293b;
}

.queue-item-size {
    color: #64748b;
    font-size: 0.875rem;
}

.queue-item-actions {
    display: flex;
    gap: 8px;
}

.queue-item-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.queue-item-btn.remove {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.queue-item-btn.remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Batch Actions */
.batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Invoice Cards */
.invoice-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.invoice-card.success {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02), rgba(255, 255, 255, 1));
}

.invoice-card.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.02), rgba(255, 255, 255, 1));
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.invoice-icon {
    font-size: 2rem;
    margin-right: 16px;
}

.invoice-info {
    flex: 1;
}

.invoice-filename {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.supplier-name {
    color: #059669;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.invoice-details {
    color: #64748b;
    font-size: 0.9rem;
}

.invoice-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.invoice-status.ready {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.invoice-status.edited {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.invoice-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.invoice-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

/* File Info Display */
.file-info {
    display: none;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #10b981;
    border-radius: 20px;
    padding: 28px;
    margin: 32px 0;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-info-icon {
    font-size: 2.5rem;
    color: #10b981;
}

.file-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.file-details {
    color: #059669;
    font-size: 1rem;
    font-weight: 500;
}

/* Simple Requirements */
.simple-requirements {
    margin-bottom: 20px;
}

.simple-requirements p {
    color: #64748b;
    text-align: center;
    font-size: 1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .simple-requirements p {
        flex-direction: column;
        gap: 8px;
    }
}

/* Loading Spinners */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid currentColor;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.loading-spinner-large {
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Processing Card */
.processing-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin: 32px 0;
    animation: pulse 2s infinite;
}

.processing-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.processing-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.processing-subtext {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 24px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 15px 35px rgba(99, 102, 241, 0.15);
    }
}

/* Batch Summary */
.batch-summary-page {
    animation: fadeIn 0.4s ease-out;
}

.batch-header {
    text-align: center;
    margin-bottom: 32px;
}

.batch-header h1 {
    color: #0f172a;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.batch-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
}

.batch-stats {
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card.success {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(255, 255, 255, 1));
}

.stat-card.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(255, 255, 255, 1));
}

.stat-card.info {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(255, 255, 255, 1));
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-label {
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invoices-section {
    margin: 32px 0;
}

.invoices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.invoices-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success Page */
.batch-success-page {
    padding: 40px 20px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.success-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 60%, 75%, 90%, 100% {
        transform: translateY(0);
    }
    15%, 45% {
        transform: translateY(-20px);
    }
    30% {
        transform: translateY(-10px);
    }
}

.success-title {
    color: #0f172a;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-subtitle {
    color: #64748b;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 40px;
}

.success-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.success-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.success-card.success {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(255, 255, 255, 1));
}

.success-card.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(255, 255, 255, 1));
}

.success-card.info {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(255, 255, 255, 1));
}

.success-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.success-card-content h3 {
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.success-card-content p {
    color: #64748b;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 40px;
}

/* Submission Results */
.submission-results {
    margin: 40px 0;
    text-align: left;
}

.submission-results h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.results-list {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item.success {
    border-color: #10b981;
}

.result-item.error {
    border-color: #ef4444;
}

.result-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.result-message {
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .batch-success-page {
        padding: 20px 16px;
    }
    
    .success-content {
        padding: 24px;
    }
    
    .success-title {
        font-size: 2rem;
    }
    
    .success-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .success-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Credit Memo Badge */
.credit-memo-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}