/* ===================== */
/* CSS Variables         */
/* ===================== */
:root {
	/* Load Clash Display from Google Fonts for display headings */
}
@import url("https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;600;700;800&display=swap");
:root {
	/* === Main Branding Colors === */
	--brand-navy: #1c1934;
	--brand-white: #ffffff;
	--brand-orange: #ff754a;
	--brand-yellow: #ffbf44;
	--brand-main-gradient: linear-gradient(90deg, #ff754a 0%, #ffbf44 100%);
	--brand-black: #121212;
	--brand-purple: #b037ce;
	--brand-indigo: #7558ff;
	--brand-cyan: #73e8e2;
	--brand-secondary-gradient: linear-gradient(90deg, #b037ce 0%, #5030eb 50%, #4032e6 100%);

	/* === Opacity & Gradients === */
	--brand-main-bg-10: rgba(255, 117, 74, 0.1);
	--brand-main-bg-20: rgba(255, 117, 74, 0.2);
	--brand-main-bg-80: rgba(255, 117, 74, 0.8);
	--brand-secondary-bg-10: rgba(115, 232, 226, 0.1);
	--brand-secondary-bg-30: rgba(115, 232, 226, 0.3);
	--brand-secondary-bg-60: rgba(115, 232, 226, 0.6);
	--brand-navy-bg-95: rgba(28, 25, 52, 0.95);
	--brand-main-gradient-20: linear-gradient(45deg, rgba(255, 117, 74, 0.2), rgba(255, 191, 68, 0.2));
	--brand-shadow-main: rgba(255, 117, 74, 0.3);
	--brand-shadow-secondary: rgba(255, 191, 68, 0.5);

	/* === General Theme === */
	--primary-bg: linear-gradient(135deg, #1c1934 0%, #121212 100%);
	--accent-color: #73e8e2;
	--highlight-color: #ffbf44;
	--border-radius: 12px;
	--box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

	/* === Button Theme === */
	--button-bg: linear-gradient(45deg, rgba(117, 88, 255, 0.4), rgba(64, 50, 230, 0.4));
	--button-bg-hover: linear-gradient(45deg, rgba(117, 88, 255, 0.6), rgba(64, 50, 230, 0.6));
	--button-shadow: 0 2px 12px var(--brand-shadow-main);
	--button-radius: 20px;
	--button-padding: 10px 18px;
	--button-font-size: 14px;

	--side-bar-width: 250px;

	/* === Typography === */
	--font-heading: "Clash Display", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

/* ===================== */
/* Universal Loading Spinner */
/* ===================== */
@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}
.loading-spinner {
	display: inline-block;
	box-sizing: border-box;
	border: 0.15em solid var(--brand-main-bg-10, #eee);
	border-top: 0.15em solid var(--brand-cyan, #73e8e2);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	width: 2.5em;
	height: 2.5em;
	min-width: 24px;
	min-height: 24px;
	max-width: 128px;
	max-height: 128px;
}
.loading-spinner.centered {
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Inline success tick shown after saving settings */
.settings-save-tick {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	padding: 6px 12px !important;
	background: rgba(16, 185, 129, 0.08) !important;
	color: var(--brand-white) !important;
	font-weight: 600 !important;
	border-radius: 20px !important;
	opacity: 0 !important;
	position: absolute !important;
	bottom: 12px !important;
	left: 50% !important;
	transform: translateX(-50%) translateY(8px) !important;
	transition:
		opacity 240ms ease-in-out,
		transform 240ms ease-in-out !important;
	z-index: 9999 !important;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25) !important;
	pointer-events: none !important;
}
.settings-save-tick .tick-icon {
	width: 36px !important;
	height: 36px !important;
	border-radius: 50% !important;
	background: #16a34a !important;
	color: #ffffff !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 18px !important;
	font-weight: 700 !important;
}
.settings-save-tick .settings-save-text {
	font-size: 14px !important;
	color: var(--brand-white) !important;
}
.settings-save-tick.show {
	opacity: 1 !important;
	transform: translateX(-50%) translateY(0) !important;
}

/* ===================== */
/* Reset & Base Styles   */
/* ===================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
main {
	display: flex;
	width: 100vw;
	min-height: 100vh;
	flex-direction: column;
	/* anchor content to the top so pages with long content scroll normally */
	justify-content: flex-start;
	width: 100%;
}
body {
	font-family: var(--font-body);
	background: var(--primary-bg);
	min-height: 100vh;
}
footer {
	color: var(--brand-secondary-bg-60);
	font-size: 14px;
	/* height: 40px; */
	text-align: center;
	z-index: 100;
}

/* ===================== */
/* Layout & Containers   */
/* ===================== */
.main-content {
	margin-left: var(--side-bar-width);
	width: calc(100% - var(--side-bar-width));
	min-height: 100vh;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	/* allow the whole page to scroll naturally when inner boxes use their own overflow */
	overflow: visible;
	padding: 1rem 1rem;
}
.page {
	display: flex;
	flex-direction: column;
	width: 100%;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	/* overflow: hidden; */
}
.container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.form-container {
	width: 100%;
	max-width: 840px;
	margin: 9px auto;
	background: linear-gradient(180deg, rgba(28, 25, 52, 0.6), rgba(18, 18, 18, 0.55));
	border: 1px solid rgba(255, 255, 255, 0.04);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	position: relative;
}

/* let page content area handle scrolling internally */
.content {
	flex: 1 1 auto;
	overflow: auto;
	padding: 0;
}

/* ===================== */
/* Typography		     */
/* ===================== */
h1 {
	color: var(--brand-white);
	font-size: 3rem;
	font-weight: 600;
	font-family: var(--font-heading);
	font-style: normal;
	letter-spacing: 0.02em;
	line-height: 78px;
	margin-bottom: 1rem;
}
h2 {
	font-size: 1.75rem;
	font-weight: 300;
	font-family: var(--font-heading);
	color: var(--brand-cyan);
	margin-bottom: 1rem;
}
h3 {
	font-size: 1.1rem;
	font-family: var(--font-heading);
	color: var(--brand-white);
	margin-bottom: 0.75rem;
}
h4 {
	font-size: 1.1rem;
	font-family: var(--font-heading);
	color: var(--brand-white);
	margin-bottom: 0.75rem;
}
p {
	font-family: var(--font-body);
	color: var(--brand-white);
	font-size: 1rem;
	line-height: 1.5;
	margin-bottom: 1rem;
}

/* ===================== */
/* Utility Classes       */
/* ===================== */
.hero {
	margin-bottom: 3rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hero p {
	color: var(--brand-main-bg-80);
	font-size: 1.1rem;
	font-weight: 300;
}
.centered {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.hidden {
	display: none !important;
}
.visible {
	display: block !important;
}

/* ===================== */
/* Generalized Button    */
/* ===================== */
.button {
	background: var(--button-bg);
	color: var(--brand-white);
	border: 1.5px solid var(--brand-secondary-bg-60);
	border-radius: var(--button-radius);
	padding: var(--button-padding);
	font-size: var(--button-font-size);
	font-family: var(--font-body);
	cursor: pointer;
	transition:
		background 0.2s,
		box-shadow 0.2s,
		border 0.2s;
	outline: none;
	display: inline-block;
	text-align: center;
	text-decoration: none;
	letter-spacing: 0.03em;
	user-select: none;
	min-width: 2.5em;
	min-height: 2.2em;
	line-height: 1.2;
	position: relative;
	overflow: hidden;
}
.button:hover,
.button:focus {
	background: var(--button-bg-hover);
	transform: translateY(-2px);
}
.button[disabled],
.button.disabled {
	opacity: 0.6;
	cursor: not-allowed;
	box-shadow: none;
	pointer-events: none;
}

/* Make the primary submit/update buttons in settings forms larger and more prominent */
.form-container button[type="submit"],
.form-container .org-actions button[type="submit"],
.form-container .org-actions .button {
	font-size: 16px !important;
	padding: 12px 20px !important;
	min-width: 140px !important;
	min-height: 40px !important;
	border-radius: 10px !important;
}

/* Search bar shared style (match insights search appearance) */
.search-container {
	position: relative;
	margin: 0 auto;
	margin-bottom: 2rem;
	max-width: 900px;
	width: 100%;
}
.search-box {
	width: 100%;
	padding: 20px 24px;
	font-size: 16px;
	border: none;
	border-radius: 15px;
	outline: none;
	background: var(--brand-white);
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 32px var(--brand-shadow-main);
	color: var(--brand-black);
	resize: vertical;
	min-height: 80px;
	font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
	line-height: 1.4;
}
.search-box:focus {
	background: var(--brand-white);
	box-shadow:
		0 12px 40px var(--brand-shadow-main),
		0 0 0 2px var(--brand-shadow-secondary);
}
.search-box::placeholder {
	color: var(--brand-indigo);
	font-weight: 300;
}
.search-button {
	position: absolute;
	right: 8px;
	bottom: 8px;
	background: var(--brand-main-gradient);
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.search-button:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.search-button svg {
	width: 18px;
	height: 18px;
	fill: var(--brand-white);
}

/* ===================== */
/* Animations            */
/* ===================== */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
/* `spin` keyframes defined earlier near the spinner section */
