/* Simple Mealoz Landing - Custom Styles */
/* Additional styles to complement Tailwind CSS */

/* RTL Support and Arabic Typography */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', Arial, sans-serif;
    line-height: 1.6;
}

/* Enhanced Custom animations with better easing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

/* Enhanced focus states for accessibility */
input:focus,
select:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Enhanced button hover effects with smooth transitions */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn-primary::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-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

/* Enhanced form field interactions */
.form-field {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.form-field:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.form-field:hover:not(:focus) {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* Hero section enhanced effects */
#hero {
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.9));
    z-index: -1;
}

#hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
    z-index: -1;
}

/* Enhanced section spacing and typography */
section {
    position: relative;
    transition: all 0.3s ease;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    transition: all 0.3s ease;
}

/* Smooth hover effects for headings */
h1:hover, h2:hover, h3:hover {
    transform: translateY(-1px);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 5px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    transform: scale(1.1);
}

/* Enhanced loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced message animations */
.message-slide-in {
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced feature card hover effects */
.feature-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card .feature-icon {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(8deg);
    animation: pulse 1s ease-in-out;
}

/* Enhanced problem/solution card effects */
.problem-solution-card {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    position: relative;
    overflow: hidden;
}

.problem-solution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.problem-solution-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.problem-solution-card:hover::before {
    opacity: 1;
}

/* Enhanced emoji animations */
.problem-solution-card p span {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.problem-solution-card:hover p span {
    transform: scale(1.2) rotate(5deg);
    animation: bounce 0.6s ease-in-out;
}

/* Mobile-specific optimizations with touch interactions */
@media (max-width: 768px) {
    /* Ensure touch targets are at least 44px */
    button, 
    input, 
    select,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Optimize text sizes for mobile */
    h1 {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    /* Better touch interaction feedback */
    .feature-card:active,
    .problem-solution-card:active,
    button:active,
    a:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Improve form spacing on mobile */
    .form-field {
        padding: 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Enhanced touch feedback */
    input:active, 
    select:active, 
    button:active {
        background-color: rgba(59, 130, 246, 0.05);
    }
    
    /* Reduce animation intensity on mobile for performance */
    .feature-card:hover {
        transform: translateY(-6px) scale(1.02);
    }
    
    .problem-solution-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

/* Tablet-specific optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .feature-card:hover {
        transform: translateY(-10px) scale(1.025);
    }
    
    .problem-solution-card:hover {
        transform: translateY(-6px) scale(1.015);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-primary-500 {
        background-color: #1d4ed8 !important;
    }
    
    .text-gray-600 {
        color: #374151 !important;
    }
    
    /* Enhanced borders for high contrast */
    .feature-card,
    .problem-solution-card {
        border: 2px solid #374151;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    /* Remove transform effects for reduced motion */
    .feature-card:hover,
    .problem-solution-card:hover,
    button:hover {
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    /* Remove animations and effects for print */
    * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Enhanced utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.backdrop-blur {
    backdrop-filter: blur(12px);
}

.backdrop-blur-sm {
    backdrop-filter: blur(6px);
}

/* Custom gradient backgrounds with animation */
.gradient-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

.gradient-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Enhanced link hover effects */
a {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

a:hover {
    transform: translateY(-1px);
}

/* Smooth scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* Enhanced Arabic text optimization */
.arabic-text {
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    font-variant-ligatures: common-ligatures;
}

/* Ensure proper RTL layout with enhanced transitions */
[dir="rtl"] .flex-row-reverse {
    flex-direction: row-reverse;
}

[dir="rtl"] .transform {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced focus indicators for keyboard navigation */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth transitions for all interactive elements */
button,
input,
select,
textarea,
a,
.interactive {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

/* Performance optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth state transitions */
.state-transition {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}