/* CrowdSec Setup Wizard Styles */

/* === Hide LuCI Left Menu === */
#mainmenu,
.main-left,
.luci-mainmenu,
#maincontent > .container > .main-left,
header.main ~ .main .main-left,
body > .main > .main-left,
.node-crowdsec-dashboard-wizard .main-left {
	display: none !important;
	width: 0 !important;
	min-width: 0 !important;
	max-width: 0 !important;
	overflow: hidden !important;
	visibility: hidden !important;
}

/* Make main content full width when menu is hidden */
.main-right,
#maincontent > .container > .main-right,
header.main ~ .main .main-right,
body > .main > .main-right,
.node-crowdsec-dashboard-wizard .main-right {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	padding-left: 0 !important;
	flex: 1 !important;
}

#maincontent > .container {
	display: block !important;
	max-width: 100% !important;
}

/* Wizard Container */
.wizard-container {
	max-width: 900px;
	margin: 0 auto;
	padding: 20px;
}

/* Stepper */
.wizard-stepper {
	display: flex;
	justify-content: space-between;
	margin-bottom: 32px;
	padding: 0 20px;
	position: relative;
}

.wizard-step-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	position: relative;
	z-index: 1;
}

.wizard-step-indicator:not(:last-child)::after {
	content: '';
	position: absolute;
	top: 18px;
	left: 50%;
	right: -50%;
	height: 2px;
	background: rgba(148, 163, 184, 0.25);
	z-index: -1;
}

.wizard-step-indicator.complete::after {
	background: #22c55e;
}

.wizard-step-index {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	background: rgba(15, 23, 42, 0.85);
	border: 2px solid rgba(148, 163, 184, 0.25);
	margin-bottom: 8px;
	transition: all 0.3s ease;
	color: #94a3b8;
}

.wizard-step-indicator.active .wizard-step-index {
	border-color: #3b82f6;
	background: #3b82f6;
	color: white;
	box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
	animation: pulse-blue 2s infinite;
}

.wizard-step-indicator.complete .wizard-step-index {
	border-color: #22c55e;
	background: #22c55e;
	color: white;
}

@keyframes pulse-blue {
	0%, 100% {
		box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
	}
	50% {
		box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
	}
}

.wizard-step-title {
	font-size: 12px;
	color: #94a3b8;
	text-align: center;
	transition: all 0.3s ease;
}

.wizard-step-indicator.active .wizard-step-title {
	color: #3b82f6;
	font-weight: 600;
}

.wizard-step-indicator.complete .wizard-step-title {
	color: #22c55e;
}

/* Step Content */
.wizard-step {
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid rgba(148, 163, 184, 0.25);
	border-radius: 12px;
	padding: 32px;
	margin-bottom: 24px;
	min-height: 400px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wizard-step h2 {
	margin: 0 0 16px 0;
	color: #f1f5f9;
	font-size: 24px;
	font-weight: 600;
}

.wizard-step p {
	color: #e2e8f0;
	margin-bottom: 24px;
	line-height: 1.6;
}

.wizard-step.wizard-complete {
	background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

/* Status Checks */
.status-checks {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 24px 0;
}

.check-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: rgba(15, 23, 42, 0.5);
	border-radius: 8px;
	border: 1px solid rgba(148, 163, 184, 0.15);
	transition: all 0.2s ease;
}

.check-item:hover {
	border-color: rgba(148, 163, 184, 0.3);
}

.check-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 16px;
	flex-shrink: 0;
}

.check-icon.success {
	background: #22c55e;
	color: white;
}

.check-icon.error {
	background: #ef4444;
	color: white;
}

.status-area {
	margin: 24px 0;
	padding: 20px;
	text-align: center;
	background: rgba(15, 23, 42, 0.5);
	border-radius: 8px;
	border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Collections List */
.collections-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 24px 0;
}

.collection-item {
	padding: 12px 16px;
	background: rgba(15, 23, 42, 0.5);
	border-radius: 8px;
	border: 1px solid rgba(148, 163, 184, 0.15);
	transition: all 0.2s ease;
}

.collection-item:hover {
	border-color: rgba(59, 130, 246, 0.3);
	background: rgba(15, 23, 42, 0.7);
}

.collection-item .cyber-checkbox {
	display: flex !important;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	user-select: none;
	padding: 0 !important;
}

.collection-item .cyber-checkbox input[type="checkbox"] {
	cursor: pointer;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.collection-info {
	flex: 1;
}

.collection-info strong {
	color: #f1f5f9;
	font-weight: 500;
}

.collection-desc {
	font-size: 12px;
	color: #cbd5e1;
	margin-top: 4px;
}

/* Configuration Section */
.config-section {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 24px 0;
	padding: 20px;
	background: rgba(15, 23, 42, 0.5);
	border-radius: 8px;
	border: 1px solid rgba(148, 163, 184, 0.15);
}

.config-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.config-group label {
	color: #cbd5e1;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.config-group input[type="checkbox"] {
	cursor: pointer;
	width: 18px;
	height: 18px;
}

.config-group select {
	padding: 8px 12px;
	background: rgba(15, 23, 42, 0.8);
	border: 1px solid rgba(148, 163, 184, 0.25);
	border-radius: 6px;
	color: #f1f5f9;
	font-size: 14px;
}

/* API Key Display */
.api-key-display {
	margin: 24px 0;
	padding: 16px;
	background: rgba(15, 23, 42, 0.5);
	border: 1px solid rgba(34, 197, 94, 0.3);
	border-radius: 8px;
}

.api-key-display strong {
	display: block;
	color: #22c55e;
	margin-bottom: 8px;
	font-size: 14px;
}

.api-key-display code {
	display: block;
	padding: 12px;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 6px;
	color: #94a3b8;
	font-family: 'Courier New', monospace;
	font-size: 13px;
	word-break: break-all;
	margin-bottom: 12px;
}

.api-key-display button {
	margin-top: 8px;
}

/* Service Status */
.service-status {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 24px 0;
}

.status-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	background: rgba(15, 23, 42, 0.5);
	border-radius: 8px;
	border: 1px solid rgba(148, 163, 184, 0.15);
}

.status-label {
	color: #cbd5e1;
	font-weight: 500;
	font-size: 14px;
}

.status-value {
	color: #cbd5e1;
	font-size: 14px;
}

.status-value.success {
	color: #22c55e;
	font-weight: 600;
}

/* Success Hero */
.success-hero {
	text-align: center;
	margin-bottom: 32px;
	padding: 20px;
}

.success-icon {
	font-size: 64px;
	margin-bottom: 16px;
	animation: celebrate 0.6s ease-in-out;
}

@keyframes celebrate {
	0% {
		transform: scale(0.5) rotate(-10deg);
		opacity: 0;
	}
	50% {
		transform: scale(1.1) rotate(10deg);
	}
	100% {
		transform: scale(1) rotate(0deg);
		opacity: 1;
	}
}

.success-hero h2 {
	color: #22c55e;
	font-size: 28px;
	margin: 0;
}

.text-center {
	text-align: center;
}

/* Summary Grid */
.summary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;
	margin: 24px 0;
}

.summary-item {
	display: flex;
	gap: 12px;
	padding: 16px;
	background: rgba(15, 23, 42, 0.5);
	border-radius: 8px;
	border: 1px solid rgba(34, 197, 94, 0.3);
	transition: all 0.2s ease;
}

.summary-item:hover {
	border-color: rgba(34, 197, 94, 0.5);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.summary-item .check-icon {
	flex-shrink: 0;
}

.summary-item strong {
	display: block;
	color: #f1f5f9;
	margin-bottom: 4px;
	font-size: 14px;
}

.summary-desc {
	font-size: 12px;
	color: #94a3b8;
}

/* Stats Box */
.stats-box {
	background: rgba(15, 23, 42, 0.5);
	border: 1px solid rgba(148, 163, 184, 0.25);
	border-radius: 8px;
	padding: 20px;
	margin: 24px 0;
}

.stats-box h4 {
	margin: 0 0 16px 0;
	color: #f1f5f9;
	font-size: 16px;
	font-weight: 600;
}

.stats-row {
	display: flex;
	gap: 24px;
	justify-content: space-around;
	flex-wrap: wrap;
}

.stat {
	text-align: center;
	min-width: 120px;
}

.stat-value {
	font-size: 32px;
	font-weight: 700;
	color: #3b82f6;
	line-height: 1.2;
}

.stat-label {
	font-size: 12px;
	color: #94a3b8;
	margin-top: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Info Box */
.info-box {
	background: rgba(59, 130, 246, 0.1);
	border: 1px solid rgba(59, 130, 246, 0.3);
	border-radius: 8px;
	padding: 20px;
	margin: 24px 0;
}

.info-box h4 {
	margin: 0 0 12px 0;
	color: #3b82f6;
	font-size: 16px;
	font-weight: 600;
}

.info-box ul {
	margin: 0;
	padding-left: 20px;
}

.info-box li {
	color: #cbd5e1;
	margin-bottom: 8px;
	line-height: 1.6;
}

/* Success Message */
.success-message {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.3);
	border-radius: 8px;
	margin: 24px 0;
	color: #22c55e;
	font-weight: 500;
	animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
	from {
		transform: translateY(-10px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Install Progress */
.install-progress {
	text-align: center;
	padding: 32px;
	margin: 24px 0;
}

.install-progress .spinning {
	margin: 0 auto 16px;
}

.install-progress p {
	color: #3b82f6;
	font-weight: 500;
	margin-bottom: 12px;
}

#install-status {
	margin-top: 12px;
	color: #3b82f6;
	font-weight: 500;
	font-size: 14px;
}

/* Wizard Navigation */
.wizard-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid rgba(148, 163, 184, 0.25);
	flex-wrap: wrap;
}

.wizard-nav button {
	flex: 0 1 auto;
	min-width: 120px;
}

.wizard-nav button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Badges */
.badge {
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.badge-success {
	background: #22c55e;
	color: white;
}

.badge-error {
	background: #ef4444;
	color: white;
}

.badge-warning {
	background: #f59e0b;
	color: white;
}

.badge-info {
	background: #3b82f6;
	color: white;
}

/* Spinning Loader */
.spinning {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(59, 130, 246, 0.2);
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
	.wizard-container {
		padding: 10px;
	}

	.wizard-stepper {
		flex-wrap: wrap;
		padding: 0 10px;
	}

	.wizard-step-indicator {
		min-width: 60px;
	}

	.wizard-step-indicator:not(:last-child)::after {
		display: none;
	}

	.wizard-step {
		padding: 20px;
		min-height: 300px;
	}

	.wizard-step h2 {
		font-size: 20px;
	}

	.summary-grid {
		grid-template-columns: 1fr;
	}

	.stats-row {
		flex-direction: column;
		gap: 16px;
	}

	.wizard-nav {
		flex-direction: column;
	}

	.wizard-nav button {
		width: 100%;
		min-width: 0;
	}

	.config-section {
		padding: 16px;
	}
}

@media (max-width: 480px) {
	.wizard-step-title {
		font-size: 10px;
	}

	.wizard-step-index {
		width: 32px;
		height: 32px;
		font-size: 12px;
	}

	.success-icon {
		font-size: 48px;
	}

	.success-hero h2 {
		font-size: 22px;
	}

	.stat-value {
		font-size: 24px;
	}
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
	.wizard-step {
		box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
	}

	.collection-item:hover,
	.check-item:hover {
		background: rgba(15, 23, 42, 0.8);
	}
}

/* Accessibility */
.wizard-step:focus-within {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

button:focus-visible {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

/* Print Styles */
@media print {
	.wizard-nav {
		display: none;
	}

	.wizard-step {
		border: 1px solid #000;
		box-shadow: none;
	}

	.spinning {
		display: none;
	}
}
