/* ==========================================================================
   Bird Colony Manager - Public Front-End CSS (Fully Responsive)
   ========================================================================== */

.bcm-public-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	margin: 20px 0;
	color: #1e293b;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.bcm-public-wrapper *, 
.bcm-public-wrapper *:before, 
.bcm-public-wrapper *:after {
	box-sizing: border-box !important;
}

/* ==========================================================================
   Filter Bar & Search Inputs (Responsive Grid System)
   ========================================================================== */

.bcm-public-filter-bar {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 12px;
	margin-bottom: 24px;
	background: #f8fafc;
	padding: 16px 20px;
	border-radius: 14px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
	width: 100%;
}

.bcm-filter-group {
	grid-column: span 2;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.bcm-filter-group.search-group {
	grid-column: span 5;
}

.bcm-filter-group:last-child {
	grid-column: span 3;
}

.bcm-filter-group input[type="text"],
.bcm-filter-group select {
	width: 100% !important;
	max-width: 100% !important;
	height: 42px !important;
	min-height: 42px !important;
	padding: 8px 14px !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	font-size: 14px !important;
	line-height: 1.4 !important;
	background-color: #ffffff !important;
	color: #0f172a !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
	outline: none !important;
	margin: 0 !important;
	box-shadow: none !important;
}

.bcm-filter-group select {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>') !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	padding-right: 36px !important;
	cursor: pointer;
}

.bcm-filter-group input[type="text"]:focus,
.bcm-filter-group select:focus {
	border-color: #10b981 !important;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* ==========================================================================
   Bird Directory Grid & Cards (Responsive Fluid Grid)
   ========================================================================== */

.bcm-public-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
	gap: 20px;
	width: 100%;
	transition: opacity 0.2s ease;
}

.bcm-public-card {
	background: #ffffff;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
	overflow: hidden;
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
	width: 100%;
}

.bcm-public-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.bcm-card-media {
	aspect-ratio: 1 / 1;
	width: 100%;
	height: auto;
	background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bcm-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.bcm-public-card:hover .bcm-card-media img {
	transform: scale(1.04);
}

.bcm-card-placeholder {
	font-size: 54px;
	user-select: none;
}

.bcm-card-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(15, 23, 42, 0.78);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.3px;
	padding: 4px 10px;
	border-radius: 20px;
	max-width: calc(100% - 20px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bcm-card-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.bcm-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
	flex-wrap: wrap;
}

.bcm-card-title {
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.2;
	word-break: break-word;
}

.bcm-card-mutation {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 12px;
	font-weight: 500;
}

.bcm-card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 12px;
	padding-top: 10px;
	margin-top: auto;
	border-top: 1px solid #f1f5f9;
	color: #475569;
	flex-wrap: wrap;
}

.bcm-card-age {
	font-weight: 600;
	color: #64748b;
	white-space: nowrap;
}

/* ==========================================================================
   Gender & Status Badges
   ========================================================================== */

.bcm-badge, .bcm-gender {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.bcm-gender-male, .bcm-badge-male {
	background: #e0f2fe;
	color: #0369a1;
	border: 1px solid #bae6fd;
}

.bcm-gender-female, .bcm-badge-female {
	background: #fce7f3;
	color: #be185d;
	border: 1px solid #fbcfe8;
}

.bcm-gender-unknown, .bcm-badge-unknown, .bcm-badge-secondary {
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #e2e8f0;
}

/* Status Badges */
.bcm-badge-success, .bcm-status-available {
	background: #dcfce7;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.bcm-badge-info, .bcm-status-paired {
	background: #e0e7ff;
	color: #4338ca;
	border: 1px solid #c7d2fe;
}

.bcm-badge-warning, .bcm-status-quarantined {
	background: #fef3c7;
	color: #b45309;
	border: 1px solid #fde68a;
}

.bcm-badge-neutral, .bcm-status-sold {
	background: #f3f4f6;
	color: #4b5563;
	border: 1px solid #e5e7eb;
}

.bcm-badge-danger, .bcm-status-deceased {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/* ==========================================================================
   Pedigree Certificate & Lineage Tree
   ========================================================================== */

.bcm-pedigree-container {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	padding: 24px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
}

.bcm-pedigree-header {
	text-align: center;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px dashed #e2e8f0;
}

.bcm-pedigree-header h3 {
	font-size: 20px;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 6px 0;
}

.bcm-pedigree-header p {
	font-size: 14px;
	color: #64748b;
	margin: 0;
	font-weight: 600;
}

.bcm-pedigree-tree-grid {
	display: grid;
	grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(200px, 1fr);
	gap: 20px;
	min-width: 620px;
	align-items: center;
}

.bcm-tree-col {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bcm-tree-col-title {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #94a3b8;
	text-align: center;
	margin-bottom: 4px;
}

.bcm-tree-branch {
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: space-around;
	height: 100%;
}

.bcm-pedigree-card {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-left: 5px solid #64748b;
	border-radius: 12px;
	padding: 12px 14px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.03);
	position: relative;
	transition: all 0.2s ease;
}

.bcm-pedigree-card:hover {
	box-shadow: 0 6px 12px rgba(0,0,0,0.08);
	transform: translateY(-2px);
}

.bcm-pedigree-card.self {
	border-left-color: #10b981;
	background: #f0fdf4;
}

.bcm-pedigree-card.father {
	border-left-color: #0284c7;
	background: #f0f9ff;
}

.bcm-pedigree-card.mother {
	border-left-color: #ec4899;
	background: #fdf2f8;
}

.bcm-pedigree-card.grandparent {
	border-left-color: #8b5cf6;
	background: #faf5ff;
}

.bcm-pedigree-card.empty {
	border-left-color: #cbd5e1;
	background: #f8fafc;
	opacity: 0.75;
}

.bcm-pedigree-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	float: right;
	margin-left: 8px;
	border: 2px solid #ffffff;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bcm-pedigree-role {
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #64748b;
	margin-bottom: 2px;
}

.bcm-pedigree-ring {
	font-size: 14px;
	font-weight: 800;
	color: #0f172a;
}

.bcm-pedigree-species {
	font-size: 11px;
	color: #475569;
	margin-top: 2px;
	margin-bottom: 6px;
}

/* ==========================================================================
   Stats Widget
   ========================================================================== */

.bcm-stats-widget {
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
	color: #ffffff;
	padding: 24px;
	border-radius: 18px;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
	width: 100%;
}

.bcm-stats-header {
	margin-bottom: 18px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bcm-stats-header h3 {
	font-size: 17px;
	font-weight: 800;
	color: #ffffff;
	margin: 0;
}

.bcm-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
	gap: 16px;
	text-align: center;
	width: 100%;
}

.bcm-stat-item {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	padding: 16px 10px;
	backdrop-filter: blur(4px);
	transition: transform 0.2s ease, background 0.2s ease;
}

.bcm-stat-item:hover {
	transform: translateY(-3px);
	background: rgba(255, 255, 255, 0.08);
}

.bcm-stat-icon {
	font-size: 22px;
	margin-bottom: 4px;
}

.bcm-stat-num {
	font-size: 28px;
	font-weight: 800;
	color: #34d399;
	line-height: 1.1;
}

.bcm-stat-lbl {
	font-size: 11px;
	font-weight: 600;
	color: #94a3b8;
	margin-top: 6px;
}

/* ==========================================================================
   Alert Banners & Notifications
   ========================================================================== */

.bcm-alert {
	padding: 14px 18px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	margin: 16px 0;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
}

.bcm-alert-info {
	background: #eff6ff;
	color: #1d4ed8;
	border: 1px solid #bfdbfe;
}

.bcm-alert-warning {
	background: #fffbeb;
	color: #b45309;
	border: 1px solid #fde68a;
}

.bcm-alert-danger {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.bcm-alert-success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

/* ==========================================================================
   Empty / No Results State
   ========================================================================== */

.bcm-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	background: #f8fafc;
	border: 2px dashed #cbd5e1;
	border-radius: 16px;
	color: #64748b;
	font-size: 15px;
	font-weight: 600;
	width: 100%;
}

/* ==========================================================================
   Breeder Portal Wrapper Adjustments
   ========================================================================== */

.bcm-breeder-portal-wrapper .bcm-wrap {
	margin: 0;
	padding: 0;
}

/* Breeder Pairs Action Buttons Layout */
.bcm-pair-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	flex-wrap: wrap;
}

.bcm-pair-btn-group {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.bcm-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 700;
	border-radius: 8px;
	letter-spacing: 0.2px;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.bcm-btn-pair-clutch {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #ffffff !important;
	border: 1px solid #059669;
	box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.bcm-btn-pair-clutch:hover {
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	color: #ffffff !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

.bcm-btn-pair-edit {
	background: #ffffff;
	color: #334155 !important;
	border: 1px solid #cbd5e1;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bcm-btn-pair-edit:hover {
	background: #f1f5f9;
	color: #0f172a !important;
	border-color: #94a3b8;
	transform: translateY(-1px);
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.bcm-btn-pair-delete {
	background: #fef2f2;
	color: #dc2626 !important;
	border: 1px solid #fecaca;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.bcm-btn-pair-delete:hover {
	background: #dc2626;
	color: #ffffff !important;
	border-color: #b91c1c;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

@media (max-width: 540px) {
	.bcm-pair-footer {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.bcm-btn-pair-clutch {
		width: 100%;
		justify-content: center;
	}

	.bcm-pair-btn-group {
		width: 100%;
		display: flex;
	}

	.bcm-btn-pair-edit,
	.bcm-btn-pair-delete {
		flex: 1;
		justify-content: center;
	}
}

/* ==========================================================================
   Responsive Breakpoints & Media Queries
   ========================================================================== */

/* Tablet / Medium Screens (640px to 1024px) */
@media (max-width: 1024px) {
	.bcm-public-filter-bar {
		grid-template-columns: repeat(6, 1fr);
		gap: 10px;
		padding: 14px 16px;
	}

	.bcm-filter-group.search-group {
		grid-column: span 6;
	}

	.bcm-filter-group {
		grid-column: span 2;
	}

	.bcm-filter-group:last-child {
		grid-column: span 2;
	}
}

/* Mobile Screens (Under 640px) */
@media (max-width: 640px) {
	.bcm-public-filter-bar {
		display: flex;
		flex-direction: column;
		gap: 10px;
		padding: 14px;
	}

	.bcm-filter-group,
	.bcm-filter-group.search-group,
	.bcm-filter-group:last-child {
		width: 100% !important;
		flex: 1 1 100% !important;
	}

	.bcm-filter-group input[type="text"],
	.bcm-filter-group select {
		font-size: 16px !important; /* Prevents iOS Safari auto-zoom */
		height: 44px !important;
		min-height: 44px !important;
	}

	.bcm-public-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.bcm-stats-widget {
		padding: 18px 14px;
	}
}

/* Extra Small Screens (Under 380px) */
@media (max-width: 380px) {
	.bcm-public-filter-bar {
		padding: 10px;
	}

	.bcm-card-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
