@tailwind base;
@tailwind components;
@tailwind utilities;

/* Enhanced Base Styles */
* {
	font-family: "Cairo", sans-serif;
	scroll-behavior: smooth;
}

/* Enhanced RTL Support */
[dir="rtl"] {
	text-align: right;
}
[dir="rtl"] #languageMenu {
	right: 0;
}

[dir="rtl"] .space-x-4 > * + * {
	margin-left: 0;
	margin-right: 1rem;
}

[dir="rtl"] .space-x-6 > * + * {
	margin-left: 0;
	margin-right: 1.5rem;
}

[dir="rtl"] .space-x-8 > * + * {
	margin-left: 0;
	margin-right: 2rem;
}

[dir="rtl"] .mr-2 {
	margin-right: 0 !important;
	margin-left: 0.5rem !important;
}

[dir="rtl"] .mr-3 {
	margin-right: 0 !important;
	margin-left: 0.75rem !important;
}

[dir="rtl"] .ml-2 {
	margin-left: 0 !important;
	margin-right: 0.5rem !important;
}

[dir="rtl"] .ml-4 {
	margin-left: 0 !important;
	margin-right: 1rem !important;
}
[dir="rtl"] .text-center {
	text-align: center;
}

/* Enhanced Navigation Styles */
nav {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
	position: relative;
	transition: all 0.3s ease;
}
.nav-link:first-child {
	margin-right: 0;
}

.nav-link::after {
	content: "";
	position: absolute;
	width: 0;
	height: 2px;
	bottom: -4px;
	left: 50%;
	background: linear-gradient(90deg, #e85900, #ff6b1a);
	transition: all 0.3s ease;
	transform: translateX(-50%);
	border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
	width: 100%;
}

.nav-link:hover {
	transform: translateY(-1px);
}

/* Enhanced Language Switcher */
.flag-icon {
	width: 20px;
	height: 15px;
	border-radius: 2px;
	display: inline-block;
	transition: transform 0.2s ease;
}

.flag-icon:hover {
	transform: scale(1.1);
}

/* Enhanced Floating Contact Button */
.floating-contact {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 1000;
	background: linear-gradient(135deg, #e85900, #ff6b1a);
	box-shadow: 0 8px 32px rgba(232, 89, 0, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	animation: pulse-float 3s ease-in-out infinite;
}

.floating-contact:hover {
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 12px 40px rgba(232, 89, 0, 0.4);
}

.floating-contact:active {
	transform: translateY(-1px) scale(0.98);
}

[dir="rtl"] .floating-contact {
	right: auto;
	left: 30px;
}

@keyframes pulse-float {
	0%,
	100% {
		box-shadow: 0 8px 32px rgba(232, 89, 0, 0.3);
		transform: translateY(0px);
	}
	50% {
		box-shadow: 0 12px 40px rgba(232, 89, 0, 0.5);
		transform: translateY(-2px);
	}
}

/* Enhanced Animations */
@keyframes float {
	0%,
	100% {
		transform: translateY(0px);
	}
	50% {
		transform: translateY(-10px);
	}
}

.float-animation {
	animation: float 3s ease-in-out infinite;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes fadeInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.fade-in-up {
	animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-left {
	animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
	animation: fadeInRight 0.6s ease-out forwards;
}

/* Enhanced Gradient Backgrounds */
.hero-gradient {
	background: linear-gradient(135deg, #003366 0%, #004080 50%, #003366 100%);
	position: relative;
}

.hero-gradient::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: radial-gradient(circle at 30% 20%, rgba(232, 89, 0, 0.1) 0%, transparent 50%),
		radial-gradient(circle at 70% 80%, rgba(255, 107, 26, 0.1) 0%, transparent 50%);
	pointer-events: none;
}

/* Enhanced Service Cards */
.service-card {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.service-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(232, 89, 0, 0.1), transparent);
	transition: left 0.5s ease;
}

.service-card:hover::before {
	left: 100%;
}

.service-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 20px 40px rgba(0, 51, 102, 0.15);
}

.service-icon {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon {
	transform: scale(1.2) rotate(5deg);
}

/* Enhanced News Cards */
.news-card {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
	position: relative;
}

.news-card::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, transparent 30%, rgba(232, 89, 0, 0.05) 50%, transparent 70%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.news-card:hover::after {
	opacity: 1;
}

.news-card:hover {
	transform: translateY(-10px);
	box-shadow: 0 25px 50px rgba(0, 51, 102, 0.2);
}

.news-card:hover .news-image {
	transform: scale(1.08);
}

.news-image {
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Contact Form */
.form-input {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}

.form-input:focus {
	border-color: #e85900;
	box-shadow: 0 0 0 3px rgba(232, 89, 0, 0.1);
	transform: translateY(-1px);
}

.form-input:hover {
	border-color: #ff6b1a;
}

/* Enhanced Buttons */
button {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

button::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	transition: width 0.3s ease, height 0.3s ease;
}

button:hover::before {
	width: 300px;
	height: 300px;
}

/* Enhanced Image Loading */
img {
	transition: opacity 0.3s ease;
}

img[loading="lazy"] {
	opacity: 0;
}

img[loading="lazy"].loaded {
	opacity: 1;
}

/* Enhanced Accessibility */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.focus\:not-sr-only:focus {
	position: static;
	width: auto;
	height: auto;
	padding: inherit;
	margin: inherit;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #e85900, #ff6b1a);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #ff6b1a, #e85900);
}

/* Enhanced Product Card */
.product-card {
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.product-card::before {
	content: "";
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: conic-gradient(from 0deg, transparent, rgba(232, 89, 0, 0.1), transparent);
	animation: rotate 10s linear infinite;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.product-card:hover::before {
	opacity: 1;
}

@keyframes rotate {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Enhanced Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.2;
	font-weight: 700;
}

p {
	line-height: 1.6;
}

/* Enhanced Responsive Design */
@media (max-width: 480px) {
	#servicesCarousel {
		height: 330px !important;
	}
	.carousel-title {
		/* font-size: 1.5rem !important; */
	}
	.carosuel-desc {
		/* font-size: 12px !important; */
	}
	.container-hero-image {
		/* padding: 12px !important; */
	}
}
@media (max-width: 768px) {
	.floating-contact {
		bottom: 20px;
		right: 20px;
		width: 56px;
		height: 56px;
	}

	[dir="rtl"] .floating-contact {
		right: auto;
		left: 20px;
	}

	.hero-gradient {
		padding-top: 60px;
		padding-bottom: 60px;
	}

	.service-card,
	.news-card {
		margin-bottom: 1rem;
	}
}

/* Enhanced Dark Mode Support (for future implementation) */
@media (prefers-color-scheme: dark) {
	:root {
		--bg-primary: #1a1a1a;
		--text-primary: #ffffff;
		--text-secondary: #cccccc;
	}
}

/* Enhanced Print Styles */
@media print {
	.floating-contact,
	nav,
	#backToTop {
		display: none !important;
	}

	* {
		background: white !important;
		color: black !important;
	}
}

/* Enhanced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Enhanced High Contrast Mode */
@media (prefers-contrast: high) {
	.nav-link::after {
		background: currentColor;
	}

	button {
		border: 2px solid currentColor;
	}
}

/* Enhanced Arabic Typography */
[dir="rtl"] h1,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
	font-family: "Cairo", sans-serif;
	font-weight: 700;
	text-align: right;
}
[dir="rtl"] h2 {
	text-align: center;
}

[dir="rtl"] .text-center {
	text-align: center !important;
}
[dir="rtl"] .finder-contact:hover .arrow-reflect,
[dir="rtl"] .news-card:hover .arrow-reflect {
	transform: translateX(-0.25rem);
	-webkit-transform: translateX(-0.25rem);
	-moz-transform: translateX(-0.25rem);
	-ms-transform: translateX(-0.25rem);
	-o-transform: translateX(-0.25rem);
}
#backToTop {
	left: 20px;
	bottom: 30px;
	right: auto;
}
[dir="rtl"] #backToTop {
	right: 20px;
	bottom: 30px;
}
.finder-contact:hover .arrow-reflect,
.news-card:hover .arrow-reflect {
	transform: translateX(0.25rem);
	-webkit-transform: translateX(0.25rem);
	-moz-transform: translateX(0.25rem);
	-ms-transform: translateX(0.25rem);
	-o-transform: translateX(0.25rem);
}
.shadow-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 30rem;
	background: linear-gradient(to top, rgb(0, 0, 0), transparent);
	pointer-events: none;
}
/* Enhanced Performance Optimizations */
.will-change-transform {
	will-change: transform;
}

.will-change-opacity {
	will-change: opacity;
}

/* Enhanced Loading States */
.loading {
	pointer-events: none;
	opacity: 0.6;
}

.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #e85900;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}
