/**
 * SecurePulse – Icon Styles
 *
 * Inline SVG icons sind als PHP-Helper ausgegeben (securepulse_icon()).
 * Diese Datei ergänzt visuelle Stile für Icon-Verwendungen.
 *
 * @package SecurePulse
 */

/* =========================================================
   Icon base
   ========================================================= */
.icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	vertical-align: middle;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon--filled {
	fill: currentColor;
	stroke: none;
}

.icon--accent {
	color: var( --color-accent );
}

.icon--muted {
	color: var( --color-text-muted );
}

.icon--white {
	color: #ffffff;
}

.icon--sm {
	width: 16px;
	height: 16px;
}

.icon--md {
	width: 20px;
	height: 20px;
}

.icon--lg {
	width: 24px;
	height: 24px;
}

.icon--xl {
	width: 32px;
	height: 32px;
}

.icon--2xl {
	width: 48px;
	height: 48px;
}

/* =========================================================
   Icon with text combos
   ========================================================= */
.icon-text {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

.icon-text--gap-sm {
	gap: 0.25rem;
}

.icon-text--gap-md {
	gap: 0.5rem;
}

/* =========================================================
   Icon buttons
   ========================================================= */
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var( --radius-md );
	border: 1px solid var( --color-border );
	background: transparent;
	color: var( --color-text-muted );
	cursor: pointer;
	transition: color var( --transition-fast ), background var( --transition-fast ), border-color var( --transition-fast );
}

.icon-btn:hover {
	background: var( --color-surface );
	color: var( --color-text );
	border-color: var( --color-border-strong );
}

.icon-btn:focus-visible {
	outline: 2px solid var( --color-accent );
	outline-offset: 2px;
}

.icon-btn--primary {
	background: var( --color-accent );
	border-color: var( --color-accent );
	color: #ffffff;
}

.icon-btn--primary:hover {
	background: var( --color-accent-dark );
	border-color: var( --color-accent-dark );
	color: #ffffff;
}

/* =========================================================
   Feature icons (used in cards, feature lists)
   ========================================================= */
.feature-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: var( --radius-lg );
	background: var( --color-accent-pale );
	color: var( --color-accent );
	flex-shrink: 0;
}

.feature-icon--sm {
	width: 2rem;
	height: 2rem;
	border-radius: var( --radius-md );
}

.feature-icon--lg {
	width: 3.5rem;
	height: 3.5rem;
	border-radius: var( --radius-xl );
}

.feature-icon--dark {
	background: rgba( 255, 255, 255, 0.1 );
	color: #ffffff;
}

/* =========================================================
   Stat icons
   ========================================================= */
.stat-icon {
	width: 2rem;
	height: 2rem;
	color: var( --color-accent );
	margin-bottom: 0.5rem;
}

/* =========================================================
   Social icons
   ========================================================= */
.social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var( --radius-md );
	color: var( --color-text-muted );
	transition: color var( --transition-fast );
}

.social-icon:hover {
	color: var( --color-accent );
}

/* =========================================================
   Back to Top button
   ========================================================= */
#back-to-top {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var( --radius-full );
	background: var( --color-accent );
	color: #ffffff;
	border: none;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transform: translateY( 0.5rem );
	transition: opacity var( --transition-base ), transform var( --transition-base );
	box-shadow: var( --shadow-md );
}

#back-to-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY( 0 );
}

#back-to-top:hover {
	background: var( --color-accent-dark );
}

#back-to-top:focus-visible {
	outline: 2px solid var( --color-accent );
	outline-offset: 4px;
}

/* =========================================================
   Reading progress bar
   ========================================================= */
#reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;
	height: 3px;
	width: 0;
	background: linear-gradient( 90deg, var( --color-accent ), var( --color-accent-light ) );
	transition: width 0.1s linear;
	pointer-events: none;
}

/* =========================================================
   Code copy button
   ========================================================= */
.code-copy-btn {
	position: absolute;
	top: 0.625rem;
	right: 0.625rem;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.5;
	border-radius: var( --radius-sm );
	border: 1px solid rgba( 255, 255, 255, 0.2 );
	background: rgba( 255, 255, 255, 0.1 );
	color: rgba( 255, 255, 255, 0.7 );
	cursor: pointer;
	transition: background var( --transition-fast ), color var( --transition-fast );
	font-family: var( --font-sans );
}

.code-copy-btn:hover {
	background: rgba( 255, 255, 255, 0.2 );
	color: #ffffff;
}

.code-copy-btn.is-copied {
	background: rgba( 34, 197, 94, 0.2 );
	border-color: rgba( 34, 197, 94, 0.4 );
	color: #4ade80;
}

/* =========================================================
   Table of Contents
   ========================================================= */
.toc {
	padding: 1.5rem;
	background: var( --color-surface );
	border: 1px solid var( --color-border );
	border-radius: var( --radius-xl );
	margin-bottom: 2rem;
}

.toc__title {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var( --color-text-muted );
	margin: 0 0 0.875rem;
}

.toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: toc-counter;
}

.toc__item {
	counter-increment: toc-counter;
	margin: 0;
}

.toc__item + .toc__item {
	border-top: 1px solid var( --color-border );
}

.toc__link {
	display: block;
	padding: 0.5rem 0;
	font-size: 0.875rem;
	font-weight: 500;
	color: var( --color-text-secondary );
	text-decoration: none;
	transition: color var( --transition-fast );
}

.toc__link:hover,
.toc__link.is-active {
	color: var( --color-accent );
}

.toc__item--sub .toc__link {
	padding-left: 1rem;
	font-size: 0.8125rem;
	font-weight: 400;
}

/* =========================================================
   Fade-in animation
   ========================================================= */
.animate-in {
	opacity: 0;
	transform: translateY( 1rem );
	transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-in.is-visible {
	opacity: 1;
	transform: translateY( 0 );
}

@media ( prefers-reduced-motion: reduce ) {
	.animate-in {
		opacity: 1;
		transform: none;
	}
}
