/**
 * BDLD OSCOLA Citation Generator Styles
 * Native BDLD Theme Design System Integration
 * Colors: Penn Navy (#011F5B), Penn Red (#991B1F), Penn Cyan (#31BFF0)
 */

.bdld-cg-container {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	font-family: var(--bdld-font-main, 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	background: #ffffff;
	color: #1e293b;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 24px rgba(1, 31, 91, 0.06);
	padding: 2rem;
	margin: 2rem 0;
	box-sizing: border-box;
}
.bdld-cg-container * {
	box-sizing: border-box;
}

/* ── LEFT SIDEBAR ── */
.bdld-cg-sidebar {
	flex: 1 1 320px;
	min-width: 300px;
}
.bdld-cg-title {
	font-family: var(--bdld-font-serif, 'Source Sans 3', serif);
	text-align: left;
	font-size: 1.5rem;
	font-weight: 700;
	color: #011F5B;
	margin: 0 0 1.25rem;
	border-bottom: 2px solid #31BFF0;
	padding-bottom: 8px;
	display: inline-block;
}

/* ── AUTO-DETECT URL ── */
.bdld-cg-auto-url {
	display: flex;
	gap: 8px;
	margin-bottom: 1.5rem;
}
.bdld-cg-auto-url input {
	flex: 1;
	padding: 10px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.95rem;
	outline: none;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
	transition: border-color 0.2s, box-shadow 0.2s;
}
.bdld-cg-auto-url input:focus {
	border-color: #31BFF0;
	box-shadow: 0 0 0 3px rgba(49, 191, 240, 0.15);
}
.bdld-cg-auto-url button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #011F5B;
	color: #ffffff;
	border: none;
	padding: 0 18px;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
	transition: background 0.2s;
}
.bdld-cg-auto-url button:hover {
	background: #31BFF0;
	color: #011F5B;
}
.bdld-cg-auto-url button:disabled {
	opacity: 0.7;
	cursor: wait;
}

/* Spinner for auto-fill button */
.bdld-cg-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: bdld-spin 0.6s linear infinite;
}
@keyframes bdld-spin {
	to { transform: rotate(360deg); }
}

/* ── TYPE BUTTONS ── */
.bdld-cg-types {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 1.5rem;
}
.bdld-cg-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #334155;
	background: #ffffff;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
}
.bdld-cg-btn:hover {
	border-color: #011F5B;
	color: #011F5B;
	background: #f8fafc;
}
.bdld-cg-btn.active {
	background: #011F5B !important;
	color: #ffffff !important;
	border-color: #011F5B !important;
	box-shadow: 0 2px 8px rgba(1, 31, 91, 0.2);
}

.bdld-btn-navy { border-left: 3px solid #011F5B; }
.bdld-btn-red  { border-left: 3px solid #991B1F; }
.bdld-btn-cyan { border-left: 3px solid #31BFF0; }

/* ── FORM ── */
.bdld-cg-sidebar {
	flex: 1 1 340px;
	min-width: 0;
}
.bdld-cg-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	min-width: 0;
}
.bdld-cg-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	min-width: 0;
}
.bdld-cg-field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #475569;
	text-transform: none !important;
	letter-spacing: normal !important;
	word-break: break-word;
}
.bdld-cg-field input {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 0.9rem;
	outline: none;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
	transition: border-color 0.2s, box-shadow 0.2s;
	text-overflow: ellipsis;
}
.bdld-cg-field input::placeholder {
	color: #94a3b8;
	font-size: 0.85rem;
	opacity: 0.85;
}
.bdld-cg-field input:focus {
	border-color: #011F5B;
	box-shadow: 0 0 0 3px rgba(1, 31, 91, 0.1);
}
.bdld-cg-row {
	display: flex;
	gap: 10px;
	width: 100%;
	min-width: 0;
	flex-wrap: wrap;
}
.bdld-cg-row .bdld-cg-field {
	flex: 1 1 130px;
	min-width: 0;
}

/* ── RIGHT MAIN AREA ── */
.bdld-cg-main {
	flex: 2 1 450px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.bdld-cg-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #e2e8f0;
	padding-bottom: 1rem;
	flex-wrap: wrap;
	gap: 10px;
}
.bdld-cg-style-badge {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #011F5B;
}
.bdld-cg-copy-btn {
	background: #011F5B;
	color: #ffffff;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
	transition: background 0.2s, transform 0.1s;
}
.bdld-cg-copy-btn:hover { background: #31BFF0; color: #011F5B; }
.bdld-cg-copy-btn.is-copied { background: #31BFF0 !important; color: #011F5B !important; }
.bdld-cg-copy-btn:active { transform: scale(0.97); }

.bdld-cg-output-box {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 1.5rem;
	min-height: 120px;
	position: relative;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
	font-size: 1.05rem;
	line-height: 1.7;
	color: #1e293b;
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.bdld-cg-output-box i { font-style: italic; }
.bdld-cg-output-box a.bdld-cg-url {
	color: #0099CC;
	text-decoration: none;
	word-break: break-all;
}
.bdld-cg-output-box a.bdld-cg-url:hover {
	text-decoration: underline;
}

.bdld-cg-toast {
	position: absolute;
	bottom: 12px;
	right: 12px;
	background: #16a34a;
	color: #ffffff;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}
.bdld-cg-toast.show {
	opacity: 1;
	transform: translateY(0);
}

/* ── AUTO-FILL NOTICE ── */
.bdld-cg-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: #fffbe0;
	border: 1px solid #fef08a;
	border-left: 4px solid #991B1F;
	border-radius: 8px;
	padding: 14px 18px;
	font-family: var(--bdld-font-main, 'Source Sans 3', sans-serif);
	font-size: 0.92rem;
	line-height: 1.55;
	color: #854d0e;
}
.bdld-cg-notice-icon {
	font-size: 1.3rem;
	flex-shrink: 0;
	margin-top: 1px;
}
.bdld-cg-notice strong {
	display: block;
	margin-bottom: 2px;
	color: #713f12;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
	.bdld-cg-container {
		flex-direction: column;
		padding: 1.25rem;
		margin: 1.25rem 0;
		max-width: 100%;
		overflow-x: hidden;
	}
	.bdld-cg-sidebar, .bdld-cg-main {
		min-width: 100%;
	}
	.bdld-cg-auto-url {
		flex-direction: column;
	}
	.bdld-cg-auto-url button {
		padding: 10px;
		justify-content: center;
		width: 100%;
	}
	.bdld-cg-types {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
	.bdld-cg-btn {
		justify-content: flex-start;
	}
	.bdld-cg-row {
		flex-direction: column;
	}
	.bdld-cg-row .bdld-cg-field {
		flex: 1 1 auto;
	}
	.bdld-cg-output-box {
		font-size: 0.95rem;
		word-break: break-word;
		overflow-wrap: anywhere;
	}
}
