/**
 * AI Recap — Frontend Widget Styles
 *
 * All classes prefixed with .ais- to avoid theme conflicts.
 *
 * @package AI_Recap
 */

/* ─────────────────────────────────────────────────────
   CSS Custom Properties
   ───────────────────────────────────────────────────── */
:root {
	--ais-border-color: #efefef;
	--ais-border-radius: 12px;
	--ais-btn-size: 68px;
	--ais-icon-size: 52px;
	--ais-bg: transparent;
	--ais-text-color: #555;
	--ais-btn-bg: #fff;
	--ais-btn-border: #e5e7eb;
	--ais-accent: #22c55e;
	--ais-accent-shadow: rgba(34, 197, 94, 0.15);
	--ais-accent-shadow-hover: rgba(34, 197, 94, 0.25);
	--ais-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	--ais-shadow-hover: 0 3px 12px rgba(34, 197, 94, 0.25);
	--ais-font-family: inherit;
}

/* ─────────────────────────────────────────────────────
   Pulse Animation
   ───────────────────────────────────────────────────── */
@keyframes ais-pulse {
	0%, 100% {
		box-shadow: var(--ais-shadow);
	}
	50% {
		box-shadow: 0 2px 8px var(--ais-accent-shadow);
	}
}

/* ─────────────────────────────────────────────────────
   Widget Container
   ───────────────────────────────────────────────────── */
.ais-widget {
	font-family: var(--ais-font-family);
	width: 100%;
	max-width: 600px;
	margin: 24px auto;
	padding: 12px 20px;
	background: var(--ais-bg);
	border: 1px solid var(--ais-border-color);
	border-radius: var(--ais-border-radius);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

/* ─────────────────────────────────────────────────────
   Widget Title
   ───────────────────────────────────────────────────── */
.ais-widget-title {
	font-size: 15px;
	font-weight: 400;
	color: var(--ais-text-color);
	line-height: 1;
	text-align: center;
	font-family: var(--ais-font-family);
}

/* ─────────────────────────────────────────────────────
   Button Row
   ───────────────────────────────────────────────────── */
.ais-widget-buttons {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
}

/* ─────────────────────────────────────────────────────
   Individual Button
   ───────────────────────────────────────────────────── */
.ais-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	cursor: pointer;
	width: var(--ais-btn-size);
	height: var(--ais-btn-size);
	box-sizing: border-box;
	border: 1px solid var(--ais-btn-border);
	border-radius: 8px;
	background: var(--ais-btn-bg);
	transition: all 0.2s ease;
	box-shadow: var(--ais-shadow);
	animation: ais-pulse 2s ease-in-out infinite;
	outline: none;
}

.ais-btn:hover,
.ais-btn:focus-visible {
	box-shadow: var(--ais-shadow-hover);
	border-color: var(--ais-accent);
	transform: translateY(-1px);
	animation-play-state: paused;
}

.ais-btn:active {
	transform: translateY(0);
	box-shadow: var(--ais-shadow);
}

/* ─────────────────────────────────────────────────────
   Button Icon
   ───────────────────────────────────────────────────── */
.ais-btn-icon {
	width: var(--ais-icon-size);
	height: var(--ais-icon-size);
	display: block;
	object-fit: contain;
}

/* ─────────────────────────────────────────────────────
   Fallback (no icon — show initials)
   ───────────────────────────────────────────────────── */
.ais-btn-fallback {
	font-size: 18px;
	font-weight: 700;
	color: #334155;
	text-transform: uppercase;
	user-select: none;
}

/* ─────────────────────────────────────────────────────
   Dark Theme
   ───────────────────────────────────────────────────── */
.ais-widget-dark {
	--ais-border-color: #334155;
	--ais-bg: #0f172a;
	--ais-text-color: #94a3b8;
	--ais-btn-bg: #1e293b;
	--ais-btn-border: #334155;
}

/* ─────────────────────────────────────────────────────
   Auto Dark Mode (prefers-color-scheme)
   ───────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
	.ais-widget:not(.ais-widget-dark) {
		/* Don't auto-switch — let theme handle it.
		   Users can enable dark mode via shortcode or custom CSS.
		   Uncomment below to auto-enable:
		*/
		/*
		--ais-border-color: #334155;
		--ais-bg: #0f172a;
		--ais-text-color: #94a3b8;
		--ais-btn-bg: #1e293b;
		--ais-btn-border: #334155;
		*/
	}
}

/* ─────────────────────────────────────────────────────
   Responsive — Mobile
   ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.ais-widget {
		padding: 10px 14px;
		gap: 10px;
	}

	.ais-widget-buttons {
		gap: 5px;
	}

	.ais-btn {
		width: 56px;
		height: 56px;
	}

	.ais-btn-icon {
		width: 40px;
		height: 40px;
	}

	.ais-widget-title {
		font-size: 13px;
	}
}

/* ─────────────────────────────────────────────────────
   Very small screens — stack-safe
   ───────────────────────────────────────────────────── */
@media (max-width: 360px) {
	.ais-widget-buttons {
		flex-wrap: wrap;
		gap: 6px;
	}

	.ais-btn {
		width: 48px;
		height: 48px;
	}

	.ais-btn-icon {
		width: 34px;
		height: 34px;
	}
}
