/**
 * Broken Image Fallback Pro - CSS Styles
 * Performance-optimized styles for fallback elements
 */

/* Base fallback styles */
.brokimfa-alt-text-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	box-sizing: border-box;
	word-wrap: break-word;
	overflow-wrap: break-word;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 1.4;
}

/* Fade transition class */
.brokimfa-fade-in {
	transition: opacity 0.3s ease-in-out;
}

/* Processing state */
.brokimfa-processing {
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

/* WordPress-specific fallback styles */
.brokimfa-featured-image-fallback,
.brokimfa-featured-fallback {
	max-width: 100%;
	height: auto;
	object-fit: cover;
}

/* Featured image placeholder styles (when no featured image is set) */
.brokimfa-featured-placeholder {
	max-width: 100%;
	height: auto;
	object-fit: cover;
	opacity: 0.8;
	border: 2px dashed rgba(0, 123, 255, 0.3);
}

.brokimfa-featured-placeholder:hover {
	opacity: 1;
	border-color: rgba(0, 123, 255, 0.6);
}

.brokimfa-gutenberg-fallback {
	width: 100%;
	height: auto;
	display: block;
}

.brokimfa-taxonomy-fallback {
	border-radius: 4px;
	max-width: 150px;
	height: auto;
}

/* Featured image specific styles */
.post-thumbnail .brokimfa-fallback-image,
.wp-post-image.brokimfa-fallback-image {
	border: 2px solid transparent;
	transition: border-color 0.3s ease;
}

.post-thumbnail:hover .brokimfa-fallback-image,
.wp-post-image.brokimfa-fallback-image:hover {
	border-color: rgba(0, 123, 255, 0.3);
}

/* Gutenberg block fallbacks */
.wp-block-image .brokimfa-fallback-image {
	width: 100%;
	height: auto;
	border-radius: 2px;
}

.wp-block-gallery .brokimfa-fallback-image {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 2px;
}

.wp-block-media-text .brokimfa-fallback-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Taxonomy image fallbacks */
.category-image .brokimfa-fallback-image,
.tag-image .brokimfa-fallback-image,
.taxonomy-image .brokimfa-fallback-image,
.term-image .brokimfa-fallback-image {
	border-radius: 50%;
	max-width: 100px;
	max-height: 100px;
	object-fit: cover;
}

/* Alt text fallbacks for different contexts */
.brokimfa-featured-image-alt-fallback {
	min-height: 200px;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 16px;
	color: #4a5568;
}

.brokimfa-gutenberg-alt-fallback {
	background: #f8f9fa;
	border: 2px dashed #dee2e6;
	border-radius: 4px;
	min-height: 150px;
	position: relative;
}

.brokimfa-gutenberg-alt-fallback::before {
	content: "📷";
	position: absolute;
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 24px;
	opacity: 0.5;
}

.brokimfa-taxonomy-alt-fallback {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
	color: white;
	font-weight: bold;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	line-height: 1.2;
}

/* Responsive behavior */
.brokimfa-alt-text-fallback {
	max-width: 100%;
	height: auto;
}

/* Print styles */
@media print {
	.brokimfa-alt-text-fallback {
		border: 1px solid #000 !important;
		background: #fff !important;
		color: #000 !important;
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.brokimfa-alt-text-fallback {
		border-width: 2px;
		font-weight: bold;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.brokimfa-fade-in,
	.brokimfa-processing {
		transition: none !important;
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.brokimfa-alt-text-fallback {
		background-color: #2a2a2a;
		color: #e0e0e0;
		border-color: #555;
	}
}