/* UN Ambassador — Dashboard styles
 *
 * Rule of thumb: custom CSS is reserved for creative, bespoke components
 * (medallions, progress bar, wallet/history card layouts, CSS-only tabs,
 * pills, modal). Everything that is just text (headings, paragraphs,
 * <small>, <strong>, lists, tables) inherits from the active theme so
 * font, color and spacing changes propagate automatically.
 *
 * If you catch yourself writing `font-size`, `color`, or `font-weight`
 * on plain text: stop. Use semantic HTML and let the theme do its job.
 */

:root {
	--un-accent:        #a87a81;
	--un-accent-deep:   #6d4048;
	--un-accent-soft:   #f0e6e8;
	--un-gold:          #c9a06a;
	--un-gold-light:    #f4d9a8;
	--un-section-border: #ebe2e4;
}

/* -------------------------------------------------------------------------
 * Dashboard shell — just grouping, no typography.
 * ---------------------------------------------------------------------- */
.un-ambassador-dashboard {
	max-width: 860px;
	margin: 0 auto;
}

/* Theme styles button.button as black bg + white text, but a.button inherits
 * link color (black) → invisible "black on black" text. Force white text on
 * any .button inside the ambassador dashboard scope. */
.un-ambassador-dashboard a.button,
.un-ambassador-dashboard .button {
	color: #fff;
}
.un-ambassador-dashboard a.button:hover,
.un-ambassador-dashboard .button:hover {
	color: #fff;
	opacity: 0.9;
}
.un-ambassador-dashboard > section {
	margin-bottom: 1.4em;
	padding: 1.8em 2em;
	background: #fff;
	border: 1px solid var(--un-section-border);
	border-radius: 12px;
}

/* -------------------------------------------------------------------------
 * Hero — bespoke layout merging tier + progression.
 * Only LAYOUT here, no typography overrides.
 * ---------------------------------------------------------------------- */
.un-hero__alert {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.7em 1em;
	margin-bottom: 1.2em;
	background: #fff4e6;
	border-left: 3px solid #ef6c00;
	border-radius: 4px;
}

.un-hero__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin-bottom: 1.6em;
	padding-bottom: 1em;
	border-bottom: 1px solid var(--un-section-border);
	flex-wrap: wrap;
}
.un-hero__header h2 { margin: 0; }
.un-hero__header p { margin: 0; }

.un-hero__body {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 2em;
	align-items: center;
}
@media (max-width: 640px) {
	.un-hero__body {
		grid-template-columns: 1fr;
		gap: 1.4em;
		justify-items: center;
		text-align: center;
	}
}

/* Current / next tier pillar (medallion + label + name, stacked) */
.un-hero__pillar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6em;
	text-align: center;
	min-width: 110px;
}
.un-hero__pillar p { margin: 0; line-height: 1.4; }

/* Progress column */
.un-hero__progress { min-width: 0; }
.un-hero__progress p { margin: 0.8em 0 0; }

.un-hero__stats {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1em;
	margin-bottom: 0.8em;
}
.un-hero__stat small { display: block; }
.un-hero__stat--target { text-align: right; }

/* Bespoke progress bar */
.un-hero__bar {
	height: 8px;
	background: var(--un-accent-soft);
	border-radius: 4px;
	overflow: hidden;
}
.un-hero__bar-fill {
	height: 100%;
	background: var(--un-accent);
	border-radius: 4px;
	transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* -------------------------------------------------------------------------
 * Medallions — flat typographic tier badges (creative, custom).
 * ---------------------------------------------------------------------- */
.un-medallion {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 1.7em;
	font-weight: 600;
	color: #fff;
	flex-shrink: 0;
}
.un-medallion__roman { line-height: 1; }

.un-medallion--junior         { background: #e4b5bc; color: #6d2d36; }
.un-medallion--influencer     { background: var(--un-accent); color: #fff; }
.un-medallion--influencer_pro { background: var(--un-accent-deep); color: #fff; }
.un-medallion--ambassador     { background: var(--un-gold); color: #4a2d0a; }
.un-medallion--reseller       { background: #2a2a2a; color: var(--un-gold-light); }

.un-medallion--ghost {
	background: transparent !important;
	color: #b0a0a3 !important;
	border: 2px dashed #d6c3c7;
}

/* -------------------------------------------------------------------------
 * Referral — two-column layout + copy row.
 * ---------------------------------------------------------------------- */
.un-two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.2em 1.8em;
}
@media (max-width: 600px) {
	.un-two-col { grid-template-columns: 1fr; }
}
.un-two-col p { margin: 0 0 0.4em; }
.un-copy-row {
	display: flex;
	gap: 0.4em;
	align-items: stretch;
	flex-wrap: nowrap;
}
.un-copy-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 38px;
	box-sizing: border-box;
	padding: 0 12px;
	border: 1px solid #e2d4d7;
	border-radius: 6px;
	background: #fff;
	font-family: monospace;
}
.un-copy-row .un-copy-btn {
	flex: 0 0 auto;
	height: 38px;
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Wallet — two-card grid.
 * ---------------------------------------------------------------------- */
.un-wallet__grid {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 1em;
	margin-top: 1em;
}
@media (max-width: 600px) {
	.un-wallet__grid { grid-template-columns: 1fr; }
}
.un-wallet__card {
	padding: 1.2em 1.4em;
	border-radius: 10px;
	background: #fff;
	border: 1px solid var(--un-section-border);
}
.un-wallet__card--available {
	border-color: var(--un-accent);
}
.un-wallet__card p { margin: 0; }
.un-wallet__card h4 { margin: 0.2em 0 0.6em; }

/* -------------------------------------------------------------------------
 * Publications — status + inline submit form.
 * ---------------------------------------------------------------------- */
.un-publications__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1em;
	margin-bottom: 0.6em;
}
.un-publications__header h3 { margin: 0; }
.un-publications__suspended {
	margin: 0 0 1.2em;
	padding: 0.8em 1.1em;
	background: #fbe9e7;
	border-left: 3px solid #c62828;
	border-radius: 4px;
}

/* Inline form: URL input + button in one row.
   !important used only to overpower theme WC rules that force
   max-width and text-transform: capitalize on the url input. */
.un-post-submit {
	display: flex;
	gap: 0.6em;
	flex-wrap: wrap;
	align-items: stretch;
	margin-top: 0.6em;
}
.un-post-submit input[type="url"] {
	flex: 1 1 auto !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	height: 42px;
	box-sizing: border-box;
	padding: 0 14px !important;
	margin: 0 !important;
	border: 1px solid #e2d4d7;
	border-radius: 6px;
	background: #fff;
	text-transform: none !important;
}
.un-post-submit input[type="url"]::placeholder {
	text-transform: none;
}
.un-post-submit input[type="url"]:focus {
	outline: none;
	border-color: var(--un-accent);
	box-shadow: 0 0 0 3px rgba(168, 122, 129, 0.15);
}
.un-post-submit button[type="submit"] {
	flex: 0 0 auto;
}
.un-form-feedback {
	flex-basis: 100%;
	margin: 0.4em 0 0;
}
@media (max-width: 540px) {
	.un-post-submit input[type="url"] { flex-basis: 100%; }
	.un-post-submit button[type="submit"] { flex-basis: 100%; }
}

/* -------------------------------------------------------------------------
 * Pills (posting status) — bespoke badge component.
 * ---------------------------------------------------------------------- */
.un-pill {
	display: inline-block;
	padding: 0.25em 0.85em;
	border-radius: 999px;
	font-weight: 600;
	white-space: nowrap;
}
.un-pill--green  { background: #e7f4e8; color: #2e7d32; }
.un-pill--orange { background: #fff3e0; color: #ef6c00; }
.un-pill--red    { background: #fbe9e7; color: #c62828; }

/* -------------------------------------------------------------------------
 * History — CSS-only tabs. Radio:checked ~ sibling label/panel.
 * ---------------------------------------------------------------------- */
.un-history__tabs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0;
	border-bottom: 1px solid var(--un-section-border);
	margin-top: 1em;
}
.un-history__tabs input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.un-history__tab {
	padding: 0.9em 0.6em;
	text-align: center;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	font-weight: 600;
	user-select: none;
}
.un-history__tab.is-empty { opacity: 0.5; }

.un-history__panel {
	display: none;
	grid-column: 1 / -1;
	padding-top: 1.2em;
}

#un-tab-pubs:checked   ~ label[for="un-tab-pubs"],
#un-tab-refs:checked   ~ label[for="un-tab-refs"],
#un-tab-ledger:checked ~ label[for="un-tab-ledger"] {
	color: var(--un-accent);
	border-bottom-color: var(--un-accent);
}
#un-tab-pubs:checked   ~ .un-history__panel--pubs,
#un-tab-refs:checked   ~ .un-history__panel--refs,
#un-tab-ledger:checked ~ .un-history__panel--ledger {
	display: block;
}

.un-history__panel table { width: 100%; }
/* Kill the last row border so it doesn't stack with the section border. */
.un-history__panel table tbody tr:last-child td,
.un-history__panel table tbody tr:last-child th {
	border-bottom: 0 !important;
}

/* Data-driven color tag on ledger rows (can't delegate — color comes
   from PHP based on ledger entry type). */
.un-ledger-type { font-weight: 600; }

/* -------------------------------------------------------------------------
 * CGU modal — bespoke overlay.
 * ---------------------------------------------------------------------- */
.un-cgu-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(61, 29, 36, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 1em;
}
.un-cgu-modal {
	background: #fff;
	max-width: 520px;
	width: 100%;
	padding: 2em;
	border-radius: 14px;
	max-height: 90vh;
	overflow-y: auto;
}
.un-cgu-content {
	background: #fbf4f6;
	padding: 1em 1.2em;
	border-radius: 8px;
	margin: 1em 0;
	border: 1px solid var(--un-section-border);
}

/* Screen-reader only helper */
.un-ambassador-dashboard .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Profile page — /[my-account-slug]/profil-ambassadeur/
   ========================================================================== */
.un-profile-page {
	max-width: 640px;
}

.un-profile-section {
	margin-top: 1.2em;
	padding: 1.5em;
	background: #fff;
	border: 1px solid var(--un-section-border, #ebe2e4);
	border-radius: 12px;
}

.un-profile-section h3 {
	margin: 0 0 .4em;
	font-size: 1.1rem;
}

.un-profile-hint {
	margin: 0 0 1.2em;
	color: #666;
	font-size: .9rem;
}

.un-avatar-uploader {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.un-avatar-frame {
	position: relative;
	width: 128px;
	height: 128px;
	border-radius: 50%;
	overflow: hidden;
	cursor: pointer;
	background: #f5f5f5;
	border: 2px solid var(--un-section-border, #ebe2e4);
	flex-shrink: 0;
}

.un-avatar-preview {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.un-avatar-hover {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: .85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	opacity: 0;
	transition: opacity .15s ease;
}

.un-avatar-frame:hover .un-avatar-hover,
.un-avatar-uploader.is-loading .un-avatar-hover {
	opacity: 1;
}

.un-avatar-uploader.is-loading .un-avatar-frame {
	pointer-events: none;
	opacity: .7;
}

.un-avatar-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
}

.un-avatar-feedback {
	flex-basis: 100%;
	margin: 0;
	font-size: .85rem;
	color: #666;
	min-height: 1.2em;
}

.un-avatar-feedback--error {
	color: #b00020;
}

/* My Looks — actions cell. Differentiate Modifier (primary) from Supprimer
   (discreet link) so the destructive action is visually distinct from the
   common edit action. Same-looking buttons led to mis-clicks where users
   trashed drafts thinking they were opening the edit form. */
.un-my-looks__actions {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.un-my-looks__btn-edit {
	font-weight: 600;
}

.un-my-looks__btn-delete {
	display: inline-block;
	padding: 4px 8px;
	color: #b00020;
	font-size: .85em;
	text-decoration: underline;
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: color 120ms ease;
}

.un-my-looks__btn-delete:hover,
.un-my-looks__btn-delete:focus {
	color: #800018;
	text-decoration: none;
}
