/* =============================================================================
   WPCraft License Manager – My Account styles
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Wrapper & loading overlay
   ----------------------------------------------------------------------------- */
.wpcraft-lm-wrapper {
	position: relative;
}

.wpcraft-lm-loading-overlay {
	display: none;
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.75);
	z-index: 10;
	align-items: center;
	justify-content: center;
}

.wpcraft-lm-wrapper.is-loading .wpcraft-lm-loading-overlay {
	display: flex;
}

/* Spinner */
.wpcraft-lm-spinner {
	display: inline-block;
	width: 36px;
	height: 36px;
	border: 4px solid rgba(0, 0, 0, 0.12);
	border-top-color: #7f54b3;
	border-radius: 50%;
	animation: wpcraft-lm-spin 0.7s linear infinite;
}

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

/* -----------------------------------------------------------------------------
   Licenses table
   ----------------------------------------------------------------------------- */
.wpcraft-lm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.wpcraft-lm-table th,
.wpcraft-lm-table td {
	padding: 10px 12px;
	border: 1px solid #e2e2e2;
	vertical-align: middle;
	text-align: left;
}

.wpcraft-lm-table thead th {
	background: #f8f8f8;
	font-weight: 600;
	white-space: nowrap;
}

.wpcraft-lm-table tbody tr:nth-child(even) {
	background: #fafafa;
}

.wpcraft-lm-table tbody tr:hover {
	background: #f3eeff;
}

/* License key monospace display */
.wpcraft-lm-key {
	display: inline-block;
	background: #f4f4f4;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 3px 8px;
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	word-break: break-all;
}

/* Empty state row */
.wpcraft-lm-empty {
	text-align: center;
	color: #777;
	padding: 24px 12px;
}

/* -----------------------------------------------------------------------------
   Status badges
   ----------------------------------------------------------------------------- */
.wpcraft-lm-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.wpcraft-lm-status--active {
	background: #d4edda;
	color: #155724;
}

.wpcraft-lm-status--inactive {
	background: #e2e3e5;
	color: #383d41;
}

.wpcraft-lm-status--expired {
	background: #fff3cd;
	color: #856404;
}

.wpcraft-lm-status--revoked {
	background: #f8d7da;
	color: #721c24;
}

/* Unavailable placeholder */
.wpcraft-lm-unavailable {
	color: #aaa;
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.wpcraft-lm-btn {
	white-space: nowrap;
}

.wpcraft-lm-btn--download {
	background-color: #7f54b3;
	color: #fff !important;
	border-color: #7f54b3;
}

.wpcraft-lm-btn--download:hover {
	background-color: #6d4499;
	border-color: #6d4499;
}

.wpcraft-lm-btn--sites {
	background-color: #fff;
	color: #7f54b3 !important;
	border-color: #7f54b3;
}

.wpcraft-lm-btn--sites:hover {
	background-color: #f3eeff;
}

.wpcraft-lm-btn--deactivate {
	background-color: #fff;
	color: #c0392b !important;
	border-color: #c0392b;
	font-size: 0.8rem;
	padding: 4px 10px;
}

.wpcraft-lm-btn--deactivate:hover {
	background-color: #fdf2f0;
}

.wpcraft-lm-btn--deactivate:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* -----------------------------------------------------------------------------
   Pagination
   ----------------------------------------------------------------------------- */
.wpcraft-lm-pagination {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 20px;
}

.wpcraft-lm-pagination__info {
	margin-right: 8px;
	color: #555;
	font-size: 0.9rem;
}

.wpcraft-lm-page-btn {
	min-width: 36px;
	padding: 5px 10px !important;
	font-size: 0.85rem !important;
}

.wpcraft-lm-page-btn--active {
	background-color: #7f54b3 !important;
	color: #fff !important;
	border-color: #7f54b3 !important;
	cursor: default;
}

/* -----------------------------------------------------------------------------
   Modal – backdrop + dialog
   ----------------------------------------------------------------------------- */
.wpcraft-lm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Hidden state (toggled via JS by removing the 'hidden' attribute) */
.wpcraft-lm-modal[hidden] {
	display: none !important;
}

.wpcraft-lm-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.wpcraft-lm-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
	width: 92%;
	max-width: 760px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wpcraft-lm-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 18px 22px 14px;
	border-bottom: 1px solid #e2e2e2;
	flex-shrink: 0;
}

.wpcraft-lm-modal__title {
	margin: 0 0 4px;
	font-size: 1.1rem;
	font-weight: 700;
}

.wpcraft-lm-modal__subtitle {
	margin: 0;
	font-size: 0.8rem;
	color: #555;
	font-family: monospace;
	letter-spacing: 0.04em;
}

.wpcraft-lm-modal__close {
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: #555;
	padding: 0 0 0 16px;
	flex-shrink: 0;
}

.wpcraft-lm-modal__close:hover {
	color: #222;
}

.wpcraft-lm-modal__body {
	padding: 20px 22px;
	overflow-y: auto;
	flex-grow: 1;
}

/* Loading text inside modal */
.wpcraft-lm-modal__body .wpcraft-lm-loading-text {
	text-align: center;
	color: #777;
	padding: 24px 0;
}

/* No sites message */
.wpcraft-lm-no-sites {
	color: #777;
	text-align: center;
	padding: 16px 0;
}

/* Prevent body scroll when modal is open */
body.wpcraft-lm-modal-open {
	overflow: hidden;
}

/* -----------------------------------------------------------------------------
   Activated sites table (inside modal)
   ----------------------------------------------------------------------------- */
.wpcraft-lm-sites-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
}

.wpcraft-lm-sites-table th,
.wpcraft-lm-sites-table td {
	padding: 9px 10px;
	border: 1px solid #e2e2e2;
	vertical-align: middle;
	text-align: left;
}

.wpcraft-lm-sites-table thead th {
	background: #f8f8f8;
	font-weight: 600;
	white-space: nowrap;
}

.wpcraft-lm-sites-table tbody tr:nth-child(even) {
	background: #fafafa;
}

.wpcraft-lm-sites-table a {
	word-break: break-all;
}

/* -----------------------------------------------------------------------------
   Responsive – stack table on small screens
   ----------------------------------------------------------------------------- */
@media (max-width: 767px) {
	.wpcraft-lm-table thead {
		display: none;
	}

	.wpcraft-lm-table tbody,
	.wpcraft-lm-table tr {
		display: block;
	}

	.wpcraft-lm-table td {
		display: flex;
		align-items: flex-start;
		gap: 8px;
		border: none;
		border-bottom: 1px solid #e2e2e2;
		padding: 8px 12px;
	}

	.wpcraft-lm-table td::before {
		content: attr(data-label);
		font-weight: 600;
		flex: 0 0 120px;
		color: #555;
	}

	.wpcraft-lm-table tr {
		border: 1px solid #e2e2e2;
		border-radius: 6px;
		margin-bottom: 14px;
	}

	.wpcraft-lm-sites-table {
		font-size: 0.82rem;
	}

	.wpcraft-lm-modal__dialog {
		max-height: 92vh;
	}
}
