:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #671840;
    --warm: #f4e4c1;
    --neutral: #f8f9fa;
    --text: #2c3e50;
}

/* Prevent horizontal scrolling and fix mobile responsive issues */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ensure no element can cause horizontal scroll */
* {
    box-sizing: border-box;
}

/* Additional mobile-specific overflow prevention */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Force all containers to respect viewport */
    .max-w-7xl, .max-w-6xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

.arabic-text {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    line-height: 1.6;
}

/* Better line spacing for Arabic text in hero section */
.arabic-text h1, .arabic-text .hero-title, .arabic-text .hero-subtitle {
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.arabic-text p, .arabic-text .hero-description {
    line-height: 1.7;
    letter-spacing: 0.01em;
}

.smooth-scroll {
    scroll-behavior: smooth;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
}

/* Mobile hero height adjustment */
@media (max-width: 768px) {
    .hero-bg {
        min-height: 70vh;
    }
    
    /* Reduce bottom padding on mobile for tighter spacing */
    .hero-bg .relative.z-10 {
        padding-bottom: 2rem !important;
    }
}

.section-bg {
    background: linear-gradient(180deg, #ffffff 0%, var(--neutral) 100%);
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.3);
}

.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.mobile-menu {
    transform: translateX(100%) !important;
    transition: transform 0.3s ease;
    background: white !important;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1) !important;
    z-index: 40;
    position: fixed !important;
    top: 4rem !important;
    right: 0 !important;
    width: 16rem !important;
    height: calc(100vh - 4rem) !important;
    overflow-y: auto;
}

.mobile-menu.open {
    transform: translateX(0) !important;
}

.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.testimonial-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 4px solid var(--highlight);
}

.process-step {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2rem;
}

.process-step::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--highlight);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.process-container {
    counter-reset: step-counter;
}

.whatsapp-btn {
    background: #25D366;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
    color: white;
}

.phone-number {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override !important;
    display: inline-block !important;
}

.arabic-phone {
    direction: ltr !important;
    unicode-bidi: bidi-override !important;
    text-align: left !important;
    font-family: 'Inter', sans-serif !important;
    display: inline-block !important;
}

/* Cool animations and micro-interactions */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(233, 69, 96, 0.3); }
    50% { box-shadow: 0 0 20px rgba(233, 69, 96, 0.6); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.floating-btn {
    animation: float 3s ease-in-out infinite;
}

.mood-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.mood-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.mood-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    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::before {
    left: 100%;
}

.whatsapp-btn {
    position: relative;
    overflow: hidden;
}

.whatsapp-btn::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;
}

.whatsapp-btn:hover::before {
    left: 100%;
}

/* Smooth reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for cards */
.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.2s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.4s; }

/* RTL specific styles */
[dir="rtl"] .process-step {
    padding-left: 0;
    padding-right: 3rem;
}

[dir="rtl"] .process-step::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .phone-number {
    direction: ltr !important;
    text-align: right !important;
    unicode-bidi: bidi-override !important;
    display: inline-block !important;
}

[dir="rtl"] .arabic-phone {
    direction: ltr !important;
    text-align: right !important;
    unicode-bidi: bidi-override !important;
    display: inline-block !important;
}

/* Additional phone number fixes */
.contact-section .phone-number,
.contact-section .arabic-phone,
#contact .phone-number,
#contact .arabic-phone {
    direction: ltr !important;
    unicode-bidi: bidi-override !important;
    display: inline-block !important;
    font-family: 'Inter', sans-serif !important;
}

/* Dotted background pattern */
.dotted-bg {
    position: relative;
    background-color: #f1e1d5;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.dotted-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.25) 1.5px, transparent 1.5px),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 10% 70%, rgba(255, 255, 255, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 30% 90%, rgba(255, 255, 255, 0.25) 1.5px, transparent 1.5px),
        radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 80px 80px, 120px 120px, 100px 100px, 90px 90px, 110px 110px, 130px 130px, 95px 95px, 85px 85px;
    background-position: 0 0, 20px 20px, 40px 40px, 60px 60px, 80px 80px, 100px 100px, 120px 120px, 140px 140px;
    opacity: 0.4;
    z-index: 1;
}

.dotted-bg > * {
    position: relative;
    z-index: 2;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .container, .max-w-7xl, .max-w-6xl, .max-w-4xl {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Fix any elements that might overflow */
    .grid {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix text overflow */
    .text-4xl, .text-3xl, .text-2xl {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix button containers */
    .flex {
        flex-wrap: wrap;
    }
    
    /* Fix navigation */
    .fixed {
        width: 100%;
        max-width: 100%;
    }
    
    /* Fix hero section */
    .hero-bg {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Prevent horizontal scroll on all sections */
    section {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Fix specific problematic elements */
    .text-center {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure all containers respect viewport width */
    .mx-auto {
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 100%;
    }
    
    /* Fix floating button positioning */
    .floating-btn {
        right: 10px;
        bottom: 10px;
    }
    
    /* Fix background patterns that might overflow */
    .dotted-bg::before {
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
    }
    
    /* Prevent any element from exceeding viewport */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix potential margin/padding issues */
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }
}
