/* WPM Mirror - Frontend Styles */
.wpm-mirror-wrap {
	font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
	direction: rtl;
	text-align: right;
	max-width: 100%;
	margin: 0 auto;
}

/* Header & Filters */
.wpm-fe-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.wpm-fe-search {
	position: relative;
	flex: 1;
	min-width: 200px;
	max-width: 420px;
}
.wpm-fe-search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1rem;
	pointer-events: none;
	color: #9ca3af;
}
.wpm-search-input {
	width: 100%;
	padding: 10px 40px 10px 16px;
	border: 2px solid #e5e7eb;
	border-radius: 50px;
	font-size: .95rem;
	outline: none;
	transition: border-color .2s, box-shadow .2s;
	background: #f9fafb;
	box-sizing: border-box;
}
.wpm-search-input:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59,130,246,.15);
	background: white;
}

.wpm-fe-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.wpm-filter-btn {
	padding: 8px 18px;
	border: 2px solid #e5e7eb;
	border-radius: 50px;
	background: white;
	cursor: pointer;
	font-size: .875rem;
	font-weight: 500;
	color: #6b7280;
	transition: all .2s;
}
.wpm-filter-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.wpm-filter-btn.active {
	background: #3b82f6;
	border-color: #3b82f6;
	color: white;
}

/* Loading */
.wpm-loading {
	text-align: center;
	padding: 40px;
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}
.wpm-spinner {
	width: 24px; height: 24px;
	border: 3px solid #e5e7eb;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: wpm-spin .7s linear infinite;
}
@keyframes wpm-spin { to { transform: rotate(360deg); } }

/* Grid */
.wpm-items-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-bottom: 32px;
}

/* Item Card */
.wpm-item-card {
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	transition: transform .2s, box-shadow .2s;
	cursor: pointer;
	display: flex;
	flex-direction: column;
}
.wpm-item-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0,0,0,.1);
	border-color: #3b82f6;
}
.wpm-card-banner {
	height: 100px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	position: relative;
	overflow: hidden;
}
.wpm-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.wpm-card-banner-placeholder {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	font-size: 2.5rem;
}
.wpm-card-type-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: .7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.wpm-card-type-plugin { background: rgba(59,130,246,.9); color: white; }
.wpm-card-type-theme  { background: rgba(139,92,246,.9); color: white; }

.wpm-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.wpm-card-name {
	font-size: 1rem;
	font-weight: 600;
	color: #111827;
	margin: 0 0 6px;
	line-height: 1.3;
}
.wpm-card-desc {
	font-size: .8rem;
	color: #6b7280;
	line-height: 1.5;
	margin-bottom: 12px;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wpm-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}
.wpm-meta-item {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: .75rem;
	color: #6b7280;
	background: #f3f4f6;
	padding: 3px 8px;
	border-radius: 20px;
}
.wpm-meta-item strong { color: #374151; }

.wpm-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 12px;
	border-top: 1px solid #f3f4f6;
	gap: 8px;
}
.wpm-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #3b82f6;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: .85rem;
	font-weight: 500;
	text-decoration: none;
	transition: background .2s;
}
.wpm-download-btn:hover { background: #2563eb; color: white; }
.wpm-download-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.wpm-download-count {
	font-size: .75rem;
	color: #9ca3af;
	display: flex;
	align-items: center;
	gap: 4px;
}

/* No Results */
.wpm-no-results {
	text-align: center;
	padding: 60px 20px;
	color: #9ca3af;
}
.wpm-no-results span { font-size: 3rem; display: block; margin-bottom: 12px; }
.wpm-no-results p { font-size: 1rem; margin: 0; }

/* Pagination */
.wpm-fe-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 32px;
	flex-wrap: wrap;
}
.wpm-page-btn {
	padding: 8px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: white;
	cursor: pointer;
	font-size: .875rem;
	color: #374151;
	transition: all .2s;
	min-width: 40px;
}
.wpm-page-btn:hover:not(:disabled) { border-color: #3b82f6; color: #3b82f6; }
.wpm-page-btn.current { background: #3b82f6; color: white; border-color: #3b82f6; }
.wpm-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.wpm-page-info { font-size: .8rem; color: #9ca3af; padding: 0 8px; }

/* Modal */
.wpm-fe-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
}
.wpm-fe-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.5);
	backdrop-filter: blur(3px);
}
.wpm-fe-modal-box {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	background: white;
	border-radius: 16px;
	width: 90%;
	max-width: 600px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.wpm-fe-modal-close {
	position: absolute;
	top: 16px;
	left: 16px;
	background: #f3f4f6;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s;
	z-index: 1;
}
.wpm-fe-modal-close:hover { background: #e5e7eb; }
.wpm-fe-modal-content { padding: 24px; }

.wpm-modal-banner {
	height: 160px;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.wpm-modal-banner img { width: 100%; height: 100%; object-fit: cover; }
.wpm-modal-title { font-size: 1.3rem; font-weight: 700; color: #111827; margin-bottom: 8px; }
.wpm-modal-desc { font-size: .875rem; color: #6b7280; line-height: 1.6; margin-bottom: 20px; }

.wpm-modal-info-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 20px;
}
.wpm-info-row {
	background: #f9fafb;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: .8rem;
}
.wpm-info-row .label { color: #9ca3af; margin-bottom: 2px; }
.wpm-info-row .value { color: #111827; font-weight: 500; }

.wpm-modal-actions { display: flex; gap: 10px; align-items: center; }
.wpm-modal-download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #3b82f6;
	color: white;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-size: .95rem;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s;
}
.wpm-modal-download:hover { background: #2563eb; color: white; }
.wpm-modal-wporg {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 18px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	color: #6b7280;
	text-decoration: none;
	font-size: .875rem;
	transition: border-color .2s, color .2s;
}
.wpm-modal-wporg:hover { border-color: #3b82f6; color: #3b82f6; }

/* Responsive */
@media (max-width: 640px) {
	.wpm-fe-header { flex-direction: column; align-items: stretch; }
	.wpm-fe-search { max-width: 100%; }
	.wpm-items-grid { grid-template-columns: 1fr 1fr; }
	.wpm-modal-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.wpm-items-grid { grid-template-columns: 1fr; }
}

/* Relative time */
.wpm-relative-time {
	font-size: .8em;
	color: #9ca3af;
	font-style: italic;
}

/* Login required button */
.wpm-btn-login {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #f59e0b;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: .85rem;
	font-weight: 500;
	text-decoration: none;
	transition: background .2s;
}
.wpm-btn-login:hover { background: #d97706; color: white; }

/* Disabled btn */
.wpm-btn-disabled {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #f3f4f6;
	color: #9ca3af;
	border-radius: 8px;
	font-size: .82rem;
	cursor: default;
}

/* Pagination dots */
.wpm-page-dots {
	display: inline-flex;
	align-items: center;
	padding: 8px 6px;
	color: #9ca3af;
	font-size: .875rem;
}

/* ===== DESCRIPTION LANGUAGE TABS ===== */
.wpm-desc-tabs-wrap { margin-bottom: 16px; }

.wpm-desc-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.wpm-desc-tab {
	padding: 6px 14px;
	border: none;
	background: none;
	color: #6b7280;
	cursor: pointer;
	font-size: .85rem;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: all .15s;
	border-radius: 4px 4px 0 0;
}
.wpm-desc-tab:hover { color: #111827; background: #f9fafb; }
.wpm-desc-tab.active {
	color: var(--wpm-primary, #2271b1);
	border-bottom-color: var(--wpm-primary, #2271b1);
	background: #f0f7ff;
}

.wpm-desc-pane {
	line-height: 1.7;
	color: #374151;
	font-size: .9rem;
}

/* ===== LOCALE SETTINGS GRID ===== */
