/* --- Base Setup & Variables --- */
:root {
	/* Colors from theme.json */
	--primary-neon: #ff33cc;
	--secondary-cyan: #33ffff;
	--violet: #a333ff;
	--ink: #000000;
	--panel-bg: rgba(0, 0, 0, 0.7);
	--text: #e0ffff;
	--muted-text: #9966ff;
	--top-bg: #0d0a1e;
	--bottom-bg: #000000;

	/* Effects from theme.json */
	--glow-main: 0 0 10px #ff33cc, 0 0 20px #33ffff;
	--glow-pink: 0 0 15px #ff33cc, 0 0 5px rgba(255, 51, 204, 0.5);
	--glow-cyan: 0 0 15px #33ffff, 0 0 5px rgba(51, 255, 255, 0.5);
	--panel-radius: 16px;
	--button-radius: 28px;
	--backdrop-blur: 12px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* --- Galaxy Background --- */
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Helvetica, Arial, sans-serif;
	/* Deep space gradient */
	background-image: linear-gradient(
		to bottom,
		var(--top-bg) 0%,
		var(--bottom-bg) 100%
	);
	background-color: var(--ink); /* Fallback */
	color: var(--text);
	min-height: 100vh;
	padding: 1.5rem;
	transition: background-color 0.3s;
	position: relative;
}

/* Background assets positioning fix */
#background-assets {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center bottom;
	background-repeat: no-repeat;
	opacity: 0.15;
	pointer-events: none;
	z-index: 0;
}

/* Ensure content is above background */
header,
main {
	position: relative;
	z-index: 1;
}

/* --- Typography and Neon Glow --- */
.main-title,
.subtitle {
	color: var(--secondary-cyan);
	/* Intense multi-layer glow */
	text-shadow: 0 0 5px var(--secondary-cyan), 0 0 10px var(--secondary-cyan),
		0 0 20px var(--secondary-cyan), 0 0 40px var(--primary-neon);
}
.main-title {
	font-size: clamp(2.5rem, 8vw, 4rem);
	letter-spacing: 0.15em;
	margin-bottom: 0.25rem;
}
.subtitle {
	font-size: clamp(0.75rem, 2vw, 1rem);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--primary-neon);
	text-shadow: 0 0 3px var(--primary-neon), 0 0 8px var(--primary-neon);
}

header {
	text-align: center;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
}

main {
	max-width: 800px;
	margin: 0 auto;
}

.view {
	display: none;
}
.view.active {
	display: block;
}

/* Hidden utility class */
.hidden {
	display: none !important;
}

/* --- Panel & Form Elements --- */
.panel {
	background: var(--panel-bg);
	/* New high-contrast glowing border */
	border: 2px solid var(--violet);
	box-shadow: 0 0 15px var(--violet) inset, 0 0 10px var(--secondary-cyan);
	border-radius: var(--panel-radius);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	backdrop-filter: blur(var(--backdrop-blur));
}

.panel-title,
.results-title {
	font-size: 1.25rem;
	color: var(--secondary-cyan);
	margin-bottom: 1rem;
	text-shadow: 0 0 5px var(--secondary-cyan);
	border-bottom: 1px dashed var(--muted-text);
	padding-bottom: 0.5rem;
}

.form-field {
	margin-bottom: 1rem;
}

label {
	display: block;
	margin-bottom: 0.4rem;
	color: var(--text);
	font-size: 0.9rem;
	text-shadow: 0 0 2px var(--text);
}

input[type="text"],
textarea,
select {
	width: 100%;
	padding: 0.75rem;
	background: var(--ink);
	border: 1px solid var(--violet);
	color: var(--text);
	border-radius: 4px;
	transition: all 0.3s;
	/* Subtle inner glow */
	box-shadow: inset 0 0 5px var(--violet);
	-webkit-appearance: none;
}
input[type="text"]:focus,
textarea:focus,
select:focus {
	border-color: var(--primary-neon);
	outline: none;
	box-shadow: 0 0 8px var(--primary-neon), inset 0 0 5px var(--primary-neon);
}
select {
	appearance: none;
}
textarea {
	resize: vertical;
	min-height: 80px;
}
.radio-group,
.checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}
.radio-group label,
.checkbox-group label {
	display: flex;
	align-items: center;
	margin-bottom: 0;
	cursor: pointer;
	text-shadow: 0 0 2px var(--muted-text);
}
input[type="radio"],
input[type="checkbox"] {
	margin-right: 0.5rem;
	accent-color: var(--primary-neon);
}

/* --- Buttons --- */
.actions-row {
	display: flex;
	justify-content: flex-end;
	gap: 1rem;
	margin-top: 1.5rem;
	flex-wrap: wrap;
}
.btn {
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: var(--button-radius);
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

/* Primary Pink Glow Button */
.btn-primary_pink {
	background: var(--primary-neon);
	color: var(--ink);
	border: 2px solid var(--primary-neon);
	box-shadow: 0 0 5px var(--primary-neon), 0 0 20px var(--primary-neon);
}
.btn-primary_pink:hover {
	background: #ff66e5;
	box-shadow: 0 0 10px #ff66e5, 0 0 30px #ff66e5;
}

/* Outline Cyan Glow Button */
.btn-outline_cyan {
	background: transparent;
	color: var(--secondary-cyan);
	border: 2px solid var(--secondary-cyan);
	box-shadow: 0 0 5px var(--secondary-cyan), 0 0 15px var(--secondary-cyan);
}
.btn-outline_cyan:hover {
	background: rgba(51, 255, 255, 0.1);
	box-shadow: 0 0 10px #33ffff, 0 0 30px #33ffff;
}

/* Outline Pink Glow Button (Back to Generator) */
.btn-outline_pink {
	background: transparent;
	color: var(--primary-neon);
	border: 2px solid var(--primary-neon);
	box-shadow: 0 0 5px var(--primary-neon), 0 0 15px var(--primary-neon);
}
.btn-outline_pink:hover {
	background: rgba(255, 51, 204, 0.1);
	box-shadow: 0 0 10px #ff33cc, 0 0 30px #ff33cc;
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

/* --- Loading Overlay --- */
#loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: 100;
	text-align: center;
	/* Applying the glow to the loading text */
	text-shadow: var(--glow-main);
}
#loading-overlay.hidden {
	display: none;
}
.spinner {
	width: 60px;
	height: 60px;
	border: 5px solid var(--violet);
	border-top-color: var(--secondary-cyan); /* Spinner is now cyan */
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 1rem;
	/* Glow around the spinner */
	box-shadow: 0 0 15px var(--secondary-cyan), 0 0 5px var(--primary-neon);
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* --- Results View --- */
.results-box {
	margin-bottom: 1.5rem;
}
.results-title {
	/* Inherits styling from panel-title */
	margin-bottom: 0.75rem;
}
.results-content {
	background: rgba(0, 0, 0, 0.4);
	/* Glowing border for content box */
	border: 1px solid var(--secondary-cyan);
	box-shadow: 0 0 10px var(--secondary-cyan);
	border-radius: 8px;
	padding: 1rem;
	min-height: 150px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.results-content p {
	line-height: 1.6;
	/* Subtle text glow for readability */
	text-shadow: 0 0 1px var(--text);
}

/* Dynamic Forms */
.dynamic-form-purpose {
	font-style: italic;
	color: var(--muted-text);
	text-shadow: 0 0 2px var(--muted-text);
	margin-bottom: 1rem;
	padding: 0.5rem;
	border-left: 3px solid var(--primary-neon);
}

/* Dynamic form wrapper */
.dynamic-form-wrapper {
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--violet);
	border-radius: 8px;
	padding: 1rem;
}

/* New Hook Title Style */
#box_hook_title .results-content {
	text-align: center;
	font-size: clamp(1.25rem, 5vw, 1.75rem);
	font-weight: bold;
	color: var(--primary-neon);
	border-color: var(--primary-neon);
	box-shadow: 0 0 10px var(--primary-neon), 0 0 20px var(--primary-neon);
}

/* Copy button container */
#copy_button_container {
	display: flex;
	justify-content: center;
	margin: 1rem 0;
}

/* Pagination */
.pagination-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 0;
	color: var(--muted-text);
	text-shadow: 0 0 3px var(--muted-text);
}

/* Media Query for smaller screens */
@media (max-width: 600px) {
	body {
		padding: 1rem;
	}

	.actions-row {
		flex-direction: column;
	}
	.btn {
		width: 100%;
		margin: 0;
	}

	.main-title {
		font-size: 2rem;
	}

	.subtitle {
		font-size: 0.7rem;
	}
}
