/**
 * NEXUS Property OS - i18n & Language Switcher Styles
 * Arabic Luxury Design System with RTL Support
 */

/* ============================================
   LANGUAGE SWITCHER COMPONENT
   ============================================ */

.language-switcher {
    position: relative;
    z-index: 1001;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(26, 41, 66, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    color: var(--pearl, #FAFAF9);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.language-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-primary, #D4AF37);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
}

.language-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.language-flag {
    font-size: 1.2rem;
    line-height: 1;
}

.language-name {
    font-weight: 600;
}

.language-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: var(--gold-primary, #D4AF37);
}

.language-btn[aria-expanded="true"] .language-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.language-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 220px;
    background: rgba(26, 41, 66, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(212, 175, 55, 0.1);
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #cbd5e1;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

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

.language-option:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #fff;
}

.language-option.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(0, 212, 170, 0.1));
    color: var(--gold-primary, #D4AF37);
}

.language-native {
    font-weight: 600;
    flex: 1;
}

.language-english {
    font-size: 0.8rem;
    color: #64748b;
}

.language-check {
    color: var(--teal-accent, #00D4AA);
    font-size: 0.85rem;
}

/* ============================================
   RTL (RIGHT-TO-LEFT) SUPPORT
   ============================================ */

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

[dir="rtl"] body {
    font-family: 'Cairo', 'Amiri', sans-serif;
}

/* Navigation RTL */
[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo {
    flex-direction: row-reverse;
}

/* Hero Section RTL */
[dir="rtl"] .hero-badge {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-cta {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-primary-hero,
[dir="rtl"] .btn-secondary-hero {
    flex-direction: row-reverse;
}

/* Stats RTL */
[dir="rtl"] .hero-stats {
    flex-direction: row-reverse;
}

/* Features RTL */
[dir="rtl"] .feature-card {
    text-align: right;
}

[dir="rtl"] .feature-icon {
    margin-left: auto;
    margin-right: 0;
}

/* Testimonials RTL */
[dir="rtl"] .testimonial-author {
    flex-direction: row-reverse;
}

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

/* Pricing RTL */
[dir="rtl"] .pricing-card li {
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .pricing-card li:before {
    left: auto;
    right: 0;
}

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

/* Footer RTL */
[dir="rtl"] .footer-content {
    direction: rtl;
}

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

/* CTA Buttons RTL */
[dir="rtl"] .cta-buttons {
    flex-direction: row-reverse;
}

/* Trust Section RTL */
[dir="rtl"] .trust-logos {
    flex-direction: row-reverse;
}

[dir="rtl"] .trust-logo {
    flex-direction: row-reverse;
}

/* Form Elements RTL */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
}

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

/* Icons in RTL - Flip directional icons */
[dir="rtl"] .fa-chevron-right::before {
    content: "\f053"; /* chevron-left */
}

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

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

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

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

[dir="rtl"]::-webkit-scrollbar-track {
    background: var(--navy-dark, #0A1628);
}

[dir="rtl"]::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-primary, #D4AF37), var(--gold-dark, #B8941F));
    border-radius: 4px;
}

/* ============================================
   LOCALE TRANSITION ANIMATION
   ============================================ */

.locale-transitioning {
    animation: localeTransition 0.5s ease;
}

@keyframes localeTransition {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
        transform: scale(0.99);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   ARABIC TYPOGRAPHY ENHANCEMENTS
   ============================================ */

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Amiri', 'Playfair Display', serif;
    letter-spacing: 0;
}

[dir="rtl"] .section-badge,
[dir="rtl"] .hero-badge {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

[dir="rtl"] .stat-number {
    font-family: 'Cairo', 'Playfair Display', serif;
}

/* Arabic Calligraphy Decorations */
[dir="rtl"] .section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary, #D4AF37), transparent);
    margin: 1rem auto 0;
}

/* ============================================
   CHINESE TYPOGRAPHY ENHANCEMENTS
   ============================================ */

[data-locale="zh"] {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

[data-locale="zh"] h1, [data-locale="zh"] h2, [data-locale="zh"] h3 {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    font-weight: 700;
}

/* ============================================
   MOBILE RESPONSIVE RTL
   ============================================ */

@media (max-width: 992px) {
    .language-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }

    .language-dropdown.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }

    [dir="rtl"] .language-dropdown {
        right: 50%;
        left: auto;
        transform: translateX(50%) translateY(-10px) scale(0.95);
    }

    [dir="rtl"] .language-dropdown.show {
        transform: translateX(50%) translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .language-btn {
        padding: 0.5rem 0.75rem;
    }

    .language-name {
        display: none;
    }

    .language-flag {
        font-size: 1.4rem;
    }

    [dir="rtl"] .hero h1 {
        font-size: 1.75rem;
        line-height: 1.4;
    }

    [dir="rtl"] .hero-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

.language-btn:focus-visible {
    outline: 2px solid var(--gold-primary, #D4AF37);
    outline-offset: 2px;
}

.language-option:focus-visible {
    outline: 2px solid var(--gold-primary, #D4AF37);
    outline-offset: -2px;
}

/* Screen reader only class */
.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;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .locale-transitioning {
        animation: none;
    }

    .language-dropdown {
        transition: opacity 0.2s ease;
        transform: none !important;
    }

    .language-dropdown.show {
        transform: none !important;
    }
}
