/* Import Arabic and English fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Font families */
.font-arabic {
    font-family: 'Cairo', 'Inter', sans-serif;
}

.font-english {
    font-family: 'Inter', 'Cairo', sans-serif;
}

/* RTL/LTR specific styles */
[dir="rtl"] {
    font-family: 'Cairo', 'Inter', sans-serif;
}

[dir="ltr"] {
    font-family: 'Inter', 'Cairo', sans-serif;
}

/* RTL specific adjustments */
[dir="rtl"] .hero-content {
    transform: translateX(-10px);
}

[dir="ltr"] .hero-content {
    transform: translateX(10px);
}

[dir="rtl"] .hero-phones {
    transform: translateX(10px);
}

[dir="ltr"] .hero-phones {
    transform: translateX(-10px);
}

/* Text alignment for RTL */
[dir="rtl"] .stat-card,
[dir="rtl"] .feature-card,
[dir="rtl"] .service-card,
[dir="rtl"] .customer-stat,
[dir="rtl"] .provider-stat {
    text-align: right;
}

[dir="ltr"] .stat-card,
[dir="ltr"] .feature-card,
[dir="ltr"] .service-card,
[dir="ltr"] .customer-stat,
[dir="ltr"] .provider-stat {
    text-align: left;
}

/* RTL arrow adjustments */
[dir="rtl"] .fas.fa-arrow-right:before {
    content: "\f060"; /* left arrow */
}

[dir="rtl"] .fas.fa-arrow-left:before {
    content: "\f061"; /* right arrow */
}

/* Animation delays */
.hero-delay-300 {
    animation-delay: 0.3s;
}

.hero-delay-500 {
    animation-delay: 0.5s;
}

.hero-delay-700 {
    animation-delay: 0.7s;
}

.hero-delay-1000 {
    animation-delay: 1s;
}

.star-delay-100 {
    animation-delay: 0.1s;
}

.star-delay-200 {
    animation-delay: 0.2s;
}

.star-delay-300 {
    animation-delay: 0.3s;
}

.star-delay-400 {
    animation-delay: 0.4s;
}

.ping-delay-500 {
    animation-delay: 0.5s;
}

.pulse-delay-500 {
    animation-delay: 0.5s;
}

.pulse-delay-1000 {
    animation-delay: 1s;
}

.service-delay-1000 {
    animation-delay: 1s;
}

.customer-delay-1000 {
    animation-delay: 1s;
}

.customer-cta-delay-1000 {
    animation-delay: 1s;
}

.provider-delay-1000 {
    animation-delay: 1s;
}

.provider-cta-delay-1000 {
    animation-delay: 1s;
}

/* Custom animations */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.star-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Intersection Observer fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effects */
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #10b981, #0891b2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #059669, #0e7490);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .hero-content {
        text-align: center;
    }
    
    .hero-phones {
        margin-top: 2rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Loading animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Navbar transition */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.navbar-scrolled .nav-link {
    color: #374151;
}

.navbar-scrolled .mobile-menu-btn {
    color: #374151;
}

.navbar-scrolled .lang-btn {
    color: #10b981;
}

/* Form validation styles */
.form-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-success {
    border-color: #10b981;
    background-color: #f0fdfa;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* RTL specific form adjustments */
[dir="rtl"] input,
[dir="rtl"] textarea {
    text-align: right;
}

[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
    text-align: right;
}

[dir="ltr"] input,
[dir="ltr"] textarea {
    text-align: left;
}

[dir="ltr"] input::placeholder,
[dir="ltr"] textarea::placeholder {
    text-align: left;
}

/* Language-specific number formatting */
[dir="rtl"] .stat-card .text-3xl,
[dir="rtl"] .stat-card .text-2xl {
    font-family: 'Inter', 'Cairo', sans-serif; /* Use English font for numbers */
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .bg-gradient-to-r,
    .bg-gradient-to-b,
    .bg-gradient-to-br {
        background: white !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gradient-to-r,
    .bg-gradient-to-b,
    .bg-gradient-to-br {
        background: #000 !important;
        color: #fff !important;
    }
    
    .text-gray-600 {
        color: #000 !important;
    }
    
    .text-white {
        color: #fff !important;
    }
}

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

/* RTL specific spacing adjustments */
[dir="rtl"] .space-x-2 > * + * {
    margin-left: 0;
    margin-right: 0.5rem;
}

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

[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;
}

/* Additional RTL adjustments for specific elements */
[dir="rtl"] .transform.rotate-3 {
    transform: rotate(-3deg);
}

[dir="rtl"] .transform.-rotate-12 {
    transform: rotate(12deg);
}

[dir="rtl"] .hover\:rotate-0:hover {
    transform: rotate(0deg);
}

[dir="rtl"] .hover\:-rotate-6:hover {
    transform: rotate(6deg);
}

/* RTL phone mockup adjustments */
[dir="rtl"] .hero-phones .absolute.-top-10.-left-20 {
    left: auto;
    right: -5rem;
}

[dir="ltr"] .hero-phones .absolute.-top-10.-left-20 {
    left: -5rem;
    right: auto;
}

/* Language toggle button styling */
.language-toggle {
    transition: all 0.3s ease;
}

.language-toggle:hover {
    transform: scale(1.05);
}

/* Improved button hover effects for RTL */
[dir="rtl"] .group-hover\:translate-x-1 {
    transform: translateX(-0.25rem);
}

[dir="ltr"] .group-hover\:translate-x-1 {
    transform: translateX(0.25rem);
}

/* Enhanced focus states for better accessibility */
.focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Improved contrast for better readability */
.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

/* Better spacing for Arabic text */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    line-height: 1.4;
}

[dir="rtl"] p {
    line-height: 1.7;
}

/* Improved button styles for Arabic */
[dir="rtl"] button {
    font-weight: 600;
}

/* Better form styling for RTL */
[dir="rtl"] label {
    text-align: right;
    display: block;
}

/* Enhanced mobile responsiveness for RTL */
@media (max-width: 640px) {
    [dir="rtl"] .text-5xl {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    [dir="rtl"] .text-4xl {
        font-size: 2rem;
        line-height: 1.3;
    }
}

/* Improved animation performance */
.animate-pulse,
.animate-bounce,
.animate-spin {
    will-change: transform;
}

/* Better gradient animations */
.animate-gradient {
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
}

/* Enhanced shadow effects */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Improved backdrop blur */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

/* Better border radius for modern look */
.rounded-3xl {
    border-radius: 1.5rem;
}

/* Enhanced transition effects */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Improved hover states */
.hover\:scale-105:hover {
    transform: scale(1.05);
}

.hover\:scale-110:hover {
    transform: scale(1.1);
}

/* Better focus management */
.focus\:ring-2:focus {
    ring-width: 2px;
}

.focus\:ring-purple-500:focus {
    ring-color: #8b5cf6;
}

/* Enhanced accessibility */
@media (prefers-reduced-motion: reduce) {
    .animate-pulse,
    .animate-bounce,
    .animate-spin,
    .animate-gradient {
        animation: none;
    }
}

/* Better color contrast */
.text-emerald-600 {
    color: #059669;
}

.text-purple-600 {
    color: #7c3aed;
}

.text-orange-600 {
    color: #ea580c;
}

/* Improved gradient backgrounds */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.bg-gradient-to-b {
    background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
}

.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

/* Enhanced mobile menu */
@media (max-width: 768px) {
    .mobile-menu {
        backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.95);
    }
}

/* Better loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Improved notification styles */
.notification {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Better card hover effects */
.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Enhanced button animations */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-animate:hover::before {
    left: 100%;
}

/* Improved text selection */
::selection {
    background-color: #10b981;
    color: white;
}

::-moz-selection {
    background-color: #10b981;
    color: white;
}

/* Better scrollbar for RTL */
[dir="rtl"]::-webkit-scrollbar {
    width: 8px;
}

[dir="rtl"]::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[dir="rtl"]::-webkit-scrollbar-thumb {
    background: linear-gradient(to top, #10b981, #0891b2);
    border-radius: 4px;
}

/* Enhanced form focus states */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Better placeholder styling for RTL */
[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Improved table styles for RTL */
[dir="rtl"] table {
    direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

/* Enhanced tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Better modal styles */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-content.show {
    transform: scale(1);
}

/* Enhanced dropdown styles */
.dropdown {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Better progress bar styles */
.progress-bar {
    background: linear-gradient(90deg, #10b981, #0891b2);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Improved badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Enhanced alert styles */
.alert {
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Better code block styles */
code {
    background: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* Enhanced list styles */
ul.styled-list {
    list-style: none;
    padding-left: 0;
}

ul.styled-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

ul.styled-list li::before {
    content: '•';
    color: #10b981;
    font-weight: bold;
    position: absolute;
    left: 0;
}

[dir="rtl"] ul.styled-list li {
    padding-left: 0;
    padding-right: 1.5rem;
}

[dir="rtl"] ul.styled-list li::before {
    left: auto;
    right: 0;
}

/* Better blockquote styles */
blockquote {
    border-left: 4px solid #10b981;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6b7280;
}

[dir="rtl"] blockquote {
    border-left: none;
    border-right: 4px solid #10b981;
    padding-left: 0;
    padding-right: 1rem;
}

/* Enhanced divider styles */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 2rem 0;
}

/* Better image styles */
img {
    max-width: 100%;
    height: auto;
}

.image-rounded {
    border-radius: 0.75rem;
}

.image-shadow {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Enhanced video styles */
video {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

/* Better iframe styles */
iframe {
    border-radius: 0.75rem;
    border: none;
}

/* Improved print styles */
@media print {
    * {
        color: black !important;
        background: white !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p, li {
        page-break-inside: avoid;
    }
}