/**
 * Notifal Changelog Styles
 *
 * Professional changelog display styles with modern UI/UX
 *
 * @package Notifal
 * @since 1.1.0
 */

/* Container */
.notifal-changelog-container {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem 1rem;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Switcher (All / Lite / Pro) */
.notifal-changelog-switcher {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 2rem;
	padding: 0.25rem;
	background: #f0f2f5;
	border-radius: 10px;
}

.notifal-changelog-switcher-btn {
	display: inline-block;
	padding: 0.625rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #4b5563;
	background: transparent;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease;
}

.notifal-changelog-switcher-btn:hover {
	color: #1a1a1a;
	background: rgba(255, 255, 255, 0.8);
}

.notifal-changelog-switcher-btn.is-active {
	color: #fff;
	background: linear-gradient(135deg, #7B2CBF 0%, #6B24B3 100%);
	box-shadow: 0 2px 6px rgba(123, 44, 191, 0.35);
}

.notifal-changelog-switcher-btn[data-filter="lite"].is-active {
	background: #fcf5ff;
	color: #7B2CBF;
	box-shadow: 0 2px 6px rgba(123, 44, 191, 0.2);
}

.notifal-changelog-switcher-btn[data-filter="pro"].is-active {
	background: linear-gradient(135deg, #7B2CBF 0%, #6B24B3 100%);
	box-shadow: 0 2px 6px rgba(123, 44, 191, 0.35);
}

/* Filter change loader (shown while AJAX loads content for selected tab) */
.notifal-changelog-filter-loader {
	display: none;
	min-height: 100px;
	justify-content: center;
	align-items: center;
	margin-bottom: 1rem;
}

.notifal-changelog-container.is-filter-loading .notifal-changelog-filter-loader {
	display: flex;
}

.notifal-changelog-container.is-filter-loading .notifal-changelog-list,
.notifal-changelog-container.is-filter-loading .notifal-changelog-empty {
	opacity: 0.4;
	pointer-events: none;
}

.notifal-changelog-filter-loader .notifal-changelog-loader-spinner {
	display: inline-block;
	width: 32px;
	height: 32px;
	border: 3px solid #e1e5e9;
	border-top-color: #7B2CBF;
	border-radius: 50%;
	animation: notifal-changelog-spin 0.8s linear infinite;
}

/* Hidden by filter */
.notifal-changelog-entry.is-hidden-by-filter {
	display: none !important;
}

/* Hidden by pagination (initially hidden, will be shown on load more) */
.notifal-changelog-entry.is-hidden-by-pagination {
	display: none !important;
}

/* Empty state */
.notifal-changelog-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #666;
}

.notifal-changelog-empty p {
	margin: 0;
	font-size: 1.1rem;
}

/* Changelog list */
.notifal-changelog-list {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* Changelog entry */
.notifal-changelog-entry {
	background: #ffffff;
	border: 1px solid #e1e5e9;
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.notifal-changelog-entry::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, #7B2CBF 0%, #6B24B3 100%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.notifal-changelog-entry:hover {
	border-color: #7B2CBF;
	box-shadow: 0 4px 12px rgba(123, 44, 191, 0.1);
	transform: translateY(-2px);
}

.notifal-changelog-entry:hover::before {
	opacity: 1;
}

/* Header */
.notifal-changelog-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 1rem;
	gap: 1rem;
	flex-wrap: wrap;
}

.notifal-changelog-version-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.notifal-changelog-version {
	font-size: 1.5rem;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.2;
}

.notifal-changelog-date {
	font-size: 0.9rem;
	color: #666;
	font-weight: 400;
	padding: 0.25rem 0.75rem;
	background: #f5f7fa;
	border-radius: 6px;
}

/* Product badge */
.notifal-changelog-badge {
	display: inline-block;
	padding: 0.375rem 0.75rem;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1;
}

.notifal-changelog-badge--lite {
	background: #fcf5ff;
	color: #7B2CBF;
}

.notifal-changelog-badge--pro {
	background: linear-gradient(135deg, #7B2CBF 0%, #6B24B3 100%);
	color: #ffffff;
}

/* Changes list */
.notifal-changelog-changes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.notifal-changelog-change {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	padding: 0.75rem;
	background: #f8f9fa;
	border-radius: 8px;
	border-left: 3px solid transparent;
	transition: all 0.2s ease;
}

.notifal-changelog-change:hover {
	background: #f0f2f5;
	transform: translateX(4px);
}

.notifal-changelog-change-type {
	font-weight: 600;
	font-size: 0.875rem;
	min-width: 80px;
	flex-shrink: 0;
}

.notifal-changelog-change-text {
	flex: 1;
	color: #333;
	line-height: 1.6;
}

/* Change type colors */
.notifal-changelog-change.change-added {
	border-left-color: #10b981;
}

.notifal-changelog-change.change-added .notifal-changelog-change-type {
	color: #10b981;
}

.notifal-changelog-change.change-fixed {
	border-left-color: #ef4444;
}

.notifal-changelog-change.change-fixed .notifal-changelog-change-type {
	color: #ef4444;
}

.notifal-changelog-change.change-improved {
	border-left-color: #3b82f6;
}

.notifal-changelog-change.change-improved .notifal-changelog-change-type {
	color: #3b82f6;
}

.notifal-changelog-change.change-removed {
	border-left-color: #f59e0b;
}

.notifal-changelog-change.change-removed .notifal-changelog-change-type {
	color: #f59e0b;
}

.notifal-changelog-change.change-changed {
	border-left-color: #8b5cf6;
}

.notifal-changelog-change.change-changed .notifal-changelog-change-type {
	color: #8b5cf6;
}

.notifal-changelog-change.change-enhanced {
	border-left-color: #06b6d4;
}

.notifal-changelog-change.change-enhanced .notifal-changelog-change-type {
	color: #06b6d4;
}

.notifal-changelog-change.change-updated {
	border-left-color: #6366f1;
}

.notifal-changelog-change.change-updated .notifal-changelog-change-type {
	color: #6366f1;
}

.notifal-changelog-change.change-important {
	border-left-color: #dc2626;
	background: #fef2f2;
}

.notifal-changelog-change.change-important .notifal-changelog-change-type {
	color: #dc2626;
	font-weight: 700;
}

.notifal-changelog-change.change-default {
	border-left-color: #94a3b8;
}

.notifal-changelog-change.change-default .notifal-changelog-change-type {
	color: #94a3b8;
}

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

	.notifal-changelog-switcher {
		margin-bottom: 1.5rem;
	}

	.notifal-changelog-switcher-btn {
		padding: 0.5rem 1rem;
		font-size: 0.875rem;
	}

	.notifal-changelog-entry {
		padding: 1rem;
	}

	.notifal-changelog-version {
		font-size: 1.25rem;
	}

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

	.notifal-changelog-change {
		flex-direction: column;
		gap: 0.25rem;
	}

	.notifal-changelog-change-type {
		min-width: auto;
	}
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
	.notifal-changelog-entry {
		background: #1f2937;
		border-color: #374151;
		color: #e5e7eb;
	}

	.notifal-changelog-entry:hover {
		border-color: #7B2CBF;
		box-shadow: 0 4px 12px rgba(123, 44, 191, 0.2);
	}

	.notifal-changelog-version {
		color: #f9fafb;
	}

	.notifal-changelog-date {
		background: #374151;
		color: #9ca3af;
	}

	.notifal-changelog-change {
		background: #111827;
	}

	.notifal-changelog-change:hover {
		background: #1f2937;
	}

	.notifal-changelog-change-text {
		color: #d1d5db;
	}

	.notifal-changelog-empty {
		color: #9ca3af;
	}
}

/* Infinite scroll sentinel (trigger + loader) */
.notifal-changelog-infinite-sentinel {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 2rem;
	padding: 1.5rem;
	min-height: 48px;
}

.notifal-changelog-infinite-sentinel.is-complete {
	display: none;
}

.notifal-changelog-infinite-sentinel .notifal-changelog-loader-spinner {
	display: none;
}

.notifal-changelog-infinite-sentinel.is-loading .notifal-changelog-loader-spinner {
	display: inline-block;
	width: 28px;
	height: 28px;
	border: 3px solid #e1e5e9;
	border-top-color: #7B2CBF;
	border-radius: 50%;
	animation: notifal-changelog-spin 0.8s linear infinite;
}

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

@media (max-width: 768px) {
	.notifal-changelog-infinite-sentinel {
		margin-top: 1.5rem;
		padding: 1rem;
	}
}
