/* AI TikTok Hashtag Generator Pro — Frontend Styles */

.athg-widget {
	--athg-bg: #f4f5fb;
	--athg-card-bg: rgba(255, 255, 255, 0.65);
	--athg-card-border: rgba(255, 255, 255, 0.5);
	--athg-text: #1a1b2e;
	--athg-text-muted: #6b6d85;
	--athg-primary-1: #ff2d78;
	--athg-primary-2: #7b2ff7;
	--athg-primary-3: #25f4ee;
	--athg-shadow: 0 10px 40px rgba(20, 20, 50, 0.08);
	--athg-radius: 20px;
	--athg-input-bg: rgba(255, 255, 255, 0.7);

	max-width: 960px;
	margin: 2rem auto;
	padding: 1.5rem;
	background: radial-gradient(circle at top left, rgba(123, 47, 247, 0.08), transparent 40%),
		radial-gradient(circle at bottom right, rgba(37, 244, 238, 0.08), transparent 40%), var(--athg-bg);
	border-radius: 28px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--athg-text);
	box-sizing: border-box;
	transition: background 0.3s ease, color 0.3s ease;
}

.athg-widget.athg-dark {
	--athg-bg: #0f0f1a;
	--athg-card-bg: rgba(30, 30, 48, 0.6);
	--athg-card-border: rgba(255, 255, 255, 0.08);
	--athg-text: #f2f2f7;
	--athg-text-muted: #a3a4bd;
	--athg-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	--athg-input-bg: rgba(255, 255, 255, 0.06);
}

.athg-widget *,
.athg-widget *::before,
.athg-widget *::after {
	box-sizing: border-box;
}

.athg-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.athg-title {
	font-size: 1.6rem;
	font-weight: 800;
	margin: 0 0 0.35rem;
	background: linear-gradient(90deg, var(--athg-primary-1), var(--athg-primary-2) 55%, var(--athg-primary-3));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.athg-subtitle {
	margin: 0;
	color: var(--athg-text-muted);
	font-size: 0.95rem;
}

.athg-theme-toggle {
	border: 1px solid var(--athg-card-border);
	background: var(--athg-card-bg);
	backdrop-filter: blur(12px);
	border-radius: 999px;
	width: 44px;
	height: 44px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: var(--athg-shadow);
	transition: transform 0.2s ease;
	color: var(--athg-primary-2);
	padding: 0;
}

.athg-theme-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.athg-theme-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.athg-theme-toggle:hover {
	transform: scale(1.08);
}

.athg-icon-moon {
	display: none;
}
.athg-widget.athg-dark .athg-icon-sun {
	display: none;
}
.athg-widget.athg-dark .athg-icon-moon {
	display: inline;
}

.athg-card {
	background: var(--athg-card-bg);
	border: 1px solid var(--athg-card-border);
	border-radius: var(--athg-radius);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow: var(--athg-shadow);
	padding: 1.5rem;
	margin-bottom: 1.25rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.athg-card:hover {
	box-shadow: 0 16px 50px rgba(20, 20, 50, 0.12);
}

.athg-label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--athg-text-muted);
}

.athg-textarea,
.athg-result-textarea {
	width: 100%;
	border-radius: 14px;
	border: 1px solid var(--athg-card-border);
	background: var(--athg-input-bg);
	color: var(--athg-text);
	padding: 0.9rem 1rem;
	font-size: 0.98rem;
	line-height: 1.5;
	resize: vertical;
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.athg-textarea:focus,
.athg-result-textarea:focus {
	outline: none;
	border-color: var(--athg-primary-2);
	box-shadow: 0 0 0 4px rgba(123, 47, 247, 0.15);
}

.athg-result-textarea {
	cursor: text;
}

.athg-options-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 0.85rem;
	margin: 1.1rem 0;
}

.athg-select-group label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 0.35rem;
	color: var(--athg-text-muted);
}

.athg-select-group select {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border-radius: 12px;
	border: 1px solid var(--athg-card-border);
	background: var(--athg-input-bg);
	color: var(--athg-text);
	font-size: 0.9rem;
}

.athg-actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: 0.5rem;
}

.athg-btn {
	border: none;
	border-radius: 999px;
	padding: 0.75rem 1.5rem;
	font-weight: 700;
	font-size: 0.92rem;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.athg-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.athg-btn-primary {
	color: #fff;
	background: linear-gradient(90deg, var(--athg-primary-1), var(--athg-primary-2) 55%, var(--athg-primary-3));
	box-shadow: 0 8px 24px rgba(123, 47, 247, 0.35);
}

.athg-btn-primary:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 12px 30px rgba(123, 47, 247, 0.45);
}

.athg-btn-secondary {
	background: var(--athg-input-bg);
	color: var(--athg-text);
	border: 1px solid var(--athg-card-border);
}

.athg-btn-secondary:hover:not(:disabled) {
	transform: translateY(-2px);
}

.athg-btn-ghost {
	background: transparent;
	color: var(--athg-text-muted);
	border: 1px dashed var(--athg-card-border);
}

.athg-btn-ghost:hover {
	color: var(--athg-text);
}

.athg-progress {
	margin-top: 1.1rem;
}

.athg-progress-bar {
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: var(--athg-input-bg);
	overflow: hidden;
}

.athg-progress-fill {
	height: 100%;
	width: 0%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--athg-primary-1), var(--athg-primary-2), var(--athg-primary-3));
	background-size: 200% 100%;
	animation: athg-shimmer 1.4s linear infinite, athg-fill 12s ease-out forwards;
}

@keyframes athg-shimmer {
	0% { background-position: 0% 0; }
	100% { background-position: 200% 0; }
}

@keyframes athg-fill {
	0% { width: 4%; }
	100% { width: 92%; }
}

.athg-progress-label {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	color: var(--athg-text-muted);
	text-align: center;
}

.athg-error {
	margin-top: 1rem;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	background: rgba(255, 45, 120, 0.1);
	border: 1px solid rgba(255, 45, 120, 0.3);
	color: #d6215c;
	font-size: 0.9rem;
}

.athg-widget.athg-dark .athg-error {
	color: #ff8fb3;
}

.athg-results {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.1rem;
	animation: athg-fade-in 0.4s ease;
}

@keyframes athg-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.athg-result-card {
	margin-bottom: 0;
}

.athg-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.athg-card-header h3 {
	margin: 0;
	font-size: 1.02rem;
	font-weight: 700;
}

.athg-card-actions {
	display: flex;
	gap: 0.4rem;
}

.athg-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--athg-card-border);
	background: rgba(123, 47, 247, 0.1);
	color: var(--athg-primary-2);
	border-radius: 10px;
	width: 34px;
	height: 34px;
	cursor: pointer;
	padding: 0;
	line-height: 0;
	transition: transform 0.15s ease, background 0.15s ease;
}

.athg-icon-btn svg {
	width: 16px;
	height: 16px;
	display: block;
	pointer-events: none;
}

.athg-icon-btn:hover {
	transform: scale(1.08);
	background: rgba(123, 47, 247, 0.18);
}

.athg-widget.athg-dark .athg-icon-btn {
	background: rgba(123, 47, 247, 0.22);
	color: #d9b8ff;
}

.athg-keywords-card,
.athg-tips-card {
	grid-column: 1 / -1;
}

.athg-keywords-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
}

.athg-keywords-grid h4 {
	margin: 0 0 0.4rem;
	font-size: 0.85rem;
	color: var(--athg-text-muted);
}

.athg-tips-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.6rem;
}

.athg-tips-list li {
	background: var(--athg-input-bg);
	border-radius: 12px;
	padding: 0.7rem 0.9rem;
	font-size: 0.92rem;
	line-height: 1.5;
}

.athg-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: linear-gradient(90deg, var(--athg-primary-1), var(--athg-primary-2));
	color: #fff;
	padding: 0.7rem 1.4rem;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 600;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	z-index: 9999;
	animation: athg-toast-in 0.25s ease;
}

@keyframes athg-toast-in {
	from { opacity: 0; transform: translate(-50%, 10px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 600px) {
	.athg-widget {
		padding: 1rem;
		margin: 1rem auto;
	}
	.athg-header {
		flex-direction: column;
	}
	.athg-actions-row {
		flex-direction: column;
	}
	.athg-btn {
		width: 100%;
		text-align: center;
	}
}
