/**
 * Custom Tailwind Utilities for AI Macro Nexus Theme
 *
 * These custom classes extend Tailwind CSS functionality
 * for glassmorphism effects and brand-specific styling.
 *
 * @package AI_Macro_Nexus
 * @since 1.0.0
 */

@layer utilities {

	/**
	 * Text Stroke Effect
	 * Creates outlined text with 1px stroke
	 */
	.text-stroke {
		-webkit-text-stroke: 1px currentColor;
	}

	/**
	 * Custom Backdrop Blur for Header
	 * Specific blur amount for glassmorphic header
	 */
	.backdrop-blur-custom {
		backdrop-filter: blur(3.6px);
		-webkit-backdrop-filter: blur(3.6px);
	}

	/**
	 * Brand Gradient Button
	 * Orange gradient for CTAs and buttons
	 */
	.btn-gradient {
		background: linear-gradient(90deg, #ff7c00 41.486%, #ff5900 100%);
	}

	/**
	 * Glassmorphism Effect for Cards
	 * Blur effect with semi-transparent dark background
	 */
	.glass-effect {
		backdrop-filter: blur(7px);
		-webkit-backdrop-filter: blur(7px);
		background: rgba(3, 3, 3, 0.6);
	}
}

/**
 * Smooth Scroll Behavior
 * Applied to html element for smooth anchor scrolling
 */
html.scroll-smooth {
	scroll-behavior: smooth;
}

/**
 * WordPress Custom Logo Styling
 * Estiliza o custom logo do WordPress (Appearance → Customize → Site Identity)
 */
.custom-logo-link {
	display: inline-block;
	line-height: 0;
}

.custom-logo {
	height: 31px;
	width: auto;
	max-width: none;
	display: block;
}

/**
 * WordPress Admin Bar Compatibility
 * Prevents admin toolbar from overlapping fixed header and anchor links
 *
 * Uses CSS variable --wp-admin--admin-bar--height (available since WP 5.9)
 * which automatically adjusts: 32px on desktop, 46px on mobile (≤782px)
 */

/* Adjust scroll padding for anchor links when admin bar is present */
html {
	scroll-padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + 72px);
}

/* Adjust fixed header position when logged in (admin bar present) */
.admin-bar header {
	top: var(--wp-admin--admin-bar--height, 0px);
}

/* Ensure header stays below admin bar (admin bar z-index is 99999) */
.admin-bar header {
	z-index: 9999;
}

/**
 * Alternative Fallback for Older WordPress Versions (< 5.9)
 * Uncomment if your WordPress version doesn't support --wp-admin--admin-bar--height
 */
/*
.admin-bar header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar header {
		top: 46px;
	}
}
*/

/**
 * Mobile Menu Transitions
 * Animações para abrir/fechar menu mobile
 */

/* Estado inicial: menu fechado */
#mobile-menu {
	transform: translateX(100%);
	transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Estado aberto */
#mobile-menu[data-menu-open="true"] {
	transform: translateX(0);
	opacity: 1 !important;
	pointer-events: auto !important;
}

/* Prevenir scroll do body quando menu aberto */
body.mobile-menu-open {
	overflow: hidden;
}

/* Esconder glassmorphic background do header quando menu mobile aberto */
body.mobile-menu-open #header-glass-bg {
	display: none;
}

/* Animação do backdrop */
#mobile-menu-backdrop {
	transition: opacity 0.3s ease-in-out;
}

/* Toggle entre Hamburger e Close Icon */
/* Estado fechado: mostra hamburger, esconde X */
#mobile-menu-toggle[aria-expanded="false"] #hamburger-icon {
	display: block;
}

#mobile-menu-toggle[aria-expanded="false"] #close-icon {
	display: none;
}

/* Estado aberto: esconde hamburger, mostra X */
#mobile-menu-toggle[aria-expanded="true"] #hamburger-icon {
	display: none;
}

#mobile-menu-toggle[aria-expanded="true"] #close-icon {
	display: block;
}

/* Transição suave dos ícones */
#hamburger-icon,
#close-icon {
	transition: opacity 0.2s ease-in-out;
}

/**
 * Hero Video Player
 * Custom styles for video player hover effects and accessibility
 */

/* Hover effect on play button icon */
.hero-video-icon {
	transition: transform 0.2s ease;
}

#hero-video-play-btn:hover .hero-video-icon {
	transform: scale(1.1);
}

#hero-video-play-btn:active .hero-video-icon {
	transform: scale(0.95);
}

/* Screen reader only utility */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/**
 * Gradient Text Utilities
 * For carousel statistics with gradient backgrounds
 */

/* Gradient Orange (Stats 1 & 2) */
.gradient-text-orange {
	background: linear-gradient(260deg, #ffefe0 5.74%, #ff5500 91.13%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* Gradient White to Orange (Stat 3) */
.gradient-text-white-orange {
	background: linear-gradient(262.79deg, #ffffff 4.23%, #ff7c00 90.10%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/**
 * Swiper Custom Styling
 * Override default Swiper styles to match theme
 */

/* CRITICAL: Linear timing for continuous smooth movement */
.carousel-swiper .swiper-wrapper {
	transition-timing-function: linear !important;
}

/* Carousel slides with natural width (auto) */
.carousel-swiper .swiper-slide {
	width: auto !important;
	max-width: 322px;
	/* Keep original image size from Figma */
	flex-shrink: 0;
}

/* Statistics Carousel (opposite direction from images) */
.stats-carousel .swiper-wrapper {
	transition-timing-function: linear !important;
}

.stats-carousel .swiper-slide {
	width: auto !important;
	flex-shrink: 0;
}

/* Swiper pagination bullets */
.carousel-swiper .swiper-pagination-bullet {
	background: #646667;
	opacity: 0.5;
}

.carousel-swiper .swiper-pagination-bullet-active {
	background: #ff7c00;
	opacity: 1;
}

/* Navigation buttons removed - carousel uses autoplay only */

/**
 * Single Report Content Styling
 * Prose-style formatting for WordPress editor content
 */
.prose {
	color: #e3e5e6;
	line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
	color: #ffffff;
	font-weight: 700;
	margin-top: 2em;
	margin-bottom: 1em;
	line-height: 1.3;
}

.prose h1 {
	font-size: 2.25em;
	margin-top: 0;
}

.prose h2 {
	font-size: 1.875em;
	margin-top: 2.5em;
}

.prose h3 {
	font-size: 1.5em;
}

.prose h4 {
	font-size: 1.25em;
}

.prose p {
	margin-top: 1.25em;
	margin-bottom: 1.25em;
}

.prose p:first-child {
	margin-top: 0;
}

.prose p:last-child {
	margin-bottom: 0;
}

.prose a {
	color: #ff7c00;
	text-decoration: underline;
	font-weight: 500;
	transition: color 0.2s ease;
}

.prose a:hover {
	color: #ff5900;
}

.prose strong {
	color: #ffffff;
	font-weight: 600;
}

.prose em {
	font-style: italic;
}

.prose ul,
.prose ol {
	margin-top: 1.25em;
	margin-bottom: 1.25em;
	padding-left: 1.625em;
}

.prose ul {
	list-style-type: disc;
}

.prose ol {
	list-style-type: decimal;
}

.prose li {
	margin-top: 0.5em;
	margin-bottom: 0.5em;
	color: #e3e5e6;
}

.prose li::marker {
	color: #ff7c00;
}

.prose blockquote {
	font-style: italic;
	border-left: 4px solid #ff7c00;
	padding-left: 1.5em;
	margin-top: 1.6em;
	margin-bottom: 1.6em;
	color: #adaeaf;
	quotes: "" " " "" "'" "'";
}

.prose blockquote p:first-of-type::before {
	content: open-quote;
}

.prose blockquote p:last-of-type::after {
	content: close-quote;
}

.prose code {
	color: #ffc28a;
	background-color: rgba(255, 124, 0, 0.1);
	padding: 0.2em 0.4em;
	border-radius: 0.25rem;
	font-size: 0.875em;
	font-family: 'Courier New', monospace;
}

.prose pre {
	background-color: #1e1e1e;
	color: #e3e5e6;
	overflow-x: auto;
	padding: 1.5em;
	border-radius: 0.5rem;
	margin-top: 1.6em;
	margin-bottom: 1.6em;
	border: 1px solid #2d2e2f;
}

.prose pre code {
	background-color: transparent;
	color: inherit;
	padding: 0;
	font-size: 0.875em;
}

.prose img,
.prose video {
	margin-top: 2em;
	margin-bottom: 2em;
	border-radius: 0.5rem;
	max-width: 100%;
	height: auto;
}

.prose figure {
	margin-top: 2em;
	margin-bottom: 2em;
}

.prose figcaption {
	color: #adaeaf;
	font-size: 0.875em;
	text-align: center;
	margin-top: 0.875em;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 2em;
	margin-bottom: 2em;
}

.prose thead {
	border-bottom: 2px solid #2d2e2f;
}

.prose thead th {
	color: #ffffff;
	font-weight: 600;
	padding: 0.75em 1em;
	text-align: left;
}

.prose tbody tr {
	border-bottom: 1px solid #2d2e2f;
}

.prose tbody td {
	padding: 0.75em 1em;
	color: #e3e5e6;
}

.prose tbody tr:hover {
	background-color: rgba(255, 124, 0, 0.05);
}

.prose hr {
	border: none;
	border-top: 1px solid #2d2e2f;
	margin-top: 3em;
	margin-bottom: 3em;
}

/* Line clamp utility for truncating text */
.line-clamp-2 {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/**
 * Discover More Swiper Styling (single-class.php)
 * Custom styles for the related classes carousel
 */

/* CRITICAL: Swiper container needs overflow hidden */
.discover-more-swiper {
	overflow: hidden;
}

/* Let Swiper control slide width via slidesPerView */
.discover-more-swiper .swiper-slide {
	/* Remove fixed width - let Swiper calculate based on slidesPerView */
	/* width: auto; */
	flex-shrink: 0;
}

/* Navigation button disabled state */
.discover-more-next.swiper-button-disabled,
.discover-more-prev.swiper-button-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/**
 * Single Report Header Styling
 * Dark header specific to single report pages only
 */
.single-report header {
	background: #0D0D0D;
}

.single-report #header-glass-bg {
	backdrop-filter: blur(3.6px);
	-webkit-backdrop-filter: blur(3.6px);
	background: transparent;
}

/**
 * Report Content Styling (Light Theme)
 * Typography and formatting for single report posts
 */
.report-content {
	color: #333333;
	font-size: 16px;
	line-height: 1.8;
}

.report-content h2,
.report-content h3,
.report-content h4,
.report-content h5,
.report-content h6 {
	color: #1a1a1a;
	font-weight: 700;
	margin-top: 2em;
	margin-bottom: 0.75em;
	line-height: 1.3;
}

.report-content h2 {
	font-size: 1.75em;
	margin-top: 2em;
}

.report-content h3 {
	font-size: 1.5em;
}

.report-content h4 {
	font-size: 1.25em;
}

.report-content p {
	margin-bottom: 1.25em;
}

.report-content p:last-child {
	margin-bottom: 0;
}

.report-content a {
	color: #ff7c00;
	text-decoration: underline;
	font-weight: 500;
	transition: color 0.2s ease;
}

.report-content a:hover {
	color: #ff5900;
}

.report-content strong,
.report-content b {
	color: #1a1a1a;
	font-weight: 600;
}

.report-content em,
.report-content i {
	font-style: italic;
}

.report-content ul,
.report-content ol {
	margin: 1.5em 0;
	padding-left: 2em;
}

.report-content ul {
	list-style-type: disc;
}

.report-content ol {
	list-style-type: decimal;
}

.report-content li {
	margin-bottom: 0.5em;
	line-height: 1.75;
}

.report-content li::marker {
	color: #ff7c00;
	font-weight: 600;
}

.report-content blockquote {
	font-style: italic;
	border-left: 4px solid #ff7c00;
	padding-left: 1.5em;
	margin: 2em 0;
	color: #666666;
	font-size: 1.1em;
}

.report-content code {
	color: #c7254e;
	background-color: #f9f2f4;
	padding: 0.2em 0.4em;
	border-radius: 3px;
	font-size: 0.9em;
	font-family: 'Courier New', Courier, monospace;
}

.report-content pre {
	background-color: #f5f5f5;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 1.5em;
	margin: 2em 0;
	overflow-x: auto;
}

.report-content pre code {
	background-color: transparent;
	color: #333333;
	padding: 0;
	font-size: 0.875em;
}

.report-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 2.5em auto;
	display: block;
}

.report-content figure {
	margin: 2.5em 0;
}

.report-content figcaption {
	text-align: center;
	font-size: 0.875em;
	color: #666666;
	margin-top: 0.75em;
	font-style: italic;
}

.report-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 2em 0;
	border: 1px solid #e5e5e5;
}

.report-content thead {
	background-color: #f5f5f5;
	border-bottom: 2px solid #e5e5e5;
}

.report-content th {
	padding: 12px 16px;
	text-align: left;
	font-weight: 600;
	color: #1a1a1a;
	border: 1px solid #e5e5e5;
}

.report-content td {
	padding: 12px 16px;
	border: 1px solid #e5e5e5;
	color: #333333;
}

.report-content tbody tr:nth-child(even) {
	background-color: #fafafa;
}

.report-content tbody tr:hover {
	background-color: #fff5e6;
}

.report-content hr {
	border: none;
	border-top: 2px solid #e5e5e5;
	margin: 3em 0;
}

/**
 * PDF Link Text Styling
 * Typography for PDF download link text
 */
.pdf-link-text {
	color: #FF7C00;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 140%;
	text-decoration-line: underline;
	text-decoration-style: solid;
	text-decoration-skip-ink: auto;
	text-decoration-thickness: auto;
	text-underline-offset: auto;
	text-underline-position: from-font;
}

/**
 * Archive Reports Styling
 * Dark theme archive page for reports
 */

/* Archive header dark background (only on report archive) */
.single-report header {
	background: #0D0D0D;
}

.post-type-archive-report #header-glass-bg {
	backdrop-filter: blur(3.6px);
	-webkit-backdrop-filter: blur(3.6px);
	background: transparent;
}

/* Line clamp utility for truncating report titles */
.line-clamp-2 {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* Card hover effect */
.report-card-link {
	transition: all 0.3s ease;
}

.report-card-link:hover {
	transform: translateY(-4px);
	box-shadow: 0px 384px 107px 0px rgba(0, 0, 0, 0),
		0px 246px 98px 0px rgba(0, 0, 0, 0.01),
		0px 138px 83px 0px rgba(0, 0, 0, 0.05),
		0px 61px 61px 0px rgba(255, 124, 0, 0.15),
		0px 15px 34px 0px rgba(255, 124, 0, 0.2);
}

.bgsun {
	background-repeat: no-repeat;
	background-size: contain;
	background-position: bottom;
}


/* ========================================
   CONTACT FORM 7 - BASE STYLES
   ======================================== */

/* Form Container */
.wpcf7 {
	font-family: 'Montserrat', sans-serif;
}

.wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

/* ========================================
   INPUT, SELECT & TEXTAREA STYLES
   ======================================== */

/* Text Inputs */
.cf7-input,
.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-tel {
	width: 100%;
	height: 48px;
	padding: 12px 16px;
	background-color: transparent;
	border: none;
	border-bottom: 1.5px solid #646667;
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	outline: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cf7-input:focus,
.wpcf7-form-control.wpcf7-text:focus,
.wpcf7-form-control.wpcf7-email:focus,
.wpcf7-form-control.wpcf7-tel:focus {
	border-color: #FF7C00;
	box-shadow: 0 2px 0 0 rgba(255, 124, 0, 0.3);
}

.cf7-input::placeholder,
.wpcf7-form-control::placeholder {
	color: #646667;
	opacity: 1;
}

/* Select Dropdown */
.cf7-select,
.wpcf7-form-control.wpcf7-select {
	width: 100%;
	height: 48px;
	padding: 12px 48px 12px 16px;
	background-color: transparent;
	border: none;
	border-bottom: 1.5px solid #646667;
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	outline: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	/* Custom arrow icon */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23FF7C00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 24px;
	transition: border-color 0.3s ease;
}

.cf7-select:focus,
.wpcf7-form-control.wpcf7-select:focus {
	border-color: #FF7C00;
}

/* Select option styling (limited browser support) */
.cf7-select option,
.wpcf7-form-control.wpcf7-select option {
	background-color: #1e1e1e;
	color: #ffffff;
	padding: 12px;
}

/* Textarea */
.cf7-textarea,
.wpcf7-form-control.wpcf7-textarea {
	width: 100%;
	min-height: 120px;
	padding: 16px;
	background-color: transparent;
	border: none;
	border-bottom: 1.5px solid #646667;
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	outline: none;
	resize: vertical;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cf7-textarea:focus,
.wpcf7-form-control.wpcf7-textarea:focus {
	border-color: #FF7C00;
	box-shadow: 0 2px 0 0 rgba(255, 124, 0, 0.3);
}

.cf7-textarea::placeholder,
.wpcf7-form-control.wpcf7-textarea::placeholder {
	color: #646667;
	opacity: 1;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.cf7-submit,
.wpcf7-form-control.wpcf7-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 48px;
	padding: 16px 32px;
	background: linear-gradient(90deg, #FF7C00 41.49%, #FF5900 100%);
	border: 1.5px solid #FFC28A;
	border-radius: 4px;
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: all 0.3s ease;
}

.cf7-submit:hover,
.wpcf7-form-control.wpcf7-submit:hover {
	background: linear-gradient(90deg, #FF5900 0%, #FF7C00 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(255, 124, 0, 0.4);
}

.cf7-submit:active,
.wpcf7-form-control.wpcf7-submit:active {
	transform: translateY(0);
}

.cf7-submit:disabled,
.wpcf7-form-control.wpcf7-submit:disabled {
	background: rgba(255, 255, 255, 0.3);
	border-color: #ffffff;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* ========================================
   VALIDATION & ERROR STATES
   ======================================== */

/* Invalid fields */
.wpcf7-not-valid {
	border-color: #ef4444 !important;
}

/* Validation error message */
.wpcf7-not-valid-tip {
	color: #ef4444;
	font-size: 13px;
	font-weight: 400;
	margin-top: 6px;
	display: block;
}

/* Response output (success/error messages) */
.wpcf7-response-output {
	padding: 16px 20px;
	margin: 0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
}

/* Success message */
.wpcf7-mail-sent-ok,
.wpcf7 form.sent .wpcf7-response-output {
	background-color: rgba(34, 197, 94, 0.1);
	border: 1px solid #22c55e;
	color: #22c55e;
}

/* Error message */
.wpcf7-mail-sent-ng,
.wpcf7-validation-errors,
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output {
	background-color: rgba(239, 68, 68, 0.1);
	border: 1px solid #ef4444;
	color: #ef4444;
}

/* Spam message */
.wpcf7-spam-blocked,
.wpcf7 form.spam .wpcf7-response-output {
	background-color: rgba(245, 158, 11, 0.1);
	border: 1px solid #f59e0b;
	color: #f59e0b;
}

/* ========================================
   LOADING/SPINNER STATE
   ======================================== */

.wpcf7-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #FF7C00;
	animation: cf7-spin 0.8s linear infinite;
	margin-left: 8px;
	vertical-align: middle;
}

@keyframes cf7-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Hide default spinner background */
.wpcf7 .ajax-loader {
	display: none;
}

/* ========================================
   FORM LAYOUT HELPERS
   ======================================== */

/* Remove default CF7 paragraph margins */
.wpcf7-form p {
	margin: 0;
}

/* Label styling */
.wpcf7-form label {
	display: block;
	color: #ffffff;
	font-size: 14px;
	font-weight: 400;
	margin-bottom: 8px;
}

/* Two column layout on larger screens */
@media (min-width: 640px) {
	.wpcf7-form .flex-row-sm {
		display: flex;
		gap: 32px;
	}

	.wpcf7-form .flex-row-sm > * {
		flex: 1;
	}
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus visible for keyboard navigation */
.cf7-input:focus-visible,
.cf7-select:focus-visible,
.cf7-textarea:focus-visible,
.cf7-submit:focus-visible {
	outline: 2px solid #FF7C00;
	outline-offset: 2px;
}

/* Required field indicator */
.wpcf7-form .wpcf7-validates-as-required::after {
	content: none; /* Remove default asterisk if needed */
}

/* ========================================
   REMOVE DEFAULT CF7 STYLING CONFLICTS
   ======================================== */

/* Reset any conflicting CF7 default styles */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	box-sizing: border-box;
	max-width: 100%;
}