/**
 * Submission Log Timeline Styles
 * Modern timeline view for submission event tracking
 */

/* Container */
.submission-log-container {
	padding: 20px;
	background: #fff;
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* Header */
.log-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #e9ecef;
}

.log-title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: #212529;
}

.log-controls {
	display: flex;
	align-items: center;
	gap: 15px;
}

/* Status Indicator */
.log-status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #6c757d;
}

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #6c757d;
	transition: background-color 0.3s;
}

.log-status.live .status-dot {
	background-color: #28a745;
	animation: pulse 2s infinite;
}

.log-status.error .status-dot {
	background-color: #dc3545;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

/* Timeline Wrapper */
.timeline-wrapper {
	flex: 1;
	overflow-y: auto;
	padding-right: 10px;
}

.timeline-empty {
	text-align: center;
	padding: 40px;
	color: #6c757d;
}

.timeline-empty p {
	margin: 0;
	font-size: 14px;
}

/* Timeline Events */
.timeline {
	position: relative;
	padding-left: 40px;
}

.timeline::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #dee2e6;
}

.timeline-event {
	position: relative;
	margin-bottom: 25px;
	padding-bottom: 10px;
}

.timeline-event:last-child {
	margin-bottom: 0;
}

/* Event Marker (Dot) */
.timeline-event::before {
	content: '';
	position: absolute;
	left: -32px;
	top: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 3px solid #fff;
	background-color: #6c757d;
	box-shadow: 0 0 0 2px #dee2e6;
	z-index: 1;
}

/* Status Colors */
.timeline-event.status-success::before {
	background-color: #28a745;
	box-shadow: 0 0 0 2px #28a745;
}

.timeline-event.status-error::before {
	background-color: #dc3545;
	box-shadow: 0 0 0 2px #dc3545;
}

.timeline-event.status-processing::before {
	background-color: #007bff;
	box-shadow: 0 0 0 2px #007bff;
	animation: pulse 2s infinite;
}

.timeline-event.status-pending::before {
	background-color: #ffc107;
	box-shadow: 0 0 0 2px #ffc107;
}

.timeline-event.status-skipped::before {
	background-color: #6c757d;
	box-shadow: 0 0 0 2px #6c757d;
}

/* Event Card */
.event-card {
	background: #f8f9fa;
	border-left: 4px solid #dee2e6;
	border-radius: 6px;
	padding: 12px 15px;
	transition: all 0.2s;
}

.event-card:hover {
	background: #e9ecef;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-success .event-card {
	border-left-color: #28a745;
	background: #f8fff9;
}

.status-error .event-card {
	border-left-color: #dc3545;
	background: #fff5f5;
}

.status-processing .event-card {
	border-left-color: #007bff;
	background: #f5f9ff;
}

.status-pending .event-card {
	border-left-color: #ffc107;
	background: #fffdf5;
}

.status-skipped .event-card {
	border-left-color: #6c757d;
	background: #f8f9fa;
}

/* Event Header */
.event-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 8px;
}

.event-stage {
	font-weight: 600;
	font-size: 14px;
	color: #212529;
	text-transform: capitalize;
}

.event-timestamp {
	font-size: 12px;
	color: #6c757d;
	white-space: nowrap;
}

/* Event Message */
.event-message {
	font-size: 13px;
	color: #495057;
	line-height: 1.5;
	margin-bottom: 8px;
}

/* Event Meta */
.event-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.event-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.status-success .event-status-badge {
	background-color: #d4edda;
	color: #155724;
}

.status-error .event-status-badge {
	background-color: #f8d7da;
	color: #721c24;
}

.status-processing .event-status-badge {
	background-color: #d1ecf1;
	color: #0c5460;
}

.status-pending .event-status-badge {
	background-color: #fff3cd;
	color: #856404;
}

.status-skipped .event-status-badge {
	background-color: #e2e3e5;
	color: #383d41;
}

.event-attempt {
	font-size: 11px;
	color: #6c757d;
}

.event-level {
	font-size: 11px;
	color: #6c757d;
	font-family: monospace;
	background: #fff;
	padding: 2px 6px;
	border-radius: 3px;
}

/* Event Data (expandable) */
.event-data {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #dee2e6;
}

.event-data-toggle {
	background: none;
	border: none;
	color: #007bff;
	font-size: 12px;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.event-data-toggle:hover {
	color: #0056b3;
}

.event-data-content {
	margin-top: 8px;
	background: #fff;
	padding: 10px;
	border-radius: 4px;
	font-size: 12px;
	font-family: monospace;
	color: #212529;
	max-height: 200px;
	overflow-y: auto;
}

.event-data-content pre {
	margin: 0;
	white-space: pre-wrap;
	word-wrap: break-word;
}

/* Legacy Events */
.timeline-event.legacy .event-card {
	opacity: 0.8;
}

.timeline-event.legacy .event-stage::after {
	content: ' (legacy)';
	font-size: 11px;
	color: #6c757d;
	font-weight: normal;
}

/* Loading State */
.timeline-loading {
	text-align: center;
	padding: 20px;
	color: #6c757d;
}

.timeline-loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #dee2e6;
	border-top-color: #007bff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-left: 10px;
	vertical-align: middle;
}

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

/* Scrollbar Styling */
.timeline-wrapper::-webkit-scrollbar {
	width: 8px;
}

.timeline-wrapper::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.timeline-wrapper::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 4px;
}

.timeline-wrapper::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Responsive */
@media (max-width: 768px) {
	.submission-log-container {
		padding: 15px;
	}

	.log-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.timeline {
		padding-left: 30px;
	}

	.timeline::before {
		left: 10px;
	}

	.timeline-event::before {
		left: -22px;
	}
}
