/**
 * Frontend Directory Styles for SFX Nuns Directory
 * Designed with St. Francis Xavier Church theme system (Theme Blue: #18587f, Theme Gold: #b8862e, Cream Border: #e8e3d9)
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Lora:ital,wght@0,500;0,600;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
	--sfx-primary: #18587f;       /* Theme Dark Blue */
	--sfx-primary-dark: #11405d;  /* Footer / Contrast Dark Blue */
	--sfx-gold: #b8862e;          /* Theme Gold */
	--sfx-gold-hover: #9c6e21;    /* Deep Gold */
	--sfx-bg-card: #ffffff;
	--sfx-border-card: #e8e3d9;   /* Warm Cream Border */
	--sfx-text-main: #18587f;
	--sfx-text-dark: #0f172a;
	--sfx-text-muted: #93a1aa;
	--sfx-bg-light: #eef1f2;      /* Warm Light Slate */
	--sfx-font-title: 'Cinzel', Georgia, serif;
	--sfx-font-sub: 'Lora', Georgia, serif;
	--sfx-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--sfx-shadow-sm: 0 2px 6px rgba(24, 88, 127, 0.06);
	--sfx-shadow-md: 0 4px 16px rgba(24, 88, 127, 0.12);
	--sfx-shadow-lg: 0 12px 28px rgba(17, 64, 93, 0.2);
	--sfx-radius-card: 10px;
	--sfx-radius-btn: 6px;
}

.sfx-nuns-directory-wrapper {
	font-family: var(--sfx-font-body);
	color: var(--sfx-text-dark);
	margin: 20px 0;
	width: 100%;
	box-sizing: border-box;
}

.sfx-nuns-directory-wrapper * {
	box-sizing: border-box;
}

/* Controls Bar */
.sfx-nuns-controls-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	justify-content: space-between;
	align-items: center;
	background: #ffffff;
	padding: 16px 20px;
	border-radius: var(--sfx-radius-card);
	border: 1px solid var(--sfx-border-card);
	margin-bottom: 15px;
	box-shadow: var(--sfx-shadow-sm);
}

.sfx-nuns-search-box {
	position: relative;
	flex: 1 1 300px;
	max-width: 450px;
}

.sfx-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	pointer-events: none;
}

#sfx-nuns-search-input {
	width: 100%;
	padding: 10px 36px 10px 38px;
	font-family: var(--sfx-font-sub);
	font-size: 14px;
	border: 1px solid var(--sfx-border-card);
	border-radius: 24px;
	outline: none;
	background: var(--sfx-bg-light);
	color: var(--sfx-primary);
	transition: all 0.2s ease;
}

#sfx-nuns-search-input:focus {
	border-color: var(--sfx-gold);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(184, 134, 46, 0.15);
}

#sfx-nuns-search-clear {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	font-size: 18px;
	color: var(--sfx-text-muted);
	cursor: pointer;
}

.sfx-nuns-right-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

/* Filter Pills */
.sfx-nuns-filter-pills {
	display: flex;
	gap: 6px;
	background: var(--sfx-bg-light);
	padding: 4px;
	border-radius: 24px;
	border: 1px solid var(--sfx-border-card);
}

.sfx-filter-pill {
	background: transparent;
	border: none;
	padding: 6px 14px;
	font-family: var(--sfx-font-sub);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--sfx-primary);
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.sfx-filter-pill:hover {
	color: var(--sfx-gold);
}

.sfx-filter-pill.active {
	background: var(--sfx-primary);
	color: #ffffff;
	font-weight: 600;
	box-shadow: 0 2px 6px rgba(24, 88, 127, 0.2);
}

/* Layout Buttons */
.sfx-layout-toggle-btns {
	display: flex;
	gap: 4px;
}

.sfx-layout-btn {
	background: #ffffff;
	border: 1px solid var(--sfx-border-card);
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
	color: var(--sfx-text-muted);
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.sfx-layout-btn.active, .sfx-layout-btn:hover {
	color: var(--sfx-gold);
	border-color: var(--sfx-gold);
	background: #fffdf9;
}

.sfx-nuns-meta-count {
	font-family: var(--sfx-font-sub);
	font-size: 13px;
	color: var(--sfx-text-muted);
	margin-bottom: 18px;
	padding-left: 4px;
}

/* Grid View Layout */
.sfx-nuns-container.sfx-view-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
}

/* Nun Card */
.sfx-nun-card {
	background: var(--sfx-bg-card);
	border: 1px solid var(--sfx-border-card);
	border-radius: var(--sfx-radius-card);
	overflow: hidden;
	box-shadow: var(--sfx-shadow-sm);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
	display: flex;
	flex-direction: column;
}

.sfx-nun-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--sfx-shadow-md);
	border-color: var(--sfx-gold);
}

.sfx-card-photo-wrapper {
	position: relative;
	width: 100%;
	height: 220px;
	background: var(--sfx-bg-light);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid var(--sfx-border-card);
}

.sfx-card-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.sfx-card-photo.sfx-photo-fallback {
	object-fit: contain;
	padding: 16px;
	background: var(--sfx-bg-light);
}

.sfx-nun-card:hover .sfx-card-photo:not(.sfx-photo-fallback) {
	transform: scale(1.04);
}

.sfx-card-avatar-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--sfx-bg-light);
}

.sfx-badge-sno {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--sfx-primary-dark);
	border: 1px solid rgba(184, 134, 46, 0.4);
	color: #ffffff;
	font-family: var(--sfx-font-sub);
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 12px;
}

.sfx-badge-status {
	position: absolute;
	top: 12px;
	right: 12px;
	font-family: var(--sfx-font-sub);
	font-size: 10px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #ffffff;
}

.sfx-status-active {
	background: #10b981;
}

.sfx-status-deceased {
	background: #64748b;
}

.sfx-status-left, .sfx-status-dismissed {
	background: #ef4444;
}

.sfx-card-content {
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.sfx-nun-title {
	margin: 0 0 4px 0;
	font-family: var(--sfx-font-title);
	font-size: 17px;
	font-weight: 700;
	color: var(--sfx-primary);
	line-height: 1.35;
	transition: color 0.2s ease;
}

.sfx-nun-card:hover .sfx-nun-title {
	color: var(--sfx-gold);
}

.sfx-nun-nrc {
	margin: 0 0 14px 0;
	font-family: var(--sfx-font-sub);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sfx-gold);
}

.sfx-nun-key-meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
	background: var(--sfx-bg-light);
	padding: 10px 12px;
	border-radius: 6px;
	border: 1px solid var(--sfx-border-card);
}

.sfx-meta-item {
	display: flex;
	justify-content: space-between;
	font-family: var(--sfx-font-sub);
	font-size: 11.5px;
}

.sfx-meta-label {
	color: var(--sfx-text-muted);
	font-weight: 500;
}

.sfx-meta-val {
	font-weight: 600;
	color: var(--sfx-primary);
}

.sfx-card-footer {
	margin-top: auto;
	padding-top: 10px;
}

.sfx-btn-view-profile {
	width: 100%;
	background: var(--sfx-primary);
	color: #ffffff;
	border: 1px solid var(--sfx-primary);
	padding: 10px 16px;
	border-radius: var(--sfx-radius-btn);
	font-family: var(--sfx-font-sub);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
}

.sfx-btn-view-profile:hover {
	background: var(--sfx-gold);
	border-color: var(--sfx-gold);
	color: #ffffff;
}

/* List View Layout */
.sfx-nuns-list-table-wrapper {
	overflow-x: auto;
	background: #ffffff;
	border: 1px solid var(--sfx-border-card);
	border-radius: var(--sfx-radius-card);
	box-shadow: var(--sfx-shadow-sm);
}

.sfx-nuns-list-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 14px;
}

.sfx-nuns-list-table th {
	background: var(--sfx-bg-light);
	font-family: var(--sfx-font-title);
	font-size: 12px;
	font-weight: 700;
	color: var(--sfx-primary);
	padding: 12px 16px;
	border-bottom: 2px solid var(--sfx-border-card);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.sfx-nuns-list-table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--sfx-border-card);
	vertical-align: middle;
	font-family: var(--sfx-font-sub);
}

.sfx-nuns-list-table tr:hover td {
	background: #fffdf9;
}

.sfx-td-title {
	font-family: var(--sfx-font-title) !important;
	color: var(--sfx-primary);
}

.sfx-td-nrc {
	color: var(--sfx-gold);
	font-weight: 600;
	font-size: 12px;
}

.sfx-list-photo {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--sfx-border-card);
}

.sfx-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
	width: auto;
}

/* Pagination Bar Styling */
.sfx-nuns-pagination-container {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 30px;
	padding: 16px;
	background: #ffffff;
	border: 1px solid var(--sfx-border-card);
	border-radius: var(--sfx-radius-card);
	box-shadow: var(--sfx-shadow-sm);
}

.sfx-page-numbers {
	display: flex;
	gap: 6px;
	align-items: center;
}

.sfx-page-btn {
	background: #ffffff;
	border: 1px solid var(--sfx-border-card);
	color: var(--sfx-primary);
	font-family: var(--sfx-font-sub);
	font-size: 13px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: var(--sfx-radius-btn);
	cursor: pointer;
	transition: all 0.2s ease;
}

.sfx-page-btn:hover:not(:disabled) {
	background: var(--sfx-gold);
	border-color: var(--sfx-gold);
	color: #ffffff;
}

.sfx-page-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.sfx-page-num {
	background: #ffffff;
	border: 1px solid var(--sfx-border-card);
	color: var(--sfx-primary);
	font-family: var(--sfx-font-sub);
	font-size: 13px;
	font-weight: 600;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.sfx-page-num:hover {
	border-color: var(--sfx-gold);
	color: var(--sfx-gold);
}

.sfx-page-num.active {
	background: var(--sfx-primary);
	border-color: var(--sfx-primary);
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(24, 88, 127, 0.2);
}

/* Modal Popup - Glassmorphic Blur with Church Theme */
.sfx-nun-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(17, 64, 93, 0.7);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sfx-nun-modal-content {
	background: #ffffff;
	border-radius: 16px;
	border: 1px solid var(--sfx-border-card);
	max-width: 620px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
	animation: sfxModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sfxModalPop {
	from { opacity: 0; transform: scale(0.95) translateY(10px); }
	to { opacity: 1; transform: scale(1) translateY(0); }
}

.sfx-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(17, 64, 93, 0.6);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 20px;
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.sfx-modal-close:hover {
	background: var(--sfx-gold);
}

.sfx-modal-header-hero {
	position: relative;
	height: 240px;
	background: var(--sfx-primary);
	overflow: hidden;
}

.sfx-modal-hero-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sfx-modal-hero-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255,255,255,0.4);
}

.sfx-modal-hero-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(17, 64, 93, 0.95) 0%, transparent 100%);
	padding: 24px;
	color: #ffffff;
}

.sfx-modal-hero-overlay h2 {
	margin: 0 0 4px 0;
	font-family: var(--sfx-font-title);
	font-size: 24px;
	color: #ffffff;
}

.sfx-modal-hero-overlay p {
	margin: 0;
	font-family: var(--sfx-font-sub);
	font-size: 13px;
	color: var(--sfx-gold);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.sfx-modal-details-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	padding: 24px;
}

.sfx-modal-field {
	background: var(--sfx-bg-light);
	padding: 12px 16px;
	border-radius: 8px;
	border: 1px solid var(--sfx-border-card);
}

.sfx-modal-field label {
	display: block;
	font-family: var(--sfx-font-sub);
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sfx-gold);
	margin-bottom: 4px;
}

.sfx-modal-field span {
	font-family: var(--sfx-font-title);
	font-size: 14px;
	font-weight: 600;
	color: var(--sfx-primary);
}

.sfx-modal-bio-section {
	padding: 0 24px 24px 24px;
	border-top: 1px solid var(--sfx-border-card);
	margin-top: 8px;
}

.sfx-modal-bio-section h4 {
	font-family: var(--sfx-font-title);
	color: var(--sfx-primary);
	font-size: 15px;
	font-weight: 700;
	margin: 16px 0 8px 0;
}

.sfx-modal-bio-content {
	font-family: var(--sfx-font-sub);
	font-size: 14px;
	line-height: 1.6;
	color: #334155;
}

/* Responsive Mobile & Tablet Design Enhancements */
@media (max-width: 768px) {
	.sfx-nuns-controls-bar {
		padding: 14px;
		gap: 12px;
	}

	.sfx-nuns-search-box {
		max-width: 100%;
		flex: 1 1 100%;
	}

	#sfx-nuns-search-input {
		font-size: 14px;
		padding: 12px 36px 12px 38px;
		height: 44px;
	}

	.sfx-nuns-right-controls {
		width: 100%;
		justify-content: space-between;
		gap: 10px;
	}

	.sfx-nuns-filter-pills {
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
		max-width: calc(100% - 90px);
		padding: 3px;
		scrollbar-width: none; /* Firefox */
	}

	.sfx-nuns-filter-pills::-webkit-scrollbar {
		display: none; /* Chrome/Safari */
	}

	.sfx-filter-pill {
		padding: 8px 14px;
		font-size: 12px;
		flex-shrink: 0;
	}

	.sfx-layout-btn {
		min-width: 40px;
		height: 40px;
	}

	.sfx-nuns-container.sfx-view-grid {
		grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
		gap: 16px;
	}

	.sfx-card-photo-wrapper {
		height: 200px;
	}

	.sfx-btn-view-profile {
		padding: 12px 16px;
		min-height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.sfx-nuns-pagination-container {
		flex-wrap: wrap;
		padding: 12px;
		gap: 10px;
	}

	.sfx-page-btn {
		padding: 10px 18px;
		min-height: 42px;
		flex: 1;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.sfx-page-numbers {
		order: -1;
		width: 100%;
		justify-content: center;
		margin-bottom: 4px;
	}

	.sfx-page-num {
		width: 40px;
		height: 40px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.sfx-nuns-directory-wrapper {
		margin: 10px 0;
	}

	.sfx-nuns-container.sfx-view-grid {
		grid-template-columns: 1fr; /* Single column on phones */
		gap: 16px;
	}

	.sfx-card-photo-wrapper {
		height: 190px;
	}

	.sfx-card-content {
		padding: 14px 16px;
	}

	.sfx-nun-title {
		font-size: 16px;
	}

	.sfx-meta-item {
		font-size: 12px;
	}

	.sfx-nun-modal-backdrop {
		padding: 10px;
	}

	.sfx-nun-modal-content {
		max-height: 94vh;
		border-radius: 12px;
	}

	.sfx-modal-header-hero {
		height: 180px;
	}

	.sfx-modal-hero-overlay {
		padding: 16px;
	}

	.sfx-modal-hero-overlay h2 {
		font-size: 19px;
	}

	.sfx-modal-details-grid {
		grid-template-columns: 1fr;
		padding: 16px;
		gap: 10px;
	}

	.sfx-modal-bio-section {
		padding: 0 16px 16px 16px;
	}

	.sfx-modal-close {
		top: 10px;
		right: 10px;
		width: 36px;
		height: 36px;
	}
}
