/* Roblox Code Post Generator — front-end styling for generated posts */

.rcp-codes-wrapper {
	--rcp-green: #1b9e5a;
	--rcp-green-bg: #e6f7ee;
	--rcp-red: #c53030;
	--rcp-red-bg: #fdecec;
	--rcp-border: #e4e4e7;
	--rcp-bg-soft: #fafafa;
	--rcp-accent: #6c4bf4;
	--rcp-accent-soft: #f1ecff;
	--rcp-accent-ink: #4c2fc4;
	font-size: 16px;
	line-height: 1.6;
}

.rcp-codes-wrapper h2 {
	margin-top: 2.2em;
	scroll-margin-top: 90px;
}

.rcp-intro {
	font-size: 1.08em;
}

/* Quick facts strip */
.rcp-quickfacts {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	background: var(--rcp-bg-soft);
	border: 1px solid var(--rcp-border);
	border-radius: 14px;
	padding: 18px 20px;
	margin: 20px 0;
}
.rcp-quickfacts-item {
	display: flex;
	flex-direction: column;
	min-width: 110px;
}
.rcp-qf-num {
	font-size: 1.6em;
	font-weight: 700;
	color: var(--rcp-accent);
}
.rcp-qf-date {
	font-size: 1.05em;
}
.rcp-qf-label {
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
}
.rcp-qf-cta {
	margin-left: auto;
	justify-content: center;
}
.rcp-play-btn {
	display: inline-block;
	background: var(--rcp-accent);
	color: #fff !important;
	padding: 10px 18px;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none !important;
	white-space: nowrap;
}
.rcp-play-btn:hover { opacity: 0.9; }

/* Table of contents */
.rcp-toc {
	font-size: 0.92em;
	background: #f4f2ff;
	border-left: 4px solid var(--rcp-accent);
	padding: 10px 16px;
	border-radius: 6px;
	margin-bottom: 20px;
}
.rcp-toc a { text-decoration: none; }
.rcp-toc a:hover { text-decoration: underline; }

/* Code list — "redemption ticket" treatment
   Each code reads as a ticket you tear off and redeem: a colored spine
   marks active vs. expired at a glance, the code itself sits in a bold
   monospace chip (the one bold move in this component), and status is
   shown as a live pulse for active codes or a rotated ink-stamp for
   expired ones — rather than a generic uppercase pill. Rendered as plain
   divs (not a <table>) so it can't inherit or clash with a theme's own
   ".entry-content table/td" styling. */
.rcp-codes-wrapper .rcp-codes-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0 8px;
}

.rcp-codes-wrapper .rcp-ticket {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	background: #fff;
	border: 1px solid var(--rcp-border);
	border-radius: 12px;
	padding: 14px 20px 14px 22px;
	overflow: hidden;
}
.rcp-codes-wrapper .rcp-ticket::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 5px;
	background: var(--rcp-green);
}
.rcp-codes-wrapper .rcp-ticket:hover { background: #fbfbfe; }

.rcp-codes-wrapper .rcp-ticket-expired {
	background: var(--rcp-bg-soft);
}
.rcp-codes-wrapper .rcp-ticket-expired::before { background: #c7cad1; }
.rcp-codes-wrapper .rcp-ticket-expired:hover { background: var(--rcp-bg-soft); }

.rcp-codes-wrapper .rcp-ticket-body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	flex: 1 1 auto;
	min-width: 0;
}

.rcp-codes-wrapper .rcp-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: var(--rcp-accent-soft);
	color: var(--rcp-accent-ink);
	padding: 7px 12px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 1.02em;
	letter-spacing: 0.01em;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #ded4ff;
	max-width: 100%;
	transition: transform 0.12s ease, background-color 0.12s ease;
}
.rcp-codes-wrapper .rcp-code:hover { background: #e6ddff; transform: translateY(-1px); }
.rcp-codes-wrapper .rcp-code.rcp-code-copied {
	background: var(--rcp-accent);
	color: #fff;
	border-color: var(--rcp-accent);
	transform: none;
}
.rcp-codes-wrapper .rcp-code-expired {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: #eceef1;
	color: #80838c;
	padding: 7px 12px;
	border-radius: 8px;
	font-weight: 700;
	text-decoration: line-through;
	cursor: default;
	max-width: 100%;
	border: 1px solid #dcdfe4;
}
.rcp-copy-icon { font-size: 0.82em; opacity: 0.75; }

.rcp-codes-wrapper .rcp-code-reward {
	color: #52525b;
	font-size: 0.95em;
}

/* Status: a live pulse for codes that work right now... */
.rcp-codes-wrapper .rcp-ticket-status {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.86em;
	font-weight: 600;
	white-space: nowrap;
}
.rcp-codes-wrapper .rcp-ticket-status-active { color: #157a41; }
.rcp-codes-wrapper .rcp-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rcp-green);
	box-shadow: 0 0 0 3px var(--rcp-green-bg);
	animation: rcp-pulse 2s ease-in-out infinite;
}
@keyframes rcp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
	.rcp-codes-wrapper .rcp-status-dot { animation: none; }
}

/* ...and a crooked ink stamp for the ones that don't. */
.rcp-codes-wrapper .rcp-ticket-status-expired {
	position: absolute;
	top: 10px;
	right: 14px;
	margin-left: 0;
	color: var(--rcp-red);
	opacity: 0.6;
	border: 2px solid currentColor;
	border-radius: 5px;
	padding: 1px 8px;
	font-size: 0.72em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transform: rotate(-7deg);
	pointer-events: none;
}

.rcp-hint {
	font-size: 0.85em;
	color: #71717a;
	margin-top: 0;
}

/* Steps / FAQ */
.rcp-steps li { margin-bottom: 8px; }
.rcp-steps code {
	background: #f4f4f5;
	border: 1px solid var(--rcp-border);
	border-radius: 5px;
	padding: 1px 6px;
	font-size: 0.92em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: #3f3f46;
}
.rcp-note {
	font-size: 0.9em;
	background: #fff8e6;
	border: 1px solid #f5e2a3;
	padding: 10px 14px;
	border-radius: 8px;
}

.rcp-faq-item {
	border: 1px solid var(--rcp-border);
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 10px;
}
.rcp-faq-item summary {
	font-weight: 600;
	cursor: pointer;
}
.rcp-faq-item p { margin-bottom: 0; margin-top: 8px; }

.rcp-source-note {
	font-size: 0.82em;
	color: #a1a1aa;
	border-top: 1px solid var(--rcp-border);
	padding-top: 12px;
	margin-top: 30px;
}

/* Small/medium screens (phones in portrait and landscape, plus small
   tablets): let the reward text drop to its own line and give the
   expired stamp a bit more breathing room, instead of forcing everything
   onto one cramped line. Since the ticket is already div-based (not a
   table), no display/structure hack is needed — just spacing/wrap. */
@media (max-width: 680px) {
	.rcp-codes-wrapper .rcp-ticket { padding: 14px 16px 14px 18px; }
	.rcp-codes-wrapper .rcp-ticket-expired { padding-top: 30px; }
	.rcp-codes-wrapper .rcp-code-reward { flex-basis: 100%; }
	.rcp-codes-wrapper .rcp-ticket-status-active {
		margin-left: 0;
		flex-basis: 100%;
	}
	.rcp-codes-wrapper .rcp-code,
	.rcp-codes-wrapper .rcp-code-expired {
		max-width: 100%;
		white-space: normal;
		word-break: break-word;
		overflow-wrap: anywhere;
	}

	.rcp-qf-cta { margin-left: 0; width: 100%; }
}

/* Extra-tight phones: trim padding/font size a bit further. */
@media (max-width: 380px) {
	.rcp-codes-wrapper { font-size: 15px; }
	.rcp-codes-wrapper .rcp-ticket { padding: 12px 14px 12px 16px; }
	.rcp-codes-wrapper .rcp-code, .rcp-codes-wrapper .rcp-code-expired { padding: 5px 9px; font-size: 0.95em; }
	.rcp-quickfacts { padding: 14px 16px; gap: 10px; }
	.rcp-quickfacts-item { min-width: 90px; }
}

/* --- Admin preview panel --- */
.rcp-admin-wrap .rcp-preview-box {
	background: #fff;
	border: 1px solid var(--rcp-border);
	border-radius: 10px;
	padding: 16px 20px;
	max-width: 640px;
}
.rcp-admin-wrap .rcp-preview-box img { max-width: 120px; border-radius: 8px; float: right; }
.rcp-admin-wrap .notice-inline {
	padding: 10px 14px;
	border-radius: 8px;
	margin-top: 10px;
}
.rcp-admin-wrap .notice-inline.error { background: var(--rcp-red-bg); color: var(--rcp-red); }
.rcp-admin-wrap .notice-inline.success { background: var(--rcp-green-bg); color: var(--rcp-green); }
