/**
 * My Account — Licenses & Activations
 *
 * Enqueued only on the WooCommerce My Account "licenses" endpoint.
 */

/* ===== Section titles ===================================================== */

.adlice-section-title {
	font-size: 1.3em;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: #1a2a3d;
	margin: 24px 0 14px 0;
	padding: 0;
	border: 0;
}

.adlice-section-title.activations-title {
	margin-top: 40px;
}

/* ===== Expiration summary banner ========================================== */

.adlice-expiration-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	margin: 0 0 18px 0;
	border-radius: 8px;
	border: 1px solid #f0d3a1;
	background: linear-gradient(0deg, #fff7eb, #fff4e0);
	color: #6b4500;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.adlice-expiration-summary.is-expired {
	border-color: #f1bcbc;
	background: linear-gradient(0deg, #fff0f0, #ffe5e5);
	color: #7a1818;
}

.adlice-expiration-summary__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.7);
}

.adlice-expiration-summary__icon svg {
	width: 22px;
	height: 22px;
}

.adlice-expiration-summary__text {
	flex: 1 1 auto;
	font-size: 0.95em;
	line-height: 1.35;
}

.adlice-expiration-summary__text strong {
	font-weight: 700;
}

.adlice-expiration-summary__cta .button {
	margin: 0 !important;
}

/* ===== License cards ====================================================== */

.adlice-licenses-grid {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 24px;
}

.adlice-license-card {
	background: #ffffff;
	border-radius: 10px;
	border: 1px solid #e1e8f0;
	border-left: 4px solid #377fbf;
	box-shadow: 0 1px 3px rgba(15, 30, 55, 0.05), 0 1px 2px rgba(15, 30, 55, 0.04);
	padding: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.adlice-license-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(15, 30, 55, 0.10), 0 3px 6px rgba(15, 30, 55, 0.06);
	border-color: #c8d4e0;
}

/* Variant: expired / expiring cards get a redder/amber accent */
.adlice-license-card.is-expired   { border-left-color: #b31616; }
.adlice-license-card.is-expiring  { border-left-color: #c26700; }

/* Header: product + order — entire header is a toggle button */
.adlice-license-header {
	background: #377fbf;
	color: #ffffff;
	padding: 12px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 0;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	font: inherit;
	text-align: left;
	width: 100%;
	cursor: pointer;
}

.adlice-license-header:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: -3px;
}

.adlice-license-header__meta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* Short key tail in the header (shown only when collapsed).
   Specificity bumped past `.adlice-license-header *` so the dark text
   on the white pill doesn't get steamrolled to white. */
.adlice-license-header .adlice-key-tail {
	display: none;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: #ffffff;
	color: #1a2a3d !important;
	padding: 3px 9px;
	border-radius: 5px;
	font-size: 0.88em;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.2;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.adlice-card-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	opacity: 0.85;
	transition: transform 180ms ease, opacity 120ms ease;
}

.adlice-license-card.is-collapsed .adlice-card-chevron {
	transform: rotate(-90deg);
}

.adlice-license-card.is-collapsed .adlice-license-header .adlice-key-tail {
	display: inline-block;
}

/* The collapsible region: body + tags + footer wrapped together */
.adlice-card-collapsible {
	overflow: hidden;
	max-height: 2000px;
	opacity: 1;
	transition: max-height 240ms ease, opacity 180ms ease;
}

.adlice-license-card.is-collapsed .adlice-card-collapsible {
	max-height: 0;
	opacity: 0;
	pointer-events: none;
}

/* Slimmer left accent + bottom-radius when collapsed (visual tightening) */
.adlice-license-card.is-collapsed {
	border-bottom-color: #e1e8f0;
}

.adlice-license-card.is-collapsed .adlice-license-header {
	border-bottom: 0;
}

.adlice-license-header * {
	color: #ffffff !important;
}

.adlice-license-body {
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.adlice-license-footer {
	padding: 10px 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	border-top: 1px solid #f0f0f0;
}

/* Product / order header display */
.adlice-license-product {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 1em;
	font-weight: 600;
}

.adlice-license-product {
	gap: 12px;
	font-size: 1.05em;
	min-width: 0;
}

.adlice-license-product-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.adlice-license-product-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.18);
	overflow: hidden;
}

.adlice-license-product-icon--image img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	display: block;
}

.adlice-license-product-icon--initial {
	font-weight: 700;
	font-size: 1.1em;
	color: #ffffff !important;
	background: rgba(255, 255, 255, 0.22);
}

.adlice-license-product-icon svg {
	width: 22px;
	height: 22px;
}

/* Order chip in card header */
.adlice-license-order .adlice-order-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(0, 0, 0, 0.18);
	color: #ffffff !important;
	padding: 4px 9px;
	border-radius: 999px;
	font-size: 0.82em;
	font-weight: 600;
	text-decoration: none !important;
	line-height: 1;
}

.adlice-license-order .adlice-order-chip:hover {
	background: rgba(0, 0, 0, 0.28);
}

.adlice-license-order .adlice-order-chip svg {
	opacity: 0.8;
}

.adlice-license-order .adlice-order-chip.is-empty {
	background: rgba(255, 255, 255, 0.18);
	font-weight: 500;
}

/* Body rows */
.adlice-license-body {
	gap: 0;
	padding: 6px 20px;
}

.adlice-license-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.93em;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #eef2f7;
}

.adlice-license-row:last-child {
	border-bottom: 0;
}

.adlice-license-row .adlice-label {
	color: #5a6b7a;
	font-weight: 500;
}

.adlice-license-row .adlice-value {
	font-weight: 500;
	color: #1a2a3d;
	text-align: right;
}

.adlice-license-expiration-rel {
	color: #5a6b7a;
	font-weight: 400;
	font-size: 0.9em;
}

/* License key wrapper + reveal/copy controls */
.adlice-license-key-wrapper {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.adlice-license-key {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: #f5f7fa;
	border: 1px solid #e1e8f0;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 0.9em;
	letter-spacing: 0.02em;
	color: #2a3a4d;
}

.adlice-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid #c8d4e0;
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
	color: #3a5168;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.adlice-iconbtn:hover,
.adlice-iconbtn:focus-visible {
	background: #f0f6fc;
	border-color: #99b5d3;
	color: #1a4e8a;
	outline: none;
}

.adlice-iconbtn svg {
	width: 16px;
	height: 16px;
}

.adlice-iconbtn[aria-pressed="true"] {
	background: #d9eaff;
	border-color: #99b5d3;
}

/* Activations: progress bar + numeric pill */
.adlice-activation-cell {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.adlice-activation-bar {
	display: inline-block;
	width: 140px;
	height: 8px;
	background: #eef2f7;
	border-radius: 999px;
	overflow: hidden;
	vertical-align: middle;
}

.adlice-activation-bar__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	transition: width 220ms ease, background-color 220ms ease;
}

.adlice-activation-bar.is-ok .adlice-activation-bar__fill   { background: #1a8a4d; }
.adlice-activation-bar.is-near .adlice-activation-bar__fill { background: #d68a1a; }
.adlice-activation-bar.is-full .adlice-activation-bar__fill { background: #c2570d; }
.adlice-activation-bar.is-over .adlice-activation-bar__fill { background: #a31616; }

/* ===== Device tags row (inline activations) ============================== */

.adlice-device-tags-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 2px 0 10px 0;
	margin-top: -4px;
	border-bottom: 1px solid #eef2f7;
}

.adlice-device-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	padding: 3px 4px 3px 9px;
	background: #f5f7fa;
	border: 1px solid #e1e8f0;
	border-radius: 999px;
	font-size: 0.82em;
	color: #2a3a4d;
	line-height: 1.4;
}

.adlice-device-tag__dot {
	flex: 0 0 auto;
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #99a3ae;
}

.adlice-device-tag.adlice-platform-windows .adlice-device-tag__dot { background: #1a4e8a; }
.adlice-device-tag.adlice-platform-macos   .adlice-device-tag__dot { background: #5c3fa3; }
.adlice-device-tag.adlice-platform-linux   .adlice-device-tag__dot { background: #2e7a32; }

.adlice-device-tag__name {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.95em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 240px;
}

/* Unlink pill — hidden by default, revealed on tag hover/focus */
.adlice-device-tag__unlink {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 0;
	overflow: hidden;
	padding: 3px 0;
	border: 0;
	background: #c81e1e;
	color: #ffffff;
	border-radius: 999px;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
	cursor: pointer;
	opacity: 0;
	transition: max-width 180ms ease, padding 180ms ease, opacity 140ms ease, background-color 120ms ease;
}

.adlice-device-tag:hover .adlice-device-tag__unlink,
.adlice-device-tag:focus-within .adlice-device-tag__unlink {
	max-width: 120px;
	opacity: 1;
	padding: 3px 10px 3px 8px;
}

.adlice-device-tag__unlink:hover,
.adlice-device-tag__unlink:focus-visible {
	background: #a31616;
	outline: none;
}

.adlice-device-tag__unlink svg {
	flex: 0 0 auto;
}

.adlice-device-tag__unlink-label {
	display: inline-block;
}

/* When AJAX is in-flight */
.adlice-device-tag.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Subtle tint on the whole tag while hovering to hint at the action */
.adlice-device-tag:hover {
	border-color: #f1bcbc;
}

/* Activations pill (kept for unlimited case and beside the bar) */
.adlice-activation-pill {
	background: #e6f0ff;
	color: #1a4e8a;
	padding: 2px 7px;
	border-radius: 6px;
	font-size: 0.78em;
	font-weight: 600;
	display: inline-block;
	border: 1px solid #c8ddff;
}

.adlice-activation-pill.adlice-activation-near {
	background: #fff4e0;
	color: #c26700;
	border-color: #f2cf91;
}

.adlice-activation-pill.adlice-activation-full {
	background: #ffe5cc;
	color: #b34a00;
	border-color: #f0b48a;
}

.adlice-activation-pill.adlice-activation-over {
	background: #ffd6d6;
	color: #a31616;
	border-color: #f0a0a0;
}

/* Expiration badges */
.adlice-expiration-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 6px;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
}

.adlice-expiration-active { background: #e6f6ea; color: #1b7f3b; }
.adlice-expiration-soon { background: #fff4e0; color: #c26700; }
.adlice-expiration-expired { background: #ffe5e5; color: #b31616; }
.adlice-expiration-unknown { background: #edf0f5; color: #5a6475; }
.adlice-expiration-unlimited { background: #e6f6ea; color: #1b7f3b; }

/* ===== License footer buttons (actions) =================================== */

.woocommerce-account .adlice-license-footer .woocommerce-button.button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	box-shadow: none !important;
	text-decoration: none !important;
	text-transform: none;
	border-radius: 999px !important;
	margin: 0 6px 6px 0 !important;
	padding: 5px 14px !important;
	font-size: 0.86em !important;
	line-height: 1.2 !important;
	border-width: 1px !important;
	border-style: solid !important;
}

.woocommerce-account .adlice-license-footer .woocommerce-button.button .fa {
	display: inline-flex;
	align-items: center;
	font-size: 0.9em;
}

.adlice-action-primary {
	background: #0067c5 !important;
	color: #ffffff !important;
	border: 1px solid #0058a8 !important;
	font-weight: 600;
}

.adlice-action-primary:hover { background: #0058a8 !important; }

.adlice-action-secondary {
	background: #1b7f3b !important;
	color: #ffffff !important;
	border: 1px solid #16662f !important;
	font-weight: 600;
}

.adlice-action-secondary:hover {
	background: #16662f !important;
	border-color: #0f4a22 !important;
}

/* Devices toggle (in card footer) */
.adlice-devices-toggle {
	margin-left: auto !important;
	background: transparent !important;
	color: #1a4e8a !important;
	border: 1px solid #c8d4e0 !important;
	font-weight: 500 !important;
}

.adlice-devices-toggle .adlice-chevron {
	display: inline-block;
	transition: transform 150ms ease;
}

.adlice-devices-toggle[aria-expanded="true"] .adlice-chevron {
	transform: rotate(180deg);
}

/* ===== Per-license activations (collapsible inside the card) =============== */

.adlice-activations-panel {
	background: #fafcfe;
	border-top: 1px solid #e3eaf2;
	padding: 0;
	overflow: hidden;
	max-height: 0;
	transition: max-height 220ms ease;
}

.adlice-activations-panel[hidden] {
	display: none;
}

.adlice-activations-panel.is-open {
	max-height: 2000px;
}

.adlice-activations-panel__inner {
	padding: 12px 18px 16px 18px;
}

.adlice-activations-panel__empty {
	color: #666;
	font-style: italic;
	font-size: 0.9em;
	margin: 6px 0 0 0;
}

.adlice-activations-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.adlice-activation-item {
	display: flex;
	gap: 12px;
	align-items: center;
	background: #ffffff;
	border: 1px solid #e3eaf2;
	border-radius: 6px;
	padding: 10px 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.adlice-activation-item__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: #f0f6fc;
	color: #1a4e8a;
}

.adlice-activation-item__icon svg {
	width: 18px;
	height: 18px;
}

.adlice-activation-item__body {
	flex: 1 1 auto;
	min-width: 0;
}

.adlice-activation-item__machine {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.88em;
	color: #2a3a4d;
	word-break: break-all;
}

.adlice-activation-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
	align-items: center;
}

.adlice-activation-item__actions {
	flex: 0 0 auto;
}

.adlice-activation-item__actions .button {
	margin: 0 !important;
}

/* Platform badge (reused in items) */
.adlice-platform-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 0.78em;
	font-weight: 600;
	border: 1px solid transparent;
}

.adlice-platform-windows {
	background: #e6f0ff;
	color: #1a4e8a;
	border-color: #c8ddff;
}

.adlice-platform-macos {
	background: #f4ecff;
	color: #5c3fa3;
	border-color: #dec9ff;
}

.adlice-platform-linux {
	background: #eaf8ea;
	color: #2e7a32;
	border-color: #c5e6c6;
}

.adlice-platform-generic {
	background: #edf0f5;
	color: #5a6475;
	border-color: #d2d7e3;
}

/* Remove / unlink button */
.adlice-activation-item .remove_activation {
	background: #cc1f1f !important;
	color: #ffffff !important;
	border: 1px solid #b01c1c !important;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px !important;
	font-size: 0.82em !important;
	border-radius: 999px;
}

.adlice-activation-item .remove_activation:hover {
	background: #b01c1c !important;
	border-color: #8e1717 !important;
}

.adlice-activation-item .remove_activation svg {
	width: 14px;
	height: 14px;
}

/* ===== Empty state ======================================================== */

.adlice-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 36px 20px;
	border: 1px dashed #c8d4e0;
	border-radius: 8px;
	background: #f8fafc;
	color: #3a5168;
	text-align: center;
}

.adlice-empty-state__icon {
	width: 48px;
	height: 48px;
	color: #99b5d3;
}

.adlice-empty-state__title {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0;
}

.adlice-empty-state__text {
	margin: 0;
	color: #5a6b7a;
}

.adlice-empty-state .button {
	margin-top: 4px !important;
}

/* ===== Toast (used by copy/remove/error feedback) ========================== */

.adlice-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%) translateY(20px);
	background: #1f2a37;
	color: #fff;
	padding: 10px 16px;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	font-size: 0.92em;
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease, transform 160ms ease;
	z-index: 9999;
}

.adlice-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.adlice-toast.is-error { background: #a31616; }

/* ===== Stats summary strip ================================================ */

.adlice-stats-strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	padding: 14px 18px;
	margin: 0 0 16px 0;
	background: #ffffff;
	border: 1px solid #e1e8f0;
	border-radius: 10px;
	font-size: 0.92em;
	color: #1a2a3d;
	box-shadow: 0 1px 2px rgba(15, 30, 55, 0.04);
}

.adlice-stat {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
}

.adlice-stat__num {
	font-weight: 700;
	font-size: 1.15em;
}

.adlice-stat__label {
	color: #5a6b7a;
}

.adlice-stat__divider {
	width: 1px;
	height: 18px;
	background: #d2dbe5;
	align-self: center;
}

.adlice-stat__dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #888;
	align-self: center;
	margin-right: 2px;
}

.adlice-stat.is-active   .adlice-stat__dot { background: #1a8a4d; }
.adlice-stat.is-warning  .adlice-stat__dot { background: #d68a1a; }
.adlice-stat.is-danger   .adlice-stat__dot { background: #c2270d; }

.adlice-stat.is-active   .adlice-stat__num { color: #136a3a; }
.adlice-stat.is-warning  .adlice-stat__num { color: #a8690c; }
.adlice-stat.is-danger   .adlice-stat__num { color: #951f0a; }

/* ===== Responsive ========================================================= */

@media (max-width: 600px) {
	.adlice-license-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	.adlice-license-row .adlice-value {
		text-align: left;
	}
	.adlice-license-key-wrapper,
	.adlice-activation-cell {
		justify-content: flex-start;
	}
	.adlice-activation-bar {
		width: 100%;
		max-width: 240px;
	}
	.adlice-activation-item {
		flex-wrap: wrap;
	}
	.adlice-activation-item__actions {
		width: 100%;
	}
	.adlice-stat__divider {
		display: none;
	}
}
