/**
 * Company History Timeline Styles
 * Phase 2: Change Timeline & History Tracking
 */

/* Timeline Container */
.business-history {
	margin-top: 2rem;
}

.timeline {
	position: relative;
	padding-left: 2rem;
	margin: 1.5rem 0;
}

.timeline::before {
	content: '';
	position: absolute;
	left: 0.75rem;
	top: 0;
	bottom: 0;
	width: 2px;
	background: linear-gradient(180deg, #3b82f6 0%, #e5e7eb 100%);
}

/* Timeline Item */
.timeline-item {
	position: relative;
	padding-bottom: 1.5rem;
	display: flex;
	gap: 1rem;
}

.timeline-item:last-child {
	padding-bottom: 0;
}

/* Timeline Marker */
.timeline-marker {
	position: absolute;
	left: -2rem;
	width: 1.5rem;
	height: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 2px solid #3b82f6;
	border-radius: 50%;
	z-index: 1;
}

.timeline-icon {
	width: 0.875rem;
	height: 0.875rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.timeline-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
	color: #3b82f6;
}

/* Timeline Content */
.timeline-content {
	flex: 1;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	padding: 1rem;
	transition: box-shadow 0.2s ease;
}

.timeline-content:hover {
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.timeline-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.timeline-label {
	font-weight: 600;
	color: #1f2937;
	font-size: 0.9375rem;
}

.timeline-date {
	font-size: 0.8125rem;
	color: #6b7280;
}

.timeline-field {
	font-size: 0.875rem;
	color: #4b5563;
	margin-bottom: 0.5rem;
}

/* Changes Display */
.timeline-changes {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.timeline-old,
.timeline-new {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.875rem;
}

.change-label {
	font-weight: 500;
	color: #6b7280;
	min-width: 3rem;
	flex-shrink: 0;
}

.timeline-old .change-value {
	color: #dc2626;
	text-decoration: line-through;
	opacity: 0.8;
}

.timeline-new .change-value {
	color: #16a34a;
	font-weight: 500;
}

/* Change Type Icons Color Variations */
.timeline-item[data-type="status_change"] .timeline-marker {
	border-color: #8b5cf6;
}

.timeline-item[data-type="status_change"] .timeline-icon svg {
	color: #8b5cf6;
}

.timeline-item[data-type="address_change"] .timeline-marker {
	border-color: #f97316;
}

.timeline-item[data-type="address_change"] .timeline-icon svg {
	color: #f97316;
}

.timeline-item[data-type="name_change"] .timeline-marker {
	border-color: #06b6d4;
}

.timeline-item[data-type="name_change"] .timeline-icon svg {
	color: #06b6d4;
}

.timeline-item[data-type="capital_change"] .timeline-marker {
	border-color: #10b981;
}

.timeline-item[data-type="capital_change"] .timeline-icon svg {
	color: #10b981;
}

.timeline-item[data-type="representative_change"] .timeline-marker {
	border-color: #ec4899;
}

.timeline-item[data-type="representative_change"] .timeline-icon svg {
	color: #ec4899;
}

.timeline-item[data-type="industry_change"] .timeline-marker {
	border-color: #14b8a6;
}

.timeline-item[data-type="industry_change"] .timeline-icon svg {
	color: #14b8a6;
}

/* Load More Button */
.timeline-loadmore {
	margin-top: 1rem;
	text-align: center;
}

.timeline-loadmore .btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #3b82f6;
	background: transparent;
	border: 1px solid #3b82f6;
	border-radius: 0.375rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.timeline-loadmore .btn:hover {
	background: #3b82f6;
	color: #fff;
}

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

.timeline-loadmore .btn.loading::after {
	content: '';
	width: 1rem;
	height: 1rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

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

/* Empty State */
.timeline-empty {
	text-align: center;
	padding: 2rem;
	color: #6b7280;
}

.timeline-empty svg {
	width: 3rem;
	height: 3rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 640px) {
	.timeline {
		padding-left: 1.5rem;
	}

	.timeline::before {
		left: 0.5rem;
	}

	.timeline-marker {
		left: -1.5rem;
		width: 1.25rem;
		height: 1.25rem;
	}

	.timeline-icon {
		width: 0.75rem;
		height: 0.75rem;
	}

	.timeline-content {
		padding: 0.75rem;
	}

	.timeline-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.timeline-old,
	.timeline-new {
		flex-direction: column;
		gap: 0.25rem;
	}

	.change-label {
		min-width: auto;
	}
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.timeline::before {
		background: linear-gradient(180deg, #60a5fa 0%, #374151 100%);
	}

	.timeline-marker {
		background: #1f2937;
		border-color: #60a5fa;
	}

	.timeline-content {
		background: #1f2937;
		border-color: #374151;
	}

	.timeline-label {
		color: #f9fafb;
	}

	.timeline-date {
		color: #9ca3af;
	}

	.timeline-field {
		color: #d1d5db;
	}

	.change-label {
		color: #9ca3af;
	}

	.timeline-loadmore .btn {
		color: #60a5fa;
		border-color: #60a5fa;
	}

	.timeline-loadmore .btn:hover {
		background: #60a5fa;
		color: #1f2937;
	}
}

/* Print Styles */
@media print {
	.timeline::before {
		background: #000;
	}

	.timeline-marker {
		border-color: #000;
	}

	.timeline-content {
		border: 1px solid #000;
		box-shadow: none;
	}

	.timeline-loadmore {
		display: none;
	}
}
