/**
 * Duration Badge Styles
 * Styles for Discord duration role badges
 */

/* Base badge wrapper */
.duration-badge-wrapper {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	vertical-align: middle;
}

/* Badge image */
.duration-badge-image {
	display: block;
	border: 0;
	vertical-align: middle;
}

/* Badge text */
.duration-badge-text {
	font-size: 14px;
	font-weight: 500;
	color: #333;
	white-space: nowrap;
}

/* Size variations */
.duration-badge-small .duration-badge-image {
	width: 20px;
	height: 20px;
}

.duration-badge-small .duration-badge-text {
	font-size: 12px;
}

.duration-badge-medium .duration-badge-image {
	width: 32px;
	height: 32px;
}

.duration-badge-medium .duration-badge-text {
	font-size: 14px;
}

.duration-badge-large .duration-badge-image {
	width: 48px;
	height: 48px;
}

.duration-badge-large .duration-badge-text {
	font-size: 16px;
	font-weight: 600;
}

/* Text positioning */
.duration-badge-wrapper.text-left {
	flex-direction: row-reverse;
}

.duration-badge-wrapper.text-right {
	flex-direction: row;
}

.duration-badge-wrapper.text-bottom {
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.duration-badge-wrapper.text-bottom .badge-top,
.duration-badge-wrapper.text-bottom .badge-bottom {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Multiple badges container */
.duration-badges-container {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.duration-badges-horizontal {
	flex-direction: row;
	align-items: center;
}

.duration-badges-vertical {
	flex-direction: column;
	align-items: flex-start;
}

.duration-badges-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
	gap: 12px;
}

/* Badge item in containers */
.duration-badge-item {
	display: flex;
	align-items: center;
	transition: transform 0.2s ease;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
	.duration-badge-text {
		color: #e0e0e0;
	}
}

/* Mobile responsiveness */
@media (max-width: 768px) {
	.duration-badges-horizontal {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
	
	.duration-badges-grid {
		grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
		gap: 8px;
	}
	
	.duration-badge-wrapper {
		gap: 6px;
	}
	
	/* Adjust sizes for mobile */
	.duration-badge-large .duration-badge-image {
		width: 40px;
		height: 40px;
	}
	
	.duration-badge-medium .duration-badge-image {
		width: 28px;
		height: 28px;
	}
}

/* Integration with existing theme elements */
.post-meta .duration-badge-wrapper {
	margin-left: 8px;
}

.author-info .duration-badge-wrapper {
	margin-left: 12px;
}

.comment-author .duration-badge-wrapper {
	margin-left: 6px;
}

/* Trade tracker integration */
.trade-table .duration-badge-wrapper {
	margin-left: 8px;
}

.trade-table .duration-badge-small .duration-badge-image {
	width: 16px;
	height: 16px;
}

/* Content gallery integration */
.content-item .author-name .duration-badge-wrapper {
	margin-left: 6px;
}

/* Accessibility */
.duration-badge-image {
	border-radius: 2px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.duration-badge-wrapper:focus-within {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Tooltip styles for badge containers */
.duration-badge-item[title]:hover::after {
	content: attr(title);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	white-space: nowrap;
	z-index: 1000;
	margin-bottom: 5px;
}

.duration-badge-item[title]:hover::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #333;
	z-index: 1000;
}

.duration-badge-item[title] {
	position: relative;
}

/* ========================================
   DURATION TIMELINE STYLES
   ======================================== */

/* Timeline wrapper */
.duration-timeline-wrapper {
	position: relative;
	width: 100%;
	padding-bottom: 20px;
	box-sizing: border-box;
}

/* Timeline background track */
.timeline-background {
	position: relative;
	height: 8px;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
	top: 4.2em;
}

/* Timeline fill (progress) */
.timeline-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	border-radius: 4px;
	transition: width 1s ease-in-out;
	background: linear-gradient(130deg, #ffbf00 0%, #f58b00 100%);
}

/* Timeline items container */
.timeline-items {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	position: relative;
	margin-top: -32px;
}

/* Individual timeline item */
.timeline-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	flex: 1;
	max-width: 80px;
	transition: all 0.3s ease;
}

/* Timeline badge container */
.timeline-badge {
	position: relative;
	padding: 4px;
	transition: all 0.3s ease;
}

/* Timeline badge image */
.timeline-badge-image {
	display: block;
	border-radius: 50%;
	transition: all 0.3s ease;
}

/* Timeline labels */
.timeline-label {
	margin-top: 8px;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	transition: color 0.3s ease;
}

/* Achievement states */
.timeline-item.achieved .timeline-badge-image {
	opacity: 1;
}

.timeline-item.achieved .timeline-label {
	font-weight: 700;
}

.timeline-item.not-achieved .timeline-badge {
	border-color: #e0e0e0;
}

.timeline-item.not-achieved .timeline-badge-image {
	opacity: 0.4;
	filter: grayscale(100%) contrast(0.1);
}

.timeline-item.not-achieved .timeline-label {
	color: #999;
}

/* Current item highlighting */
.timeline-item.current .timeline-badge {
	box-shadow: 0 0 12px rgba(255,255,255,0.75);
	border-radius: 50%;
}

.timeline-item.current .timeline-label {
	font-weight: 700;
}

/* Dimmed items when showing current only */
.timeline-item.dimmed {
	opacity: 0.3;
}

.timeline-item.highlighted {
	opacity: 1;
}

/* Progress info */
.timeline-progress-info {
	text-align: center;
	margin-top: 20px;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 8px;
	border-left: 4px solid #4CAF50;
}

.timeline-progress-info .current-status {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: #4CAF50;
	margin-bottom: 5px;
}

.timeline-progress-info .next-milestone {
	display: block;
	font-size: 14px;
	color: #666;
}

.timeline-progress-info .max-tier {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: #FF5722;
}

.timeline-progress-info .no-progress {
	display: block;
	font-size: 14px;
	color: #999;
}

/* Size variations */
.timeline-small .timeline-badge-image {
	width: 32px;
	height: 32px;
}

.timeline-small .timeline-label {
	font-size: 10px;
}

.timeline-small .timeline-background {
	height: 6px;
	margin: 30px 0 15px 0;
}

.timeline-small .timeline-items {
	margin-top: -24px;
}

.timeline-medium .timeline-badge-image {
	width: 48px;
	height: 48px;
}

.timeline-medium .timeline-label {
	font-size: 12px;
}

.timeline-large .timeline-badge-image {
	width: 64px;
	height: 64px;
}

.timeline-large .timeline-label {
	font-size: 14px;
}

.timeline-large .timeline-background {
	height: 10px;
	margin: 50px 0 25px 0;
}

.timeline-large .timeline-items {
	margin-top: -40px;
}

/* Theme variations */
.timeline-theme-gradient .timeline-fill {
	background: linear-gradient(90deg, #E91E63 0%, #FF5722 25%, #FF9800 50%, #4CAF50 75%, #2196F3 100%);
}

.timeline-theme-gradient .timeline-item.achieved .timeline-badge {
	border-color: transparent;
	background: linear-gradient(45deg, #E91E63, #FF5722, #FF9800, #4CAF50);
	padding: 2px;
}

.timeline-theme-gradient .timeline-item.achieved .timeline-badge-image {
	border-radius: 50%;
	background: white;
	padding: 2px;
}

.timeline-theme-minimal .timeline-background {
	height: 2px;
	background-color: #f0f0f0;
}

.timeline-theme-minimal .timeline-badge {
	border-width: 2px;
	padding: 2px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.timeline-theme-minimal .timeline-progress-info {
	background: none;
	border: none;
	padding: 10px 0;
}

/* Hover effects */
.timeline-item:hover .timeline-badge {
	transform: scale(1.15);
}
.timeline-item.not-achieved .timeline-badge-image:hover {
	filter: unset;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
	
	.timeline-items {
		justify-content: space-around;
	}
	
	.timeline-item {
		max-width: 60px;
	}
	
	.timeline-medium .timeline-badge-image {
		width: 36px;
		height: 36px;
	}
	
	.timeline-large .timeline-badge-image {
		width: 48px;
		height: 48px;
	}
	
	.timeline-label {
		font-size: 10px;
	}
	
	.timeline-progress-info {
		padding: 10px;
		font-size: 12px;
	}
	
	.timeline-progress-info .current-status {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.timeline-item {
		max-width: 45px;
	}
	
	.timeline-medium .timeline-badge-image,
	.timeline-large .timeline-badge-image {
		width: 32px;
		height: 32px;
	}
	
	.timeline-label {
		font-size: 9px;
	}
	
	.current-indicator {
		width: 12px;
		height: 12px;
		top: -4px;
		right: -4px;
	}
}

/* Animation for timeline load */
@keyframes timelineSlideIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.duration-timeline-wrapper {
	animation: timelineSlideIn 0.6s ease-out;
}

/* Accessibility improvements */
.timeline-item[title]:focus {
	outline: 2px solid #0073aa;
	outline-offset: 4px;
	border-radius: 4px;
}

.timeline-badge-image {
	transition: filter 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
	.timeline-fill,
	.timeline-badge,
	.timeline-badge-image,
	.timeline-label,
	.current-indicator,
	.timeline-item {
		transition: none;
	}
	
	.current-indicator {
		animation: none;
	}
	
	.duration-timeline-wrapper {
		animation: none;
	}
}