/**
 * Feeling For You – Poem Manager
 * Modal stylesheet — the "love letter" fullscreen modal.
 */

.ffy-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(58, 34, 51, 0.55);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.ffy-modal-overlay[hidden] {
	display: none;
}

.ffy-modal-overlay.is-open {
	opacity: 1;
}

.ffy-modal {
	--ffy-primary: #E91E63;
	--ffy-secondary: #FF5E8A;
	--ffy-accent: #FF8FAB;
	--ffy-soft-rose: #FDE2E4;
	--ffy-cream: #FFF8F2;
	--ffy-ink: #3A2233;
	--ffy-ink-soft: #7A5C6E;
	--ffy-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--ffy-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	position: relative;
	width: 100%;
	max-width: 780px;
	max-height: 88vh;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 240, 245, 0.96) 100%);
	border-radius: 28px;
	box-shadow: 0 30px 80px rgba(58, 34, 51, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
	overflow: hidden;
	transform: scale(0.92) translateY(20px);
	opacity: 0;
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
	font-family: var(--ffy-font-body);
	color: var(--ffy-ink);
}

.ffy-modal-overlay.is-open .ffy-modal {
	transform: scale(1) translateY(0);
	opacity: 1;
}

.ffy-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 5;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.85);
	color: var(--ffy-primary);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(58, 34, 51, 0.2);
	transition: transform 0.25s ease, background 0.25s ease;
}

.ffy-modal__close:hover {
	transform: rotate(90deg) scale(1.08);
	background: var(--ffy-primary);
	color: #fff;
}

.ffy-modal__scroll {
	max-height: 88vh;
	overflow-y: auto;
	scrollbar-width: thin;
}

.ffy-modal__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 100px 20px;
	color: var(--ffy-ink-soft);
}

.ffy-loader {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 4px solid var(--ffy-soft-rose);
	border-top-color: var(--ffy-primary);
	animation: ffy-spin 0.9s linear infinite;
}

@keyframes ffy-spin {
	to { transform: rotate(360deg); }
}

.ffy-modal__media {
	width: 100%;
	aspect-ratio: 16 / 8;
	overflow: hidden;
	position: relative;
	background: linear-gradient(135deg, var(--ffy-primary), var(--ffy-secondary));
}

.ffy-modal__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ffy-modal__body {
	padding: 32px 40px 40px;
}

.ffy-modal__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.ffy-modal__categories span {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--ffy-primary);
	background: var(--ffy-soft-rose);
	padding: 4px 12px;
	border-radius: 999px;
}

.ffy-modal__title {
	font-family: var(--ffy-font-heading);
	font-size: 34px;
	line-height: 1.25;
	margin: 0 0 8px;
	background: linear-gradient(135deg, var(--ffy-primary), var(--ffy-secondary));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.ffy-modal__author {
	font-style: italic;
	color: var(--ffy-ink-soft);
	margin: 0 0 24px;
	font-size: 15px;
}

.ffy-modal__poem {
	font-size: 17px;
	line-height: 1.9;
	color: var(--ffy-ink);
	white-space: pre-wrap;
}

.ffy-modal__poem p {
	margin: 0 0 1.4em;
}

.ffy-modal__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid rgba(233, 30, 99, 0.15);
}

.ffy-like-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: none;
	border-radius: 999px;
	padding: 12px 24px;
	background: linear-gradient(135deg, var(--ffy-primary), var(--ffy-secondary));
	color: #fff;
	font-family: var(--ffy-font-body);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(233, 30, 99, 0.3);
	transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.ffy-like-btn:hover {
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 14px 30px rgba(233, 30, 99, 0.4);
}

.ffy-like-btn[aria-pressed="true"] {
	filter: brightness(0.92);
}

.ffy-like-btn .ffy-heart-icon {
	font-size: 16px;
}

.ffy-modal__views {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--ffy-ink-soft);
	font-weight: 500;
}

.ffy-modal__error {
	padding: 80px 40px;
	text-align: center;
	color: var(--ffy-ink-soft);
}

/* Body scroll lock */
body.ffy-modal-open {
	overflow: hidden;
}

/* Responsive */
@media (max-width: 782px) {
	.ffy-modal {
		max-height: 92vh;
		border-radius: 22px;
	}

	.ffy-modal__body {
		padding: 26px 22px 30px;
	}

	.ffy-modal__title {
		font-size: 26px;
	}

	.ffy-modal__poem {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.ffy-modal-overlay {
		padding: 0;
	}

	.ffy-modal {
		max-width: 100%;
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.ffy-modal__scroll {
		max-height: 100%;
	}

	.ffy-modal__footer {
		flex-direction: column;
		align-items: stretch;
	}
}
