.gradient-text {
    background: linear-gradient(135deg, #0A2463 0%, #00FFFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* RTL/Arabic font and spacing */
[dir="rtl"] :not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not(.fass):not([class*="fa-"]),
html[lang="ar"] :not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not(.fass):not([class*="fa-"]) {
    letter-spacing: normal;
    word-spacing: normal;
}

/* Improve readability of Arabic words in navbar */
[dir="rtl"] nav a {
    word-spacing: 0.12em;
}

/* Improve readability of Arabic words in footer links */
[dir="rtl"] footer a {
    letter-spacing: normal;
    word-spacing: 0.16em;
    white-space: normal;
}

/* RTL support for negative avatar spacing */
[dir="rtl"] .-space-x-2 > * + * {
    margin-left: 0;
    margin-right: -0.5rem; /* mirrors Tailwind -space-x-2 */
}

/* Ensure good spacing/alignment for the trusted row */
[dir="rtl"] .trusted-row {
    align-items: center;
}

.gradient-bg {
    background: linear-gradient(-45deg, #0A2463, #00FFFF, #25D366, #0A2463);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

.navy-bg {
    background-color: #0A2463;
}

.ai-cyan-bg {
    background-color: #00FFFF;
}

.whatsapp-bg {
    background-color: #25D366;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ai-glow {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.ai-glow:hover {
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

.pricing-popular {
    position: relative;
    border: 2px solid #00FFFF;
    transform: scale(1.05);
}

.pricing-popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0A2463, #00FFFF);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.scroll-smooth {
    scroll-behavior: smooth;
}

.hero-pattern {
    background-image: radial-gradient(circle at 25px 25px, rgba(102, 126, 234, 0.1) 2px, transparent 0),
                      radial-gradient(circle at 75px 75px, rgba(118, 75, 162, 0.1) 2px, transparent 0);
    background-size: 100px 100px;
}

/* Media & layout guards */
img, video, canvas, svg { max-width: 100%; height: auto; display: block }
html, body { min-height: 100% }
/* Use cautiously; helps prevent horizontal scroll during development */
html, body { overflow-x: hidden }

/* RTL: fix clipped Arabic diacritics on big headings */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] .leading-tight {
    line-height: 1.35; /* give extra breathing room for Arabic glyphs */
}

/* Slight padding to avoid baseline clipping on very large gradient text */
[dir="rtl"] .gradient-text {
    padding-bottom: 0.05em;
}

/* Slightly tighter line-height for specific Arabic headings */
[dir="rtl"] .ar-tight {
    line-height: 1.22; /* slightly tighter for Arabic headlines */
    padding-bottom: 0.03em;
}

/* Align hero grid to top in RTL to avoid visual misalignment */
[dir="rtl"] .hero-grid {
    align-items: flex-start !important;
}

/* Optional: tighter spacing only for this hero title in RTL */
[dir="rtl"] .hero-title {
    margin-top: 0.25rem; /* nudge down slightly for optical balance */
}

/* No scroll when mobile menu is open */
.no-scroll { overflow: hidden }

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

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

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

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

[dir="rtl"] .space-x-8 > * + * {
    /* keep spacing consistent with other space-x-* in RTL */
    margin-left: 0;
    margin-right: 2rem;
}

/* RTL Icon positioning: do not globally shift icons; handled per-utility (e.g., .mr-2) */

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

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

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

/* RTL Form icons */
[dir="rtl"] .absolute.right-4 {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .absolute.right-6 {
    right: auto;
    left: 1.5rem;
}

/* RTL Text alignment */
[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* RTL Flex direction adjustments */
[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

/* RTL Grid adjustments */
[dir="rtl"] .justify-start {
    justify-content: flex-end;
}

[dir="rtl"] .justify-end {
    justify-content: flex-start;
}

/* RTL Chat bubbles */
[dir="rtl"] .rounded-tl-sm {
    border-top-left-radius: 0.125rem;
    border-top-right-radius: 1rem;
}

[dir="rtl"] .rounded-tr-sm {
    border-top-right-radius: 0.125rem;
    border-top-left-radius: 1rem;
}

/* RTL Padding adjustments for forms */
[dir="rtl"] input,
[dir="rtl"] textarea {
    padding-right: 3rem;
    padding-left: 1.5rem;
}

/* RTL Popular badge positioning */
[dir="rtl"] .pricing-popular::before {
    content: 'الأكثر شعبية';
}

/* RTL Navbar adjustments */
[dir="rtl"] .justify-between {
    direction: rtl;
}

/* RTL WhatsApp icon centering */
[dir="rtl"] .fab.fa-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer social icon centering */
footer a.rounded-full {
    display: flex;
    align-items: center;
    justify-content: center;
}
footer .fab,
footer .fas {
    margin: 0 !important;
    line-height: 1;
}

/* RTL Navigation spacing fix */
/* إبقاء الاتجاه الأصلي مع الحفاظ على المسافات */
[dir="rtl"] nav .flex.items-center.space-x-3 {
    flex-direction: row-reverse;
}

/* منع تغيير اتجاه عنصر التوزيع العام */

/* إبقاء ترتيب عناصر القائمة كما في النسخة الإنجليزية */
[dir="rtl"] nav .hidden.md\:flex.items-center.space-x-8 {
    flex-direction: row;
}
[dir="rtl"] .justify-between {
    direction: rtl;
}

/* ضبط أيقونة واتساب لتكون في المنتصف دون هوامش إضافية */
[dir="rtl"] .fab.fa-whatsapp {
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fade in/out animation */
@keyframes fade-in-out {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.animate-fade-in-out {
    animation: fade-in-out 2s infinite;
}

/* Authentication Pages Styles - Merged from auth.css */

/* Floating Labels */
.floating-label {
    position: relative;
}

.floating-label input {
    padding-top: 20px;
}

.floating-label label {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    color: #999;
    pointer-events: none;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 10px;
    font-size: 12px;
    color: #0A2463;
}

/* Password Strength Indicators */
.strength-weak { 
    background-color: #dc3545; 
}

.strength-medium { 
    background-color: #ffc107; 
}

.strength-strong { 
    background-color: #28a745; 
}

/* Page Layout */
.auth-container {
    min-height: calc(100vh - 80px); /* Adjust based on navbar height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    margin-top: 80px; /* Add top margin to avoid navbar overlap */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auth-container {
        min-height: calc(100vh - 60px);
        padding: 1rem;
    }
}

/* Ensure proper spacing from footer */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Form specific styles */
.auth-form {
    width: 100%;
    max-width: 40rem;
}

.auth-form-wide {
    width: 100%;
    max-width: 72rem;
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #0A2463 0%, #00FFFF 50%, #25D366 100%);
    color: white;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(10, 36, 99, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 36, 99, 0.4), 0 0 20px rgba(0, 255, 255, 0.3);
    background: linear-gradient(135deg, #0A2463 0%, #00FFFF 30%, #25D366 100%);
}

.btn-secondary {
    border: 2px solid #0A2463;
    color: #0A2463;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: transparent;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #0A2463;
    color: white;
    transform: translateY(-2px);
}
