/* ============================================================
   components.css — shared, cross-template UI components.
   Loaded on every page: section headers, rating widgets,
   buttons, cards, badges/pills.
============================================================ */

/* ------------------------------------------------------------
   SECTION HEADER BLOCK
------------------------------------------------------------ */
.section {
	margin-bottom: 64px;
}

.section-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 24px;
	gap: 20px;
	flex-wrap: wrap;
}

.section-title {
	font-size: 32px;
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 4px;
}

.section-title-bar {
	width: 6px;
	height: 32px;
	background: linear-gradient(180deg, var(--primary), var(--purple));
	border-radius: 3px;
	flex-shrink: 0;
}

.section-subtitle {
	font-size: 15px;
	color: var(--text-3);
	font-weight: 500;
}

.section-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: #fff;
	border: 1.5px solid var(--border-2);
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	color: var(--text);
	transition: all 0.15s;
}

.section-cta:hover {
	border-color: var(--primary);
	background: var(--primary-light);
	color: var(--primary-dark);
}

/* ------------------------------------------------------------
   RATING BOX — compact widget for cards and rows
   (parts/rating-box.php)
------------------------------------------------------------ */
.rating-box {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 7px 11px;
	background: #fff;
	border: 1.5px solid var(--border);
	border-radius: var(--r-md);
	min-width: 58px;
	transition: all 0.15s;
}

.rating-box:hover {
	border-color: var(--success);
	box-shadow: 0 2px 6px rgba(0, 168, 107, 0.12);
}

.rating-num {
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 800;
	color: var(--success-dark);
	line-height: 1;
	letter-spacing: -0.02em;
}

.rating-votes {
	font-size: 10px;
	color: var(--text-3);
	font-weight: 600;
	line-height: 1;
}

/* Inline-SVG star widgets (moosoft_render_stars / moosoft_star_icon) */
.rating-stars {
	display: inline-flex;
	gap: 1px;
	align-items: center;
	line-height: 1;
}

.rating-stars svg {
	width: var(--star-size, 14px);
	height: var(--star-size, 14px);
	flex-shrink: 0;
	display: block;
}

.star-icon {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	display: inline-block;
	vertical-align: -0.12em;
}

/* ------------------------------------------------------------
   RATING DISPLAY — large gold panel (single-software hero)
------------------------------------------------------------ */
.rating-display {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px;
	background: linear-gradient(135deg, var(--gold-light) 0%, #fff 100%);
	border: 1.5px solid var(--gold);
	border-radius: var(--r-lg);
}

.rating-big {
	font-family: var(--font-display);
	font-size: 36px;
	font-weight: 800;
	color: var(--accent-dark);
	line-height: 1;
}

.rating-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rating-text {
	font-size: 12px;
	color: var(--text-2);
}

.rating-text strong {
	color: var(--text);
	font-weight: 700;
	font-size: 13px;
}

/* ------------------------------------------------------------
   BUTTONS
------------------------------------------------------------ */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: 1.5px solid transparent;
	border-radius: var(--r-md);
	font-family: var(--font);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: all 0.15s;
	text-align: center;
}

.btn-primary {
	background: var(--primary);
	color: #fff;
}

.btn-primary:hover {
	background: var(--primary-dark);
	color: #fff;
	transform: translateY(-1px);
}

.btn-dark {
	background: var(--text);
	color: #fff;
}

.btn-dark:hover {
	background: var(--primary);
	color: #fff;
	transform: translateY(-1px);
}

.btn-secondary {
	background: #fff;
	border-color: var(--border-2);
	color: var(--text);
}

.btn-secondary:hover {
	border-color: var(--primary);
	background: var(--primary-light);
	color: var(--primary-dark);
}

.btn-block {
	display: flex;
	width: 100%;
}

/* Green download button (parts/download-button.php) */
.download-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 28px;
	background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
	color: #fff;
	border-radius: var(--r-md);
	font-size: 15px;
	font-weight: 700;
	transition: all 0.15s;
}

.download-btn:hover {
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 168, 107, 0.28);
}

/* ------------------------------------------------------------
   CARD
------------------------------------------------------------ */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
	padding: 32px;
	box-shadow: var(--shadow-xs);
}

.card-title {
	font-size: 22px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--bg-soft);
	display: flex;
	align-items: center;
	gap: 12px;
}

.card-title-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-soft) 100%);
	display: grid;
	place-items: center;
	color: var(--primary);
	flex-shrink: 0;
}

/* ------------------------------------------------------------
   BADGES / PILLS / TAGS
------------------------------------------------------------ */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: var(--r-full);
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1;
}

.badge-gold {
	background: linear-gradient(135deg, var(--gold) 0%, var(--accent-dark) 100%);
	color: #fff;
}

.badge-success {
	background: var(--success-light);
	color: var(--success-dark);
}

.badge-primary {
	background: var(--primary-light);
	color: var(--primary-dark);
}

/* License / category pill */
.pill {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: var(--bg-soft);
	border-radius: var(--r-full);
	font-size: 11px;
	font-weight: 700;
	color: var(--text-2);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Monospace version pill */
.version-pill {
	font-family: var(--font-mono);
	font-size: 14px;
	padding: 5px 12px;
	background: var(--text);
	color: #fff;
	border-radius: 8px;
	font-weight: 600;
}

/* ------------------------------------------------------------
   PAGINATION
------------------------------------------------------------ */
.moosoft-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.moosoft-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1.5px solid var(--border);
	border-radius: var(--r-md);
	background: #fff;
	font-size: 14px;
	font-weight: 700;
	color: var(--text-2);
	transition: all 0.15s;
}

.moosoft-pagination .page-numbers:hover {
	border-color: var(--primary);
	color: var(--primary-dark);
}

.moosoft-pagination .page-numbers.current {
	background: var(--text);
	border-color: var(--text);
	color: #fff;
}

.moosoft-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ------------------------------------------------------------
   EMPTY STATE
------------------------------------------------------------ */
.moosoft-empty {
	text-align: center;
	padding: 64px 24px;
	color: var(--text-3);
}

.moosoft-empty h2 {
	font-size: 22px;
	margin-bottom: 8px;
	color: var(--text);
}

/* ------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------ */
@media (max-width: 700px) {
	.section {
		margin-bottom: 40px;
	}

	.section-title {
		font-size: 24px;
	}

	.card {
		padding: 22px;
	}
}

/* ------------------------------------------------------------
   CATEGORIES GRID
   Shared by the homepage "Browse by Category" section and the
   /categories/ page template — kept here (loaded site-wide)
   rather than in homepage.css so both render the grid.
------------------------------------------------------------ */
.categories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
}

.cat-card {
	background: #fff;
	border: 1.5px solid var(--border);
	border-radius: var(--r-xl);
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	position: relative;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: all 0.25s;
}

.cat-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--cat-color);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s;
}

.cat-card:hover {
	border-color: var(--cat-color);
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

.cat-card:hover::before {
	transform: scaleX(1);
}

.cat-card-icon {
	align-self: flex-start;
	width: 56px;
	height: 56px;
	border-radius: 14px;
	background: var(--cat-bg);
	display: grid;
	place-items: center;
	color: var(--cat-color);
}

.cat-card-icon svg {
	width: 26px;
	height: 26px;
}

.cat-card-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cat-card-name {
	font-size: 18px;
	font-weight: 700;
	color: var(--text);
	margin: 0;
}

.cat-card:hover .cat-card-name {
	color: var(--cat-color);
}

.cat-card-count {
	font-size: 12px;
	color: var(--text-3);
	font-weight: 600;
}

.cat-card-desc {
	font-size: 13px;
	color: var(--text-2);
	line-height: 1.5;
	margin: 2px 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cat-card.c1 { --cat-color: #ff6b35; --cat-bg: #fff0e8; }
.cat-card.c2 { --cat-color: #0066ff; --cat-bg: #e6f0ff; }
.cat-card.c3 { --cat-color: #00a86b; --cat-bg: #d4f5e9; }
.cat-card.c4 { --cat-color: #db2777; --cat-bg: #fce7f3; }
.cat-card.c5 { --cat-color: #7c3aed; --cat-bg: #ede9fe; }
.cat-card.c6 { --cat-color: #0891b2; --cat-bg: #cffafe; }
.cat-card.c7 { --cat-color: #16a34a; --cat-bg: #dcfce7; }
.cat-card.c8 { --cat-color: #dc2626; --cat-bg: #fee2e2; }
