/* upload.css - Styles for the document upload page */

* {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
	background: #f0f2f5;
	min-height: 100vh;
}

/* Navbar */
.navbar-custom {
	background: white;
	box-shadow: 0 2px 10px rgba(0,0,0,0.08);
	padding: 12px 0;
}

.navbar-brand-custom {
	font-weight: 700;
	font-size: 1.4rem;
	color: #6366f1 !important;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Hero Header */
.hero-header {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
	padding: 40px 20px;
	color: white;
	text-align: center;
	margin-bottom: 30px;
}

.hero-header h1 {
	font-size: 1.8rem;
	font-weight: 700;
	margin-bottom: 8px;
}

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

/* Cards */
.card-modern {
	background: white;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
	border: none;
	overflow: hidden;
}

.card-body-modern {
	padding: 24px;
}

/* Form Elements */
.form-label-modern {
	font-weight: 600;
	color: #374151;
	margin-bottom: 8px;
	font-size: 0.95rem;
}

.form-control-modern {
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 1rem;
	transition: all 0.2s ease;
}

.form-control-modern:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Upload Zone */
.upload-zone-modern {
	border: 2px dashed #d1d5db;
	border-radius: 16px;
	padding: 40px 20px;
	text-align: center;
	background: #fafafa;
	cursor: pointer;
	transition: all 0.3s ease;
}

.upload-zone-modern:hover,
.upload-zone-modern.dragover {
	border-color: #6366f1;
	background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

.upload-icon i {
	font-size: 28px;
	color: white;
}

.upload-zone-modern h5 {
	font-weight: 600;
	color: #374151;
	margin-bottom: 4px;
}

.upload-zone-modern p {
	color: #6b7280;
	margin-bottom: 0;
	font-size: 0.9rem;
}

/* File List (multi-file) */
.file-list {
	margin-top: 12px;
}

.file-list-item {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 8px;
}

.file-list-item .file-item-icon {
	width: 36px;
	height: 36px;
	background: #ef4444;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.file-list-item .file-item-icon i {
	color: white;
	font-size: 18px;
}

.file-list-item .file-item-details {
	flex: 1;
	min-width: 0;
}

.file-list-item .file-item-name {
	font-weight: 600;
	color: #374151;
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.file-list-item .file-item-size {
	font-size: 0.78rem;
	color: #6b7280;
}

/* Submit Button */
.btn-submit {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	border: none;
	padding: 16px 32px;
	font-weight: 600;
	font-size: 1rem;
	border-radius: 12px;
	color: white;
	width: 100%;
	transition: all 0.3s ease;
}

.btn-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
	color: white;
}

.btn-submit:disabled {
	opacity: 0.7;
	transform: none;
	box-shadow: none;
}

/* Jobs Panel */
.jobs-panel {
	background: white;
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
	margin-bottom: 20px;
}

.jobs-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e5e7eb;
}

.jobs-header h6 {
	font-weight: 600;
	color: #374151;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.job-card {
	background: #f9fafb;
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}

.job-card:hover {
	background: #f3f4f6;
	border-color: #e5e7eb;
}

.job-card:last-child {
	margin-bottom: 0;
}

.job-filename {
	font-weight: 500;
	color: #374151;
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 4px;
}

.job-date {
	font-size: 0.8rem;
	color: #9ca3af;
}

.status-pill {
	font-size: 0.7rem;
	padding: 4px 10px;
	border-radius: 20px;
	font-weight: 600;
}

/* Steps */
.steps-panel {
	background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
	border-radius: 16px;
	padding: 20px;
	border: 1px solid #e9d5ff;
}

.steps-title {
	font-weight: 600;
	color: #6b21a8;
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.step {
	display: flex;
	gap: 14px;
	margin-bottom: 14px;
}

.step:last-child {
	margin-bottom: 0;
}

.step-number {
	width: 32px;
	height: 32px;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85rem;
	flex-shrink: 0;
}

.step-content strong {
	color: #374151;
	font-size: 0.9rem;
}

.step-content p {
	color: #6b7280;
	font-size: 0.8rem;
	margin: 0;
}

/* Active job status cards */
.active-job-card {
	background: white;
	border-radius: 16px;
	padding: 16px 20px;
	margin-bottom: 12px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
	display: flex;
	align-items: center;
	gap: 14px;
	border-left: 4px solid #6366f1;
	animation: fadeInUp 0.3s ease;
}

.active-job-card.done {
	border-left-color: #10b981;
}

.active-job-card.error {
	border-left-color: #ef4444;
}

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

.active-job-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #e5e7eb;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	flex-shrink: 0;
}

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

.active-job-info {
	flex: 1;
	min-width: 0;
}

.active-job-filename {
	font-weight: 600;
	font-size: 0.9rem;
	color: #374151;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.active-job-status {
	font-size: 0.8rem;
	color: #6b7280;
}

/* Results */
.result-card {
	background: white;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
	margin-bottom: 16px;
	overflow: hidden;
}

.result-header {
	padding: 16px 20px;
	font-weight: 600;
	color: white;
	display: flex;
	align-items: center;
	gap: 10px;
}

.result-body {
	padding: 20px;
}

.stat-card {
	background: #f9fafb;
	border-radius: 12px;
	padding: 20px;
	text-align: center;
}

.stat-value {
	font-size: 2rem;
	font-weight: 700;
	color: #374151;
}

.stat-label {
	font-size: 0.85rem;
	color: #6b7280;
}

.tag {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 500;
	margin: 4px;
}

.code-preview {
	background: #1f2937;
	color: #d1d5db;
	padding: 16px;
	border-radius: 12px;
	font-family: 'Fira Code', monospace;
	font-size: 0.85rem;
	max-height: 400px;
	overflow-y: auto;
	white-space: pre-wrap;
}

/* JSON view section */
.json-section {
	position: relative;
}

.json-section .btn-copy-json {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
}

/* Timing panel */
.timing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}

.timing-item {
	background: #f0fdf4;
	border-radius: 12px;
	padding: 14px;
	text-align: center;
}

.timing-value {
	font-size: 1.3rem;
	font-weight: 700;
	color: #059669;
}

.timing-label {
	font-size: 0.78rem;
	color: #6b7280;
	margin-top: 2px;
}

/* Accordion overrides for result cards */
.result-accordion .accordion-item {
	border: none;
	background: transparent;
	margin-bottom: 0;
}

.result-accordion .accordion-button {
	background: transparent;
	padding: 14px 20px;
	font-weight: 600;
	font-size: 0.95rem;
	color: #374151;
	box-shadow: none;
	border-bottom: 1px solid #f3f4f6;
}

.result-accordion .accordion-button:not(.collapsed) {
	background: #f9fafb;
	color: #6366f1;
}

.result-accordion .accordion-button::after {
	width: 1rem;
	height: 1rem;
	background-size: 1rem;
}

.result-accordion .accordion-body {
	padding: 16px 20px;
}

.result-accordion .accordion-button .entity-count {
	background: #6366f1;
	color: white;
	font-size: 0.7rem;
	padding: 2px 8px;
	border-radius: 10px;
	margin-left: 8px;
	font-weight: 700;
}

/* Modal */
.modal-modern .modal-content {
	border-radius: 16px;
	border: none;
}

.modal-modern .modal-header {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: white;
	border-radius: 16px 16px 0 0;
	border: none;
}

.modal-modern .btn-close {
	filter: brightness(0) invert(1);
}

/* Toast styling */
.toast-custom {
	border: none;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
	.hero-header {
		padding: 30px 16px;
	}

	.hero-header h1 {
		font-size: 1.5rem;
	}

	.card-body-modern {
		padding: 20px;
	}

	.upload-zone-modern {
		padding: 30px 16px;
	}

	.stat-value {
		font-size: 1.5rem;
	}

	.steps-panel {
		margin-top: 20px;
	}
}
