/**
 * Dynamic Forge Public Styles
 *
 * Minimal structural CSS - inherits theme styling by default.
 *
 * @package Dynamic_Forge
 */

/* Variables */
:root {
	--df-spacing-xs: 4px;
	--df-spacing-sm: 8px;
	--df-spacing-md: 16px;
	--df-spacing-lg: 24px;
	--df-spacing-xl: 32px;
	--df-radius: 8px;
	--df-radius-sm: 4px;
	--df-transition: 0.2s ease;
}

/* Base Block Styles */
.df-block {
	margin: var(--df-spacing-md) 0;
}

/* Dynamic Content Block */
.df-dynamic-content {
	display: flex;
	flex-direction: column;
	gap: var(--df-spacing-md);
}

.df-dynamic-content.df-layout-grid {
	display: grid;
	grid-template-columns: repeat(var(--df-columns, 3), 1fr);
	gap: var(--df-spacing-md);
}

@media (max-width: 1024px) {
	.df-dynamic-content.df-layout-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.df-dynamic-content.df-layout-grid {
		grid-template-columns: 1fr;
	}
}

.df-dynamic-content .df-item {
	display: flex;
	gap: var(--df-spacing-md);
	padding: var(--df-spacing-md);
	border-radius: var(--df-radius);
	transition: background-color var(--df-transition);
}

.df-dynamic-content.df-layout-grid .df-item {
	flex-direction: column;
}

.df-dynamic-content .df-item:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.df-dynamic-content .df-thumbnail {
	flex-shrink: 0;
	width: 120px;
	height: 80px;
	overflow: hidden;
	border-radius: var(--df-radius-sm);
}

.df-dynamic-content.df-layout-grid .df-thumbnail {
	width: 100%;
	height: 160px;
}

.df-dynamic-content .df-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--df-transition);
}

.df-dynamic-content .df-item:hover .df-thumbnail img {
	transform: scale(1.05);
}

.df-dynamic-content .df-content {
	flex: 1;
	min-width: 0;
}

.df-dynamic-content .df-title {
	margin: 0 0 var(--df-spacing-xs) 0;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.4;
}

.df-dynamic-content .df-title a {
	color: inherit;
	text-decoration: none;
}

.df-dynamic-content .df-title a:hover {
	text-decoration: underline;
}

.df-dynamic-content .df-excerpt {
	font-size: 0.9em;
	opacity: 0.8;
	margin-bottom: var(--df-spacing-sm);
	line-height: 1.5;
}

.df-dynamic-content .df-meta {
	display: flex;
	align-items: center;
	gap: var(--df-spacing-sm);
	font-size: 0.8em;
	opacity: 0.6;
}

.df-dynamic-content .df-trending-badge {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px 8px;
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	border-radius: 9999px;
	font-size: 0.85em;
	font-weight: 500;
}

/* Image Ratio Classes */
.df-thumbnail-landscape {
	aspect-ratio: 16 / 9;
}

.df-thumbnail-square {
	aspect-ratio: 1 / 1;
}

.df-thumbnail-portrait {
	aspect-ratio: 3 / 4;
}

.df-dynamic-content .df-thumbnail {
	position: relative;
}

/* Overlay Badges */
.df-trending-badge-overlay {
	position: absolute;
	top: var(--df-spacing-sm);
	left: var(--df-spacing-sm);
	font-size: 1.2em;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.df-sale-badge {
	position: absolute;
	top: var(--df-spacing-sm);
	right: var(--df-spacing-sm);
	background: #ef4444;
	color: #fff;
	padding: 2px 8px;
	border-radius: var(--df-radius-sm);
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
}

/* Product-specific styles */
.df-item-product .df-price {
	font-size: 1.1em;
	font-weight: 600;
	color: inherit;
	margin: var(--df-spacing-xs) 0;
}

.df-item-product .df-price del {
	opacity: 0.5;
	font-weight: 400;
	margin-right: var(--df-spacing-xs);
}

.df-item-product .df-price ins {
	text-decoration: none;
	color: #16a34a;
}

.df-item-product .df-rating {
	margin: var(--df-spacing-xs) 0;
}

.df-item-product .df-rating .star-rating {
	font-size: 0.9em;
}

.df-stock-status {
	font-size: 0.8em;
	font-weight: 500;
	margin: var(--df-spacing-xs) 0;
}

.df-in-stock {
	color: #16a34a;
}

.df-out-of-stock {
	color: #dc2626;
}

.df-add-to-cart {
	margin-top: var(--df-spacing-sm);
}

.df-add-to-cart-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--df-spacing-sm) var(--df-spacing-md);
	background: #3b82f6;
	color: #fff;
	border: none;
	border-radius: var(--df-radius-sm);
	font-size: 0.85em;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--df-transition);
}

.df-add-to-cart-btn:hover {
	background: #2563eb;
	color: #fff;
}

/* Meta elements */
.df-dynamic-content .df-author,
.df-dynamic-content .df-categories {
	opacity: 0.7;
}

.df-dynamic-content .df-categories {
	font-style: italic;
}

/* User Callout Block */
.df-user-callout {
	padding: var(--df-spacing-lg);
	border-radius: var(--df-radius);
	text-align: center;
}

.df-user-callout .df-callout-content {
	max-width: 600px;
	margin: 0 auto;
}

.df-user-callout .df-message {
	margin: 0 0 var(--df-spacing-md) 0;
	font-size: 1.1em;
	line-height: 1.5;
}

.df-user-callout .df-callout-buttons {
	display: flex;
	justify-content: center;
	gap: var(--df-spacing-sm);
	flex-wrap: wrap;
}

.df-user-callout .df-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--df-spacing-sm) var(--df-spacing-lg);
	border-radius: var(--df-radius-sm);
	font-size: 0.95em;
	font-weight: 500;
	text-decoration: none;
	transition: all var(--df-transition);
	cursor: pointer;
}

.df-user-callout .df-button-login {
	background: #3b82f6;
	color: #fff;
}

.df-user-callout .df-button-login:hover {
	background: #2563eb;
}

.df-user-callout .df-button-register {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
}

.df-user-callout .df-button-register:hover {
	background: rgba(0, 0, 0, 0.05);
}

/* FOMO Inline Block */
.df-fomo-inline {
	display: inline-flex;
	align-items: center;
	gap: var(--df-spacing-xs);
	padding: var(--df-spacing-xs) var(--df-spacing-sm);
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	border-radius: var(--df-radius-sm);
	font-size: 0.9em;
	font-weight: 500;
}

.df-fomo-inline .df-fomo-icon {
	font-size: 1.1em;
}

.df-fomo-inline .df-fomo-message {
	line-height: 1;
}

/* FOMO Corner Notification */
.df-fomo-corner {
	position: fixed;
	bottom: var(--df-spacing-lg);
	left: var(--df-spacing-lg);
	max-width: 320px;
	padding: var(--df-spacing-md);
	background: #fff;
	border-radius: var(--df-radius);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
	z-index: 9999;
	animation: df-slide-in 0.3s ease;
}

.df-fomo-corner.df-hiding {
	animation: df-slide-out 0.3s ease forwards;
}

@keyframes df-slide-in {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes df-slide-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(20px);
	}
}

.df-fomo-corner .df-fomo-close {
	position: absolute;
	top: var(--df-spacing-sm);
	right: var(--df-spacing-sm);
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	opacity: 0.5;
	transition: opacity var(--df-transition);
	font-size: 18px;
	line-height: 1;
}

.df-fomo-corner .df-fomo-close:hover {
	opacity: 1;
}

.df-fomo-corner .df-fomo-content {
	display: flex;
	align-items: flex-start;
	gap: var(--df-spacing-md);
}

.df-fomo-corner .df-fomo-icon {
	font-size: 24px;
	flex-shrink: 0;
}

.df-fomo-corner .df-fomo-text {
	flex: 1;
}

.df-fomo-corner .df-fomo-title {
	margin: 0 0 var(--df-spacing-xs) 0;
	font-size: 0.95em;
	font-weight: 600;
}

.df-fomo-corner .df-fomo-message {
	margin: 0;
	font-size: 0.85em;
	opacity: 0.8;
}

/* Editor Preview Styles */
.df-editor-preview {
	padding: var(--df-spacing-lg);
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: var(--df-radius);
}

.df-editor-placeholder {
	text-align: center;
	color: #64748b;
}

.df-editor-placeholder .df-icon {
	font-size: 32px;
	display: block;
	margin-bottom: var(--df-spacing-sm);
}

.df-editor-placeholder h4 {
	margin: 0 0 var(--df-spacing-xs) 0;
	font-size: 1em;
	font-weight: 600;
	color: #334155;
}

.df-editor-placeholder p {
	margin: 0;
	font-size: 0.9em;
}

.df-fomo-preview {
	display: inline-flex;
	align-items: center;
	gap: var(--df-spacing-xs);
	padding: var(--df-spacing-sm) var(--df-spacing-md);
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	border-radius: var(--df-radius-sm);
}

/* Smart CTA Block */
.df-smart-cta {
	margin: var(--df-spacing-lg) 0;
}

/* Background Image Support */
.df-smart-cta.df-cta-has-bg {
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	position: relative;
	border-radius: var(--df-radius);
	overflow: hidden;
}

.df-smart-cta.df-cta-has-bg::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: transparent;
	z-index: 1;
}

.df-smart-cta.df-cta-has-bg .df-cta-inner {
	position: relative;
	padding: 24px;
}

.df-smart-cta.df-cta-has-bg .df-cta-heading,
.df-smart-cta.df-cta-has-bg .df-cta-message,
.df-smart-cta.df-cta-has-bg .df-cta-icon {
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	font-weight: 700;
}

.df-smart-cta.df-cta-has-bg .df-cta-message {
	opacity: 1;
}

/* When using background image, keep inner transparent (no card overlay) */
.df-smart-cta.df-cta-has-bg .df-cta-inner {
	background: transparent;
	border: none;
	box-shadow: none;
}
.df-smart-cta.df-cta-has-bg .df-cta-heading { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.df-smart-cta.df-cta-has-bg .df-cta-message { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.df-smart-cta.df-cta-has-bg .df-cta-icon { color: #fff; }
.df-smart-cta.df-cta-has-bg .df-cta-team {
	background: rgba(0, 0, 0, 0.2);
}
.df-smart-cta.df-cta-has-bg .df-cta-team-name { color: #fff; }

.df-nowrap { white-space: nowrap; }

.df-smart-cta.df-cta-loading {
	min-height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.df-cta-placeholder {
	text-align: center;
}

.df-cta-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-left-color: #3b82f6;
	border-radius: 50%;
	animation: df-spin 0.8s linear infinite;
}

@keyframes df-spin {
	to { transform: rotate(360deg); }
}

.df-cta-fixture-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-bottom: 14px;
	flex-wrap: wrap;
	max-width: 90%;
	margin-left: auto;
	margin-right: auto;
}

.df-cta-fixture-row-inline {
	flex-direction: row;
}

.df-cta-team {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	padding: 4px 8px;
	border-radius: 12px;
}

.df-cta-team-badge {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: 50%;
	background: rgba(0,0,0,0.15);
	padding: 5px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.df-cta-team-name {
	font-weight: 600;
	white-space: nowrap;
}

.df-cta-inner {
	display: flex;
	align-items: center;
	gap: var(--df-spacing-lg);
	padding: var(--df-spacing-lg);
	border-radius: var(--df-radius);
}

/* Layout: Banner */
.df-cta-layout-banner .df-cta-inner {
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	border: 1px solid #e2e8f0;
}

/* Layout: Card */
.df-cta-layout-card .df-cta-inner {
	background: #fff;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	flex-direction: column;
	text-align: center;
	max-width: 400px;
	margin: 0 auto;
}

/* Layout: Minimal */
.df-cta-layout-minimal .df-cta-inner {
	background: transparent;
	padding: var(--df-spacing-md) 0;
	border-bottom: 1px solid #e2e8f0;
}

/* Layout: Floating */
.df-cta-layout-floating {
	position: fixed;
	bottom: var(--df-spacing-lg);
	right: var(--df-spacing-lg);
	z-index: 9998;
	max-width: 360px;
}

.df-cta-layout-floating .df-cta-inner {
	background: #fff;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	flex-direction: column;
	text-align: center;
}

/* Alignment */
.df-cta-align-left .df-cta-inner {
	justify-content: flex-start;
	text-align: left;
}

.df-cta-align-center .df-cta-inner {
	justify-content: center;
	text-align: center;
}

.df-cta-align-right .df-cta-inner {
	justify-content: flex-end;
	text-align: right;
}

/* CTA Elements */
.df-cta-icon {
	font-size: 2.5em;
	flex-shrink: 0;
}

.df-cta-content {
	flex: 1;
	min-width: 0;
}

.df-cta-heading {
	margin: 0 0 var(--df-spacing-xs) 0;
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.3;
}

.df-cta-message {
	margin: 0;
	font-size: 0.95em;
	opacity: 0.8;
	line-height: 1.5;
}

.df-cta-action {
	flex-shrink: 0;
}

/* CTA Button Styles */
.df-cta-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border-radius: var(--df-radius-sm);
	font-size: 0.95em;
	font-weight: 600;
	text-decoration: none;
	transition: all var(--df-transition);
	cursor: pointer;
	border: none;
}

.df-cta-button-primary {
	background: #3b82f6;
	color: #fff;
}

.df-cta-button-primary:hover {
	background: #2563eb;
	color: #fff;
}

.df-cta-button-secondary {
	background: #64748b;
	color: #fff;
}

.df-cta-button-secondary:hover {
	background: #475569;
	color: #fff;
}

.df-cta-button-success {
	background: #10b981;
	color: #fff;
}

.df-cta-button-success:hover {
	background: #059669;
	color: #fff;
}

.df-cta-button-warning {
	background: #f59e0b;
	color: #fff;
}

.df-cta-button-warning:hover {
	background: #d97706;
	color: #fff;
}

.df-cta-button-gradient {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
}

.df-cta-button-gradient:hover {
	background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
	color: #fff;
}

/* Style Variations */
.df-cta-style-primary .df-cta-inner {
	background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
	border-color: #bfdbfe;
}

.df-cta-style-success .df-cta-inner {
	background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
	border-color: #a7f3d0;
}

.df-cta-style-warning .df-cta-inner {
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border-color: #fde68a;
}

.df-cta-style-gradient .df-cta-inner {
	background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
	border-color: #ddd6fe;
}

/* Trending Item in CTA */
.df-cta-trending {
	display: flex;
	align-items: center;
	gap: var(--df-spacing-md);
	margin-top: var(--df-spacing-md);
	padding: var(--df-spacing-md);
	background: rgba(255, 255, 255, 0.7);
	border-radius: var(--df-radius-sm);
}

.df-cta-trending-img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: var(--df-radius-sm);
	flex-shrink: 0;
}

.df-cta-trending-info {
	flex: 1;
	min-width: 0;
}

.df-cta-trending-label {
	display: block;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #ef4444;
	margin-bottom: 2px;
}

.df-cta-trending-title {
	display: block;
	font-weight: 500;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.df-cta-trending-title:hover {
	text-decoration: underline;
}

.df-cta-trending-price {
	display: block;
	font-size: 0.9em;
	font-weight: 600;
	margin-top: 2px;
}

/* Animation */
.df-cta-animate {
	opacity: 0;
	transform: translateY(10px);
	animation: df-cta-fade-in 0.4s ease forwards;
}

.df-cta-animate.df-cta-visible {
	animation: df-cta-fade-in 0.4s ease forwards;
}

@keyframes df-cta-fade-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Editor Preview */
.df-cta-editor-preview {
	display: flex;
	align-items: center;
	gap: var(--df-spacing-lg);
	padding: var(--df-spacing-lg);
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	border-radius: var(--df-radius);
	position: relative;
}

.df-cta-editor-preview .df-cta-icon {
	font-size: 2em;
}

.df-cta-preview-content {
	flex: 1;
}

.df-cta-preview-content h4 {
	margin: 0 0 var(--df-spacing-xs) 0;
	font-size: 1.1em;
	font-weight: 600;
}

.df-cta-preview-content p {
	margin: 0;
	font-size: 0.9em;
	opacity: 0.7;
}

.df-cta-preview-btn {
	display: inline-block;
	margin-top: var(--df-spacing-sm);
	padding: 6px 16px;
	background: #3b82f6;
	color: #fff;
	border-radius: var(--df-radius-sm);
	font-size: 0.85em;
	font-weight: 500;
}

.df-cta-variations-count {
	position: absolute;
	top: var(--df-spacing-sm);
	right: var(--df-spacing-sm);
	padding: 2px 8px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 9999px;
	font-size: 0.75em;
	font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
	.df-cta-inner {
		flex-direction: column;
		text-align: center;
	}

	.df-cta-layout-floating {
		left: var(--df-spacing-md);
		right: var(--df-spacing-md);
		max-width: none;
	}

	.df-cta-trending {
		flex-direction: column;
		text-align: center;
	}
}

@media (max-width: 600px) {
	.df-dynamic-content .df-item {
		flex-direction: column;
	}

	.df-dynamic-content .df-thumbnail {
		width: 100%;
		height: 160px;
	}

	.df-fomo-corner {
		left: var(--df-spacing-md);
		right: var(--df-spacing-md);
		max-width: none;
	}
}

/* Print Styles */
@media print {
	.df-fomo-corner,
	.df-fomo-inline {
		display: none !important;
	}
}
