/* =========================================================================
   Quote Request Parser - Test UI Styles
   ========================================================================= */

:root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-hover: #334155;
    --color-border: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #06b6d4;

    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --transition: 150ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.875rem;
    transition: border-color var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group input::placeholder {
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

.btn-icon:hover {
    color: var(--color-text);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Jobs List */
.job-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: background var(--transition);
}

.job-item:hover {
    background: var(--color-surface-hover);
    cursor: pointer;
}

.job-info {
    flex: 1;
}

.job-filename {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.job-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.job-progress {
    width: 200px;
}

.progress-bar {
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-info));
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.progress-bar.animated .progress-fill {
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--color-primary);
    }

    50% {
        box-shadow: 0 0 15px var(--color-primary), 0 0 25px var(--color-info);
    }
}

.progress-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: right;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    text-transform: uppercase;
}

.status-queued {
    background: var(--color-border);
    color: var(--color-text);
}

.status-processing {
    background: var(--color-info);
    color: white;
}

.status-success {
    background: var(--color-success);
    color: white;
}

.status-error {
    color: white;
}

/* Confidence Badges */
.confidence-high {
    color: var(--color-success);
}

.confidence-medium {
    color: var(--color-warning);
}

.confidence-low {
    color: var(--color-error);
}

/* Part Number Verification */
.partnumber-verified {
    color: var(--color-success);
    font-weight: 500;
}

.partnumber-unverified {
    color: var(--color-error);
    font-weight: 500;
}

/* Token Usage Display */
.token-usage {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.token-stat {
    display: flex;
    gap: 0.25rem;
}

.token-stat-value {
    color: var(--color-text);
    font-weight: 500;
}

/* Header/Customer Info */
.header-info {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--color-primary);
}

.header-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.header-item {
    font-size: 0.875rem;
}

.header-item .label,
.header-notes .label {
    color: var(--color-text-muted);
    margin-right: 0.25rem;
}

.header-notes {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text);
}

/* Price Source Coloring */
.price-won {
    color: var(--color-success);
    font-weight: 600;
}

.price-pend {
    color: var(--color-warning);
    font-weight: 500;
}

.price-other {
    color: var(--color-text-muted);
}

/* Badge */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:hover td {
    background: var(--color-surface-hover);
}

td.quotable-false {
    opacity: 0.5;
}

/* Toast Notifications */
#toastContainer {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--color-surface);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--color-success);
}

.toast.error {
    border-left-color: var(--color-error);
}

.toast.warning {
    border-left-color: var(--color-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =========================================================================
   Batch Upload Styles
   ========================================================================= */

.batch-upload-section .subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Dropzone */
.dropzone {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--color-bg);
}

.dropzone:hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.05);
}

.dropzone.dragover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

.dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-text {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.dropzone-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Selected Files List */
.selected-files {
    margin-top: 1rem;
}

.file-list {
    list-style: none;
    padding: 0;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg);
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.file-name {
    color: var(--color-text);
}

.file-size {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Batch Progress */
.batch-progress {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.batch-progress h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.batch-id {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: monospace;
}

.progress-bar-container {
    height: 12px;
    background: var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-container .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 6px;
    transition: width 0.5s ease-out;
    margin-bottom: 0;
}

#batchProgressText {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .job-item {
        flex-direction: column;
        align-items: stretch;
    }

    .job-progress {
        width: 100%;
    }

    .results-actions {
        flex-wrap: wrap;
    }

    .dropzone {
        padding: 1.5rem;
    }
}