/* AI Social Content Generator Pro — Frontend Styles */

.ascg-app {
	--ascg-primary-1: #6a5cff;
	--ascg-primary-2: #ff5ca8;
	--ascg-accent: #14e0c4;
	--ascg-bg: #f5f6fb;
	--ascg-card-bg: rgba(255, 255, 255, 0.65);
	--ascg-card-border: rgba(255, 255, 255, 0.45);
	--ascg-text: #201f2b;
	--ascg-text-muted: #6b6a7a;
	--ascg-radius: 18px;
	--ascg-shadow: 0 10px 40px rgba(35, 25, 90, 0.12);
	position: relative;
	max-width: 980px;
	margin: 0 auto;
	padding: 32px 16px 64px;
	color: var(--ascg-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.ascg-app *,
.ascg-app *::before,
.ascg-app *::after {
	box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
	.ascg-app {
		--ascg-bg: #0f0f1a;
		--ascg-card-bg: rgba(30, 28, 46, 0.55);
		--ascg-card-border: rgba(255, 255, 255, 0.08);
		--ascg-text: #f2f1fb;
		--ascg-text-muted: #b1aec4;
		--ascg-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
	}
}

.ascg-app.ascg-theme-dark {
	--ascg-bg: #0f0f1a;
	--ascg-card-bg: rgba(30, 28, 46, 0.55);
	--ascg-card-border: rgba(255, 255, 255, 0.08);
	--ascg-text: #f2f1fb;
	--ascg-text-muted: #b1aec4;
	--ascg-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.ascg-hero {
	text-align: center;
	margin-bottom: 28px;
}

.ascg-hero__title {
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 800;
	margin: 0 0 8px;
	background: linear-gradient(120deg, var(--ascg-primary-1), var(--ascg-primary-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.ascg-hero__subtitle {
	margin: 0;
	color: var(--ascg-text-muted);
	font-size: 15px;
}

/* Card shell — glassmorphism */
.ascg-input-card,
.ascg-platform-card {
	background: var(--ascg-card-bg);
	border: 1px solid var(--ascg-card-border);
	border-radius: var(--ascg-radius);
	box-shadow: var(--ascg-shadow);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	padding: 24px;
	margin-bottom: 24px;
}

.ascg-input-textarea,
.ascg-output-textarea {
	width: 100%;
	resize: vertical;
	border-radius: 12px;
	border: 1px solid var(--ascg-card-border);
	background: rgba(255, 255, 255, 0.6);
	color: var(--ascg-text);
	padding: 14px 16px;
	font-size: 15px;
	line-height: 1.5;
	font-family: inherit;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ascg-theme-dark .ascg-input-textarea,
.ascg-theme-dark .ascg-output-textarea {
	background: rgba(255, 255, 255, 0.04);
}

.ascg-input-textarea:focus,
.ascg-output-textarea:focus {
	outline: none;
	border-color: var(--ascg-primary-1);
	box-shadow: 0 0 0 4px rgba(106, 92, 255, 0.18);
}

.ascg-platform-select {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.ascg-platform-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 999px;
	border: 1.5px solid var(--ascg-card-border);
	background: rgba(255, 255, 255, 0.4);
	font-size: 13.5px;
	font-weight: 700;
	color: var(--ascg-text-muted);
	cursor: pointer;
	transition: all 0.18s ease;
	user-select: none;
}

.ascg-theme-dark .ascg-platform-pill {
	background: rgba(255, 255, 255, 0.04);
}

.ascg-platform-pill input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.ascg-platform-pill:hover {
	border-color: var(--ascg-primary-1);
	color: var(--ascg-text);
}

.ascg-platform-pill--active {
	background: linear-gradient(120deg, var(--ascg-primary-1), var(--ascg-primary-2));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 6px 16px rgba(106, 92, 255, 0.3);
}

.ascg-same-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--ascg-text-muted);
	margin-bottom: 14px;
	cursor: pointer;
	user-select: none;
}

.ascg-same-toggle input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--ascg-primary-1);
	cursor: pointer;
}

.ascg-topic-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--ascg-text-muted);
	margin-bottom: 6px;
}

.ascg-topic-group {
	margin-bottom: 14px;
}

.ascg-topic-group:last-child {
	margin-bottom: 0;
}

.ascg-topic-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4px;
}

.ascg-topic-label .ascg-platform-icon {
	width: 20px;
	height: 20px;
	font-size: 11px;
	border-radius: 6px;
}

.ascg-topic-label .ascg-platform-icon--youtube { background: linear-gradient(135deg, #ff4b4b, #ff8a5b); }
.ascg-topic-label .ascg-platform-icon--instagram { background: linear-gradient(135deg, #d62976, #fa7e1e, #feda75); }
.ascg-topic-label .ascg-platform-icon--facebook { background: linear-gradient(135deg, #1877f2, #4facfe); }

.ascg-input-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

/* Buttons */
.ascg-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: none;
	border-radius: 999px;
	padding: 11px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	white-space: nowrap;
}

.ascg-btn:active {
	transform: scale(0.97);
}

.ascg-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.ascg-btn--primary {
	background: linear-gradient(120deg, var(--ascg-primary-1), var(--ascg-primary-2));
	color: #fff;
	box-shadow: 0 8px 20px rgba(106, 92, 255, 0.35);
}

.ascg-btn--primary:hover:not(:disabled) {
	box-shadow: 0 10px 26px rgba(106, 92, 255, 0.45);
}

.ascg-btn--secondary {
	background: linear-gradient(120deg, #14e0c4, #4facfe);
	color: #06261f;
	box-shadow: 0 8px 20px rgba(20, 224, 196, 0.3);
}

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

.ascg-btn--outline {
	background: transparent;
	color: var(--ascg-primary-1);
	border: 1.5px solid var(--ascg-primary-1);
}

.ascg-btn--small {
	padding: 7px 14px;
	font-size: 12.5px;
}

.ascg-icon-btn {
	background: rgba(120, 110, 255, 0.12);
	border: none;
	border-radius: 8px;
	width: 32px;
	height: 32px;
	cursor: pointer;
	color: var(--ascg-primary-1);
	font-size: 15px;
	line-height: 1;
	transition: background 0.15s ease, transform 0.15s ease;
}

.ascg-icon-btn:hover {
	background: rgba(120, 110, 255, 0.22);
}

.ascg-icon-btn:active {
	transform: scale(0.92);
}

/* Progress / loading */
.ascg-progress {
	margin-top: 18px;
}

.ascg-progress__bar {
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: rgba(120, 110, 255, 0.15);
	overflow: hidden;
}

.ascg-progress__fill {
	height: 100%;
	width: 40%;
	border-radius: 999px;
	background: linear-gradient(120deg, var(--ascg-primary-1), var(--ascg-primary-2), var(--ascg-accent));
	background-size: 200% 100%;
	animation: ascg-loading-slide 1.1s ease-in-out infinite, ascg-gradient-move 2.4s linear infinite;
}

@keyframes ascg-loading-slide {
	0% { margin-left: -40%; }
	50% { margin-left: 60%; }
	100% { margin-left: -40%; }
}

@keyframes ascg-gradient-move {
	0% { background-position: 0% 50%; }
	100% { background-position: 200% 50%; }
}

.ascg-progress__label {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--ascg-text-muted);
	text-align: center;
}

/* Results */
.ascg-results {
	display: grid;
	gap: 24px;
}

.ascg-platform-card {
	animation: ascg-fade-in-up 0.4s ease both;
}

@keyframes ascg-fade-in-up {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

.ascg-platform-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.ascg-platform-card__header h3 {
	margin: 0;
	font-size: 19px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ascg-platform-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}

.ascg-platform-card--youtube .ascg-platform-icon { background: linear-gradient(135deg, #ff4b4b, #ff8a5b); }
.ascg-platform-card--instagram .ascg-platform-icon { background: linear-gradient(135deg, #d62976, #fa7e1e, #feda75); }
.ascg-platform-card--facebook .ascg-platform-icon { background: linear-gradient(135deg, #1877f2, #4facfe); }

.ascg-field {
	margin-bottom: 16px;
}

.ascg-field:last-child {
	margin-bottom: 0;
}

.ascg-field__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.ascg-field__label-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
}

.ascg-field-tick {
	width: 15px;
	height: 15px;
	accent-color: var(--ascg-primary-1);
	cursor: pointer;
	flex-shrink: 0;
}

.ascg-field__header label {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--ascg-text-muted);
}

.ascg-field__actions {
	display: flex;
	gap: 6px;
}

/* Toasts */
.ascg-toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 320px;
}

.ascg-toast {
	background: #1f1f2e;
	color: #fff;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 13.5px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	animation: ascg-toast-in 0.25s ease both;
}

.ascg-toast--error {
	background: linear-gradient(120deg, #c0392b, #e74c3c);
}

.ascg-toast--success {
	background: linear-gradient(120deg, #1a936f, #14e0c4);
}

.ascg-toast.ascg-toast--out {
	animation: ascg-toast-out 0.25s ease forwards;
}

@keyframes ascg-toast-in {
	from { opacity: 0; transform: translateX(24px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes ascg-toast-out {
	from { opacity: 1; transform: translateX(0); }
	to { opacity: 0; transform: translateX(24px); }
}

/* Responsive */
@media (max-width: 600px) {
	.ascg-input-card,
	.ascg-platform-card {
		padding: 18px;
		border-radius: 14px;
	}

	.ascg-input-actions {
		flex-direction: column;
	}

	.ascg-btn {
		width: 100%;
		justify-content: center;
	}

	.ascg-toast-container {
		left: 12px;
		right: 12px;
		max-width: none;
	}
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
