/**
 * Acresia Card/Tile Styles
 * Reusable card design for Joomla 6 frontend list views (tile/grid layout).
 * Load via WebAssetManager: $wa->registerAndUseStyle('tpl.acresia.cards', 'media/templates/site/cassiopeia_acresia_tools/css/acresia-cards.css');
 *
 * @package    cassiopeia_acresia_tools
 * @author     mcnezmo <nezmar@acresia.com>
 * @copyright  2026 ACRESIA Consulting
 */

/* ===================================================================
   Cards header / toolbar
   =================================================================== */
.act-cards-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 1.5rem;
}
.act-cards-header h1 {
	margin: 0;
	flex: 1;
	min-width: 200px;
}

/* Search inside cards header */
.act-cards-search {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--at-surface-2, #f8f9fa);
	border: 1px solid var(--at-border, #dee2e6);
	border-radius: 8px;
	padding: 6px 12px;
	min-width: 220px;
}
.act-cards-search input {
	border: none;
	background: transparent;
	outline: none;
	font-size: 0.9rem;
	width: 100%;
}

/* Filter dropdown */
.act-cards-filter {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--at-surface-2, #f8f9fa);
	border: 1px solid var(--at-border, #dee2e6);
	border-radius: 8px;
	padding: 6px 12px;
	font-size: 0.9rem;
	color: var(--at-text-muted, #6c757d);
	cursor: pointer;
}
.act-cards-filter select {
	border: none;
	background: transparent;
	outline: none;
	font-size: 0.9rem;
	color: var(--at-text-muted, #6c757d);
	cursor: pointer;
}

/* ===================================================================
   View switch (table / cards / bonds toggle)
   =================================================================== */
.act-view-switch {
	display: inline-flex;
	gap: 4px;
	border: 1px solid var(--at-border, #dee2e6);
	border-radius: 6px;
	padding: 2px;
	background: var(--at-surface-2, #f8f9fa);
}
.act-view-switch a,
.act-view-switch span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 28px;
	border-radius: 4px;
	text-decoration: none;
	color: var(--at-text-muted, #6c757d);
}
.act-view-switch .active {
	background: var(--at-surface, #fff);
	color: var(--at-text-blue, #0d6efd);
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===================================================================
   Cards grid
   =================================================================== */
.act-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
	gap: 16px;
	margin-bottom: 1.5rem;
}
@media (max-width: 576px) {
	.act-cards-grid {
		grid-template-columns: 1fr;
	}
}

/* ===================================================================
   Card container
   =================================================================== */
.act-card {
	background: var(--at-surface, #fff);
	border: 1px solid rgb(197, 221, 184);
	border-radius: 10px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: box-shadow 0.2s, border-color 0.2s;
	position: relative;
}
.act-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,0.08);
	border-color: rgb(157, 191, 140);
}

/* Active card (e.g. active controller) */
.act-card.is-active {
	border-color: #198754;
	border-width: 2px;
}
.act-card-active-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: #198754;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 2px 10px;
	border-radius: 12px;
}

/* ===================================================================
   Card header row: icon + info + actions
   =================================================================== */
.act-card-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}
.act-card-icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
}
.act-card-info {
	flex: 1;
	min-width: 0;
}
.act-card-info-row {
	display: flex;
	align-items: baseline;
	gap: 16px;
	flex-wrap: wrap;
}

/* Label (small gray uppercase text above value) */
.act-card-label {
	font-size: 0.75rem;
	color: var(--at-text-muted, #6c757d);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 1px;
}

/* Card name (main title, clickable link) */
.act-card-name {
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
}
.act-card-name a {
	color: var(--at-text-blue, #0d6efd);
	text-decoration: none;
}
.act-card-name a:hover {
	text-decoration: underline;
}

/* Card title (h3 style, for cards without label/link pattern) */
.act-card-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 0.75rem 0;
	padding-right: 80px;
}

/* Short/key badge */
.act-card-short {
	font-size: 0.85rem;
	background: var(--at-surface-2, #f0f0f0);
	border-radius: 4px;
	padding: 1px 8px;
	font-weight: 500;
	color: var(--at-text-2, #495057);
	white-space: nowrap;
}

/* ===================================================================
   Card actions (edit / delete buttons)
   =================================================================== */
.act-card-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}
.act-card-actions .btn {
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
}
/* Text action buttons (for controllers "Switch" / "Edit" style) */
.act-card-actions-text {
	display: flex;
	gap: 8px;
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgb(197, 221, 184);
}
.act-card-actions-text .btn {
	font-size: 0.85rem;
}

/* ===================================================================
   Card details row (below header, separated by green border)
   =================================================================== */
.act-card-details {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 8px;
	border-top: 1px solid rgb(197, 221, 184);
}
.act-card-detail {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.act-card-detail-value {
	font-size: 0.85rem;
	color: var(--at-text, #212529);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 140px;
}

/* Detail row with icon (icon + text, vertical list) */
.act-card-detail-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 0.4rem;
	font-size: 0.9rem;
	color: var(--at-text-2, #495057);
}
.act-card-detail-icon {
	min-width: 20px;
	text-align: center;
	color: var(--at-text-muted, #6c757d);
}

/* ===================================================================
   CIAL aspect badges container (inside card)
   Badge styles in acresia-table.css: .pa-aspect-badge / .pa-aspect-badge-zero
   =================================================================== */
.act-card-aspects {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

/* ===================================================================
   Cards footer (pagination)
   =================================================================== */
.act-cards-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}
