/*
 * News Card Generator — বাটন ও মডাল UI।
 * থিমের সাথে সংঘর্ষ এড়াতে সব কিছু .ncg- প্রিফিক্সে স্কোপ করা।
 */

/* =====================================================================
 * বাটন
 *
 * বাটনের স্টাইল এখানে নেই — সেটি PHP থেকে ইনলাইন আকারে বের হয়
 * (includes/class-ncg-frontend.php -> button_css())। কারণ ক্যাশিং প্লাগিন
 * পুরনো স্টাইলশিট ধরে রাখলেও যেন বাটন ঠিক দেখায়, আর থিমের লিংক-স্টাইল
 * যেন ওভাররাইড করতে না পারে।
 * ================================================================== */

/* =====================================================================
 * মডাল
 * ================================================================== */
.ncg-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(8, 15, 26, 0.78);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Hind Siliguri', 'Noto Sans Bengali', 'Segoe UI', sans-serif;
	overflow-y: auto;
}

.ncg-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.ncg-modal * {
	box-sizing: border-box;
}

.ncg-panel {
	position: relative;
	width: 100%;
	max-width: 440px;
	margin: auto;
	background: #10243f;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	color: #e8eef7;
	overflow: hidden;
	transform: translateY(14px) scale(0.98);
	transition: transform 0.22s ease;
}

.ncg-modal.is-open .ncg-panel {
	transform: none;
}

/* ---------- হেডার ---------- */
.ncg-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	background: #0c1c33;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ncg-panel__title {
	display: flex;
	align-items: baseline;
	gap: 7px;
	flex: 0 1 auto;
	min-width: 0;
	font-size: 15px;
	font-weight: 700;
	margin: 0;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
}

.ncg-panel__title span {
	font-size: 12px;
	font-weight: 500;
	opacity: 0.6;
}

.ncg-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #cfe0f5;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease;
}

.ncg-iconbtn:hover {
	background: rgba(255, 255, 255, 0.18);
}

.ncg-panel__tools {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* হেডারের প্রোমো লিংক */
.ncg-promo {
	flex: 0 1 auto;
	min-width: 0;
	padding: 5px 12px;
	border: 1px solid rgba(34, 176, 236, 0.45);
	border-radius: 999px;
	background: rgba(34, 176, 236, 0.12);
	color: #7fd3f7;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background 0.15s ease, color 0.15s ease;
}

.ncg-promo:hover {
	background: #22b0ec;
	border-color: #22b0ec;
	color: #05121d;
	text-decoration: none;
}

@media (max-width: 420px) {
	.ncg-panel__title {
		font-size: 13.5px;
	}

	.ncg-promo {
		font-size: 11px;
		padding: 4px 9px;
	}
}

/* ---------- প্রিভিউ ---------- */
.ncg-stage {
	padding: 18px 16px;
	display: flex;
	justify-content: center;
	min-height: 120px;
}

.ncg-frame {
	position: relative;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
	background: #fff;
}

.ncg-scaler {
	transform-origin: top left;
}

/* ---------- লোডার ---------- */
.ncg-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 60px 20px;
	color: #b9cbe3;
	font-size: 14px;
}

.ncg-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid rgba(255, 255, 255, 0.18);
	border-top-color: #4ec3f7;
	border-radius: 50%;
	animation: ncg-spin 0.8s linear infinite;
}

@keyframes ncg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- কন্ট্রোল ---------- */
.ncg-controls {
	padding: 4px 18px 16px;
}

.ncg-field {
	margin-bottom: 14px;
}

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

.ncg-field__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 600;
	color: #cddcef;
	margin-bottom: 7px;
}

.ncg-field__value {
	font-weight: 500;
	opacity: 0.65;
	font-size: 12px;
}

.ncg-textarea {
	width: 100%;
	min-height: 70px;
	resize: vertical;
	padding: 10px 12px;
	border-radius: 9px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-size: 14px;
	line-height: 1.6;
	font-family: inherit;
	outline: none;
}

.ncg-textarea:focus {
	border-color: #4ec3f7;
}

.ncg-range {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	outline: none;
	margin: 0;
	padding: 0;
}

.ncg-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #2aa7e8;
	border: 3px solid #0c1c33;
	cursor: pointer;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.ncg-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #2aa7e8;
	border: 3px solid #0c1c33;
	cursor: pointer;
}

.ncg-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.ncg-chip {
	flex: 1 1 auto;
	padding: 7px 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.05);
	color: #cddcef;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.ncg-chip.is-active {
	background: #2aa7e8;
	border-color: #2aa7e8;
	color: #04131f;
}

/* ---------- ফুটার ---------- */
.ncg-panel__foot {
	display: flex;
	gap: 10px;
	padding: 14px 18px 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ncg-action {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 11px 14px;
	border: 0;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease, opacity 0.15s ease;
}

.ncg-action:hover {
	filter: brightness(1.08);
	text-decoration: none;
}

.ncg-action[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.ncg-action--ghost {
	background: #5b6b7f;
	color: #fff;
}

.ncg-action--primary {
	background: #22b0ec;
	color: #05121d;
}

.ncg-action--share {
	background: #1f8f4e;
	color: #fff;
	flex: 0 0 auto;
	padding: 11px 16px;
}

/* ---------- নোট ও এরর ---------- */
.ncg-note {
	margin: 0 18px 14px;
	padding: 9px 12px;
	border-radius: 9px;
	background: rgba(255, 196, 61, 0.12);
	border: 1px solid rgba(255, 196, 61, 0.3);
	color: #ffd98a;
	font-size: 12.5px;
	line-height: 1.6;
}

.ncg-note--error {
	background: rgba(255, 85, 85, 0.12);
	border-color: rgba(255, 85, 85, 0.32);
	color: #ffb3b3;
}

.ncg-note--ok {
	background: rgba(46, 204, 113, 0.12);
	border-color: rgba(46, 204, 113, 0.3);
	color: #a7e9c4;
}

.ncg-hint-text {
	margin: 0 18px 14px;
	font-size: 12px;
	line-height: 1.7;
	color: #91a7c2;
	text-align: center;
}

/* ---------- রেজাল্ট ভিউ ---------- */
.ncg-result {
	padding: 18px 18px 0;
	text-align: center;
}

.ncg-result img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.ncg-hidden {
	display: none !important;
}

/* ---------- ইনফো ---------- */
.ncg-info {
	margin: 0 18px 14px;
	padding: 11px 13px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.06);
	font-size: 12.5px;
	line-height: 1.75;
	color: #bdd0e8;
}

.ncg-info ul {
	margin: 6px 0 0;
	padding-left: 18px;
}

body.ncg-locked {
	overflow: hidden;
}

@media (max-width: 480px) {
	.ncg-modal {
		padding: 10px;
	}

	.ncg-panel {
		max-width: 100%;
	}

	.ncg-controls {
		padding: 4px 14px 14px;
	}

	.ncg-panel__foot {
		padding: 12px 14px 16px;
	}
}
