/**
 * @file
 * style du composant Updater - Design moderne
 */

/* Variables CSS */
:root {
	--updater-primary: #3c8dbc;
	--updater-primary-dark: #2e7ba8;
	--updater-primary-light: #5ba3d1;
	--updater-success: #28a745;
	--updater-success-light: #48d665;
	--updater-warning: #ffc107;
	--updater-danger: #dc3545;
	--updater-info: #17a2b8;
	--updater-bg: #f8f9fa;
	--updater-card-bg: #ffffff;
	--updater-text: #333333;
	--updater-text-secondary: #6c757d;
	--updater-border: #e0e0e0;
	--updater-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	--updater-shadow-hover: 0 4px 20px rgba(60, 141, 188, 0.3);
	--updater-gradient: linear-gradient(135deg, #3c8dbc 0%, #5ba3d1 100%);
}

/* Container principal */
.Updater {
	padding: 10px;
	background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
	min-height: 100vh;
}

.updater-container {
	max-width: 900px;
	margin: 0 auto;
	animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* En-tête */
.updater-header {
	text-align: center;
	margin-bottom: 15px;
	padding: 15px 15px;
	background: var(--updater-gradient);
	border-radius: 10px;
	box-shadow: var(--updater-shadow);
	color: white;
	position: relative;
	overflow: hidden;
}

.updater-header::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
	animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		transform: scale(1);
		opacity: 0.5;
	}
	50% {
		transform: scale(1.1);
		opacity: 0.8;
	}
}

.updater-header-icon {
	font-size: 36px;
	margin-bottom: 8px;
	position: relative;
	z-index: 1;
	animation: float 3s ease-in-out infinite;
}

@keyframes float {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

.updater-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 4px 0;
	position: relative;
	z-index: 1;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.updater-subtitle {
	font-size: 12px;
	margin: 0;
	opacity: 0.95;
	position: relative;
	z-index: 1;
}

/* Carte des versions */
.updater-version-card {
	background: var(--updater-card-bg);
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 15px;
	box-shadow: var(--updater-shadow);
	border: 1px solid var(--updater-border);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.updater-version-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.version-info {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.version-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: var(--updater-bg);
	border-radius: 8px;
	transition: background 0.3s ease;
}

.version-item:hover {
	background: #e9ecef;
}

.version-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--updater-text);
	font-size: 13px;
}

.version-label i {
	color: var(--updater-primary);
	font-size: 14px;
}

.version-separator {
	text-align: center;
	color: var(--updater-primary);
	font-size: 14px;
	animation: bounce 2s ease-in-out infinite;
	margin: 2px 0;
}

@keyframes bounce {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-5px);
	}
}

.version-value {
	font-size: 14px;
}

.version-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.3px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.version-badge.current {
	background: var(--updater-success);
	color: white;
	animation: glow 2s ease-in-out infinite;
}

.version-badge.latest {
	background: var(--updater-gradient);
	color: white;
	position: relative;
	overflow: hidden;
}

.version-badge.latest::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
	animation: shine 3s infinite;
}

@keyframes glow {
	0%, 100% {
		box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
	}
	50% {
		box-shadow: 0 2px 16px rgba(40, 167, 69, 0.8);
	}
}

@keyframes shine {
	0% {
		transform: translateX(-100%) translateY(-100%) rotate(45deg);
	}
	100% {
		transform: translateX(100%) translateY(100%) rotate(45deg);
	}
}

/* Section d'action */
.updater-action-section {
	text-align: center;
	margin-bottom: 15px;
}

/* Bouton principal */
.gopaas-auto-update.updater-btn-primary {
	background: var(--updater-gradient);
	border: none;
	color: white;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 25px;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(60, 141, 188, 0.4);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 200px;
	justify-content: center;
}

.gopaas-auto-update.updater-btn-primary::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.gopaas-auto-update.updater-btn-primary:hover::before {
	width: 300px;
	height: 300px;
}

.gopaas-auto-update.updater-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: var(--updater-shadow-hover);
}

.gopaas-auto-update.updater-btn-primary:active {
	transform: translateY(0);
}

.gopaas-auto-update.updater-btn-primary:disabled,
.gopaas-auto-update.updater-btn-primary.disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.gopaas-auto-update.updater-btn-primary .btn-icon {
	position: relative;
	z-index: 1;
}

.gopaas-auto-update.updater-btn-primary .btn-text {
	position: relative;
	z-index: 1;
}

.gopaas-auto-update.updater-btn-primary .btn-loader {
	position: relative;
	z-index: 1;
}

/* Bouton secondaire */
.updater-btn-secondary {
	background: white;
	border: 2px solid var(--updater-primary);
	color: var(--updater-primary);
	padding: 8px 20px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
}

.updater-btn-secondary:hover {
	background: var(--updater-primary);
	color: white;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(60, 141, 188, 0.3);
}

/* Section de statut */
.updater-status-section {
	margin-bottom: 15px;
	min-height: 100px;
}

/* Indicateur de chargement */
.updater-loading {
	background: var(--updater-card-bg);
	border-radius: 10px;
	padding: 20px;
	text-align: center;
	box-shadow: var(--updater-shadow);
}

.loading-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid var(--updater-bg);
	border-top-color: var(--updater-primary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading-text {
	font-size: 15px;
	font-weight: 600;
	color: var(--updater-text);
	margin: 0;
}

.loading-subtext {
	font-size: 12px;
	color: var(--updater-text-secondary);
	margin: 0;
}

/* Message de succès */
.updater-success {
	background: var(--updater-card-bg);
	border-radius: 10px;
	padding: 20px;
	text-align: center;
	box-shadow: var(--updater-shadow);
	border: 2px solid var(--updater-success);
	animation: successSlideIn 0.5s ease-out;
}

@keyframes successSlideIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.success-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.success-icon {
	font-size: 48px;
	color: var(--updater-success);
	animation: successPulse 1s ease-out;
}

@keyframes successPulse {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	50% {
		transform: scale(1.2);
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.success-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--updater-text);
	margin: 0;
}

.success-message {
	font-size: 13px;
	color: var(--updater-text-secondary);
	margin: 0;
}

/* Zone de rapport */
.updater-report-section {
	background: var(--updater-card-bg);
	border-radius: 10px;
	box-shadow: var(--updater-shadow);
	overflow: hidden;
	margin-top: 15px;
}

.report-header {
	background: var(--updater-gradient);
	color: white;
	padding: 10px 15px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 14px;
}

.report-header i {
	font-size: 14px;
}

.report-toggle {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	cursor: pointer;
	margin-left: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	font-size: 12px;
}

.report-toggle:hover {
	background: rgba(255, 255, 255, 0.3);
}

.report-toggle.active i {
	transform: rotate(180deg);
}

.report-toggle i {
	transition: transform 0.3s ease;
}

.report-content {
	max-height: 300px;
	overflow-y: auto;
	padding: 12px;
	font-family: 'Courier New', monospace;
	font-size: 12px;
	line-height: 1.6;
	background: #1e1e1e;
	color: #d4d4d4;
	border-radius: 0 0 10px 10px;
	transition: max-height 0.3s ease;
}

.report-content.collapsed {
	max-height: 0;
	padding: 0 12px;
	overflow: hidden;
}

/* Styles pour les messages du rapport */
.gopaas-report {
	overflow-y: auto;
	max-height: 300px;
}

.gopaas-report span {
	display: block;
	padding: 2px 0;
	word-wrap: break-word;
}

.gopaas-report span:empty {
	height: 1em;
}

/* Styles pour les versions */
.gopaas-your-version,
.gopaas-last-version {
	display: inline;
}

.gopaas-your-version .version-badge,
.gopaas-last-version .version-badge {
	margin: 0;
}

/* Scrollbar personnalisée pour le rapport */
.gopaas-report::-webkit-scrollbar,
.report-content::-webkit-scrollbar {
	width: 8px;
}

.gopaas-report::-webkit-scrollbar-track,
.report-content::-webkit-scrollbar-track {
	background: #2d2d2d;
	border-radius: 4px;
}

.gopaas-report::-webkit-scrollbar-thumb,
.report-content::-webkit-scrollbar-thumb {
	background: #555;
	border-radius: 4px;
}

.gopaas-report::-webkit-scrollbar-thumb:hover,
.report-content::-webkit-scrollbar-thumb:hover {
	background: #777;
}

/* Responsive */
@media (max-width: 768px) {
	.Updater {
		padding: 8px;
	}

	.updater-header {
		padding: 12px 12px;
		margin-bottom: 12px;
	}

	.updater-header-icon {
		font-size: 28px;
	}

	.updater-title {
		font-size: 18px;
	}

	.updater-version-card {
		padding: 10px;
	}

	.version-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		padding: 8px 10px;
	}

	.version-value {
		align-self: flex-end;
	}

	.gopaas-auto-update.updater-btn-primary {
		width: 100%;
		padding: 10px 20px;
		font-size: 13px;
	}

	.updater-loading,
	.updater-success {
		padding: 15px 12px;
	}
}

/* Animation pour les états de chargement */
.gopaas-wait .loading-spinner {
	animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

/* Styles pour les messages de succès et d'erreur dans le rapport */
.gopaas-report .text-success {
	color: #48d665 !important;
	font-weight: 600;
}

.gopaas-report .text-danger {
	color: #ff6b6b !important;
	font-weight: 600;
}

/* Animation pour les messages du rapport */
@keyframes fadeInReport {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}