/* Estilos globais adicionais ao Tailwind */
:root { color-scheme: light; }
body { -webkit-font-smoothing: antialiased; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* HTMX indicator */
.htmx-indicator { opacity: 0; transition: opacity 0.2s ease-in-out; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* Scrollbar discreto */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: padding-box; }

.backtop {
	--p: 0deg;
	position: fixed;
	right: 1rem;
	bottom: calc(var(--footer-h, 56px) + 0.9rem);
	width: 3rem;
	height: 3rem;
	border: 0;
	border-radius: 9999px;
	padding: 0;
	display: grid;
	place-items: center;
	background: transparent;
	color: #0f172a;
	cursor: pointer;
	z-index: 35;
	opacity: 0;
	transform: translateY(14px) scale(0.92);
	pointer-events: none;
	transition: opacity 0.28s ease, transform 0.28s ease;
}

.backtop.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.backtop-orbit {
	position: absolute;
	inset: 0;
	border-radius: 9999px;
	background:
		conic-gradient(from -90deg,
			#0ea5e9 0deg,
			#0ea5e9 var(--p),
			rgba(148, 163, 184, 0.25) var(--p),
			rgba(148, 163, 184, 0.25) 360deg);
	animation: backtop-spin 5s linear infinite;
}

.backtop-core {
	position: relative;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 9999px;
	display: grid;
	place-items: center;
	background: linear-gradient(145deg, #f8fafc, #e2e8f0);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.backtop:hover .backtop-core {
	transform: translateY(-1px);
}

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

@media (prefers-reduced-motion: reduce) {
	.backtop,
	.backtop-orbit,
	.backtop-core {
		transition: none;
		animation: none;
	}
}

.copy-chip {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	margin-left: 0;
	padding: 0.1rem 0.35rem;
	border-radius: 0.4rem;
	border: 1px solid #cbd5e1;
	background: #f8fafc;
	color: #0f172a;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 0.66rem;
	line-height: 1.1;
	cursor: pointer;
	position: relative;
	z-index: 2;
	max-width: 100%;
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.copy-chip-value {
	min-width: 0;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.copy-chip:hover {
	background: #eff6ff;
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.copy-chip:active {
	transform: scale(0.98);
}

.copy-chip-user {
	min-width: 10rem;
	max-width: 10rem;
}

.copy-chip-secret {
	display: inline-flex;
	min-width: 10rem;
	max-width: 10rem;
}

.copy-chip.is-copied {
	animation: copy-pop 0.42s ease;
	border-color: #10b981;
	background: #ecfdf5;
}

.copy-chip.is-copy-error {
	animation: copy-pop 0.42s ease;
	border-color: #f43f5e;
	background: #fff1f2;
}

@keyframes copy-pop {
	0% { transform: scale(1); }
	45% { transform: scale(1.04); }
	100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.copy-chip,
	.copy-chip.is-copied {
		transition: none;
		animation: none;
	}
}

.action-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 0.5rem;
	border: 1px solid #dbe3ee;
	background: #fff;
	color: #475569;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(15, 23, 42, 0.05);
	transform: translateY(0) scale(1);
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.action-icon-btn:hover {
	background: #f8fafc;
	color: #0f172a;
	box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
	transform: translateY(-1px) scale(1.05);
}

.action-icon-btn:active {
	transform: translateY(0) scale(0.98);
}

.action-icon-btn svg {
	width: 0.95rem;
	height: 0.95rem;
}
