/**
 * Allfresh Portal — Public Styles
 *
 * Portal layout, tab navigation, document list, stat cards,
 * filter bar, profile form, and responsive styles.
 *
 * @package AllfreshPortal
 */

/* ── Portal Layout ─────────────────────────────────────────────── */

.afp-portal {
	max-width: 1100px;
	margin: 2rem auto;
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 2rem;
	font-family: "Poppins", sans-serif;
}

/* ── Tab Navigation ────────────────────────────────────────────── */

.afp-portal__nav {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	background: #FFFFFF;
	border-radius: 8px;
	padding: 1rem 0.75rem;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	border: 1px solid #E0DCD0;
	align-self: flex-start;
	position: sticky;
	top: 100px;
}

.afp-portal__tab {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #545454;
	text-decoration: none;
	transition: all 0.2s ease;
}

.afp-portal__tab:hover {
	background: #F4F1E3;
	color: #1D1C1C;
	text-decoration: none;
}

.afp-portal__tab--active {
	background: #BD9331;
	color: #FFFFFF;
	font-weight: 600;
}

.afp-portal__tab--active:hover {
	background: #A67E2B;
	color: #FFFFFF;
}

.afp-portal__tab--logout {
	margin-top: 0.75rem;
	border-top: 1px solid #E0DCD0;
	padding-top: 1rem;
	color: #C62828;
}

.afp-portal__tab--logout:hover {
	background: #FFEBEE;
	color: #C62828;
}

.afp-portal__tab .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 18px;
}

/* ── Tab Content ───────────────────────────────────────────────── */

.afp-portal__content {
	min-height: 400px;
}

.afp-tab-content {
	background: #FFFFFF;
	border-radius: 8px;
	padding: 2rem;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	border: 1px solid #E0DCD0;
}

.afp-tab-content h2 {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.75rem;
	font-weight: 700;
	color: #1D1C1C;
	margin: 0 0 1.5rem 0;
	padding-bottom: 1rem;
	border-bottom: 2px solid #F4F1E3;
}

.afp-tab-content h3 {
	font-family: "Poppins", sans-serif;
	font-size: 1.125rem;
	font-weight: 600;
	color: #1D1C1C;
	margin: 1.5rem 0 1rem 0;
}

/* ── Stat Cards ────────────────────────────────────────────────── */

.afp-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.25rem;
	margin-bottom: 2rem;
}

.afp-stat-card {
	text-align: center;
	padding: 1.5rem 1rem;
	background: #F4F1E3;
	border-radius: 8px;
	border: 1px solid #E0DCD0;
}

.afp-stat-card__number {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 2.25rem;
	font-weight: 700;
	color: #BD9331;
	line-height: 1;
	margin-bottom: 0.375rem;
}

.afp-stat-card__label {
	font-size: 0.8125rem;
	font-weight: 500;
	color: #545454;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ── Document List ─────────────────────────────────────────────── */

.afp-doc-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.afp-doc-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	background: #FAFAF8;
	border-radius: 6px;
	border: 1px solid #E0DCD0;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.afp-doc-item:hover {
	border-color: #BD9331;
	box-shadow: 0 2px 12px rgba(189, 147, 49, 0.1);
}

.afp-doc-item__icon {
	color: #BD9331;
	font-size: 24px;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.afp-doc-item__info {
	flex: 1;
	min-width: 0;
}

.afp-doc-item__info strong {
	display: block;
	font-size: 0.9375rem;
	color: #1D1C1C;
	margin-bottom: 0.25rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afp-doc-item__desc {
	font-size: 0.8125rem;
	color: #777;
	margin: 0 0 0.25rem 0;
	line-height: 1.4;
}

.afp-doc-item__meta {
	font-size: 0.75rem;
	color: #999;
}

.afp-doc-item__download {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #F4F1E3;
	color: #BD9331;
	text-decoration: none;
	flex-shrink: 0;
	transition: background 0.2s ease, color 0.2s ease;
}

.afp-doc-item__download:hover {
	background: #BD9331;
	color: #FFFFFF;
}

/* ── Filter Bar ────────────────────────────────────────────────── */

.afp-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.afp-filter-btn {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1rem;
	font-family: "Poppins", sans-serif;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #545454;
	background: #FAFAF8;
	border: 1px solid #E0DCD0;
	border-radius: 999px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.afp-filter-btn:hover {
	background: #F4F1E3;
	color: #1D1C1C;
	text-decoration: none;
}

.afp-filter-btn--active {
	background: #BD9331;
	color: #FFFFFF;
	border-color: #BD9331;
}

.afp-filter-btn--active:hover {
	background: #A67E2B;
	color: #FFFFFF;
}

/* ── Login / Access Denied ─────────────────────────────────────── */

.afp-login-required,
.afp-access-denied {
	max-width: 480px;
	margin: 4rem auto;
	text-align: center;
	padding: 3rem 2rem;
	background: #FFFFFF;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	border: 1px solid #E0DCD0;
}

.afp-login-required p,
.afp-access-denied p {
	font-size: 1.0625rem;
	color: #545454;
	margin-bottom: 1.5rem;
}

/* ── Empty State ───────────────────────────────────────────────── */

.afp-empty {
	text-align: center;
	padding: 2rem;
	color: #999;
	font-style: italic;
	font-size: 0.9375rem;
}

/* ── Buttons (shared with Core) ────────────────────────────────── */

.allfresh-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-family: "Poppins", sans-serif;
	font-size: 0.9375rem;
	font-weight: 600;
	padding: 0.75rem 1.75rem;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	line-height: 1.4;
}

.allfresh-btn--primary {
	background: #BD9331;
	color: #FFFFFF;
}

.allfresh-btn--primary:hover {
	background: #A67E2B;
	color: #FFFFFF;
	text-decoration: none;
}

/* ── Profile Form ──────────────────────────────────────────────── */

.afp-tab-content .allfresh-form {
	max-width: none;
	margin: 0;
	padding: 0;
	box-shadow: none;
	border: none;
}

.afp-tab-content .allfresh-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
	margin-bottom: 1.25rem;
}

.afp-tab-content .allfresh-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.afp-tab-content .allfresh-form__field--full {
	margin-bottom: 1.25rem;
}

.afp-tab-content .allfresh-form__field label {
	font-size: 0.875rem;
	font-weight: 500;
	color: #1D1C1C;
}

.afp-tab-content .allfresh-form__field input {
	font-family: "Poppins", sans-serif;
	font-size: 0.9375rem;
	padding: 0.75rem 1rem;
	border: 1px solid #E0DCD0;
	border-radius: 6px;
	background: #FAFAF8;
	color: #1D1C1C;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.afp-tab-content .allfresh-form__field input:focus {
	outline: none;
	border-color: #BD9331;
	box-shadow: 0 0 0 3px rgba(189, 147, 49, 0.15);
}

.afp-tab-content .allfresh-form__field input:disabled {
	background: #F0F0EE;
	color: #999;
	cursor: not-allowed;
}

.afp-tab-content .allfresh-form__field small {
	font-size: 0.75rem;
	color: #999;
}

.afp-tab-content .allfresh-form__submit {
	margin-top: 1.5rem;
}

.afp-tab-content .allfresh-form__feedback {
	margin-top: 1rem;
	padding: 1rem 1.25rem;
	border-radius: 6px;
	font-size: 0.9375rem;
}

.afp-tab-content .allfresh-form__feedback--success {
	background: #E8F5E9;
	color: #2E7D32;
	border: 1px solid #A5D6A7;
}

.afp-tab-content .allfresh-form__feedback--error {
	background: #FFEBEE;
	color: #C62828;
	border: 1px solid #EF9A9A;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.afp-portal {
		grid-template-columns: 1fr;
		margin: 1rem;
		gap: 1rem;
	}

	.afp-portal__nav {
		flex-direction: row;
		overflow-x: auto;
		padding: 0.5rem;
		position: static;
		gap: 0.25rem;
	}

	.afp-portal__tab {
		white-space: nowrap;
		padding: 0.5rem 0.75rem;
		font-size: 0.8125rem;
	}

	.afp-portal__tab--logout {
		margin-top: 0;
		border-top: none;
		padding-top: 0.5rem;
		margin-left: auto;
	}

	.afp-tab-content {
		padding: 1.25rem;
	}

	.afp-tab-content .allfresh-form__row {
		grid-template-columns: 1fr;
	}

	.afp-stats-grid {
		grid-template-columns: 1fr 1fr;
	}

	.afp-doc-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.afp-doc-item .allfresh-btn {
		width: 100%;
		justify-content: center;
	}

	.afp-filter-bar {
		gap: 0.375rem;
	}

	.afp-filter-btn {
		font-size: 0.75rem;
		padding: 0.375rem 0.75rem;
	}
}

@media (max-width: 480px) {
	.afp-stats-grid {
		grid-template-columns: 1fr;
	}
}
