/* RTL (Right-to-Left) Styles for Arabic */
/* Базовые RTL настройки */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] * {
    direction: rtl;
}

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

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

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

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

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

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

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

/* Features Section RTL */
[dir="rtl"] .features__grid {
    direction: rtl;
}

[dir="rtl"] .feature-card {
    text-align: center;
}

/* Why Choose Section RTL */
[dir="rtl"] .why-choose__text {
    margin-right: 0;
    margin-left: 0;
    text-align: right;
}

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

/* Process Section RTL */
[dir="rtl"] .process__steps-grid {
    direction: rtl;
}

[dir="rtl"] .process__step {
    text-align: center;
}

/* Contact Form RTL */
[dir="rtl"] .contact__layout {
    direction: rtl;
}

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

[dir="rtl"] .form-field input,
[dir="rtl"] .form-field textarea {
    text-align: right;
    direction: rtl;
}

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

[dir="rtl"] .form-checkbox {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .contact-form__submit {
    align-self: flex-end;
}

/* RTL Styles for intl-tel-input plugin */
[dir="rtl"] .iti {
    direction: ltr;
}

[dir="rtl"] .iti__flag-container {
    left: auto;
    right: 0;
}

[dir="rtl"] .iti__selected-flag {
    padding: 0 6px 0 8px;
}

[dir="rtl"] .iti__arrow {
    margin-right: 0;
    margin-left: 6px;
}

[dir="rtl"] .iti input[type="tel"],
[dir="rtl"] input[type="tel"].form-input {
    text-align: left !important;
    direction: ltr !important;
    padding-left: 16px !important;
    padding-right: 52px !important;
}

[dir="rtl"] input[type="email"] {
    direction: ltr;
    text-align: left;
}

/* Footer RTL */
[dir="rtl"] .footer__content {
    text-align: right;
}

/* Mobile Menu RTL */
[dir="rtl"] .mobile-menu-popup {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid rgba(149, 122, 97, 0.3);
    transform: translateX(-100%);
}

[dir="rtl"] .mobile-menu-overlay.active .mobile-menu-popup {
    transform: translateX(0);
}

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

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

[dir="rtl"] .mobile-menu-link:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .mobile-menu-auth {
    direction: rtl;
}

/* About Page RTL */
[dir="rtl"] .about-hero__box {
    direction: rtl;
}

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

/* Trading Page RTL */
[dir="rtl"] .trading-benefits__layout {
    flex-direction: row-reverse;
}

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

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

/* Platform Page RTL */
[dir="rtl"] .platform-hero__layout {
    flex-direction: row-reverse;
}

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

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

/* Accounts Page RTL */
[dir="rtl"] .accounts-cards__grid {
    direction: rtl;
}

[dir="rtl"] .account-card {
    text-align: center;
}

/* Calendar Page RTL */
[dir="rtl"] .calendar-highlights__grid {
    direction: rtl;
}

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

/* Language Switcher */
.language-switcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
    margin-right: 20px;
}

[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 20px;
    flex-direction: row-reverse;
}

.language-switcher__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.15), rgba(149, 122, 97, 0.08));
    border: 1.5px solid rgba(149, 122, 97, 0.4);
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.language-switcher__button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(149, 122, 97, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.language-switcher__button:hover::before {
    width: 100%;
    height: 100%;
}

.language-switcher__button:hover {
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.25), rgba(149, 122, 97, 0.15));
    border-color: #957A61;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(149, 122, 97, 0.3);
}

.language-switcher.active .language-switcher__button {
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.3), rgba(149, 122, 97, 0.2));
    border-color: #957A61;
    box-shadow: 0 4px 16px rgba(149, 122, 97, 0.4);
}

.language-switcher__icon {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.language-switcher__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.98), rgba(15, 15, 15, 0.98));
    border: 1.5px solid rgba(149, 122, 97, 0.4);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(149, 122, 97, 0.1);
    backdrop-filter: blur(10px);
}

[dir="rtl"] .language-switcher__dropdown {
    right: auto;
    left: 0;
}

.language-switcher.active .language-switcher__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.language-switcher__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border-bottom: 1px solid rgba(149, 122, 97, 0.15);
    position: relative;
    overflow: hidden;
}

.language-switcher__option:last-child {
    border-bottom: none;
}

.language-switcher__option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #957A61, rgba(149, 122, 97, 0.5));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.language-switcher__option:hover::before {
    transform: translateX(0);
}

.language-switcher__option:hover {
    background: linear-gradient(90deg, rgba(149, 122, 97, 0.25), rgba(149, 122, 97, 0.1));
    padding-left: 22px;
}

.language-switcher__option.active {
    background: linear-gradient(90deg, rgba(149, 122, 97, 0.35), rgba(149, 122, 97, 0.15));
    color: #D4AF37;
    font-weight: 600;
}

.language-switcher__option.active::before {
    transform: translateX(0);
}

.language-switcher__option span:first-child {
    font-size: 18px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Mobile adjustments for language switcher */
@media (max-width: 1024px) {
    .language-switcher {
        margin-right: 15px;
    }
    
    .language-switcher__button {
        min-width: 38px;
        min-height: 38px;
        padding: 7px;
    }
    
    .language-switcher__icon {
        font-size: 18px;
    }
    
    .language-switcher__dropdown {
        min-width: 140px;
        top: calc(100% + 8px);
    }
    
    .language-switcher__option {
        padding: 12px 16px;
        font-size: 13px;
        gap: 10px;
    }
    
    .language-switcher__option:hover {
        padding-left: 20px;
    }
}

@media (max-width: 768px) {
    .language-switcher {
        display: none; /* Hide on mobile, use mobile menu instead */
    }
}

/* Mobile Menu Language Switcher Styles */
.mobile-menu-lang {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid rgba(149, 122, 97, 0.25);
    border-bottom: 1px solid rgba(149, 122, 97, 0.25);
    margin: 15px 0;
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.05), transparent);
}

.mobile-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.12), rgba(149, 122, 97, 0.08));
    border: 1.5px solid rgba(149, 122, 97, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(149, 122, 97, 0.3), transparent);
    transition: left 0.5s ease;
}

.mobile-lang-btn:hover::before,
.mobile-lang-btn:active::before {
    left: 100%;
}

.mobile-lang-btn:hover {
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.2), rgba(149, 122, 97, 0.12));
    border-color: rgba(149, 122, 97, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 122, 97, 0.25);
}

.mobile-lang-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(149, 122, 97, 0.2);
}

.mobile-lang-btn.active {
    background: linear-gradient(135deg, rgba(149, 122, 97, 0.35), rgba(149, 122, 97, 0.2));
    border-color: #957A61;
    color: #D4AF37;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(149, 122, 97, 0.35), inset 0 1px 3px rgba(149, 122, 97, 0.3);
}

.mobile-lang-btn.active::after {
    content: '✓';
    margin-left: 8px;
    font-size: 16px;
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.mobile-lang-btn span {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* RTL Support for Mobile Lang Switcher */
[dir="rtl"] .mobile-menu-lang {
    direction: ltr;
}

[dir="rtl"] .mobile-lang-btn.active::after {
    margin-left: 0;
    margin-right: 8px;
}

/* Responsive RTL */
@media (max-width: 768px) {
    [dir="rtl"] .hero__content {
        flex-direction: column;
    }
    
    [dir="rtl"] .trading-benefits__layout,
    [dir="rtl"] .trading-features__layout,
    [dir="rtl"] .platform-hero__layout,
    [dir="rtl"] .platform-security__layout {
        flex-direction: column;
    }
    
    [dir="rtl"] .contact__layout {
        grid-template-columns: 1fr;
    }
}

/* Поддержка арабского шрифта */
[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] p,
[dir="rtl"] a,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] textarea {
    font-family: 'Inter', 'Arial', 'Tahoma', sans-serif;
}

/* Корректировка отступов для RTL */
[dir="rtl"] .container {
    padding-left: 40px;
    padding-right: 40px;
}

/* Корректировка теней и эффектов для RTL */
[dir="rtl"] .btn--primary {
    direction: rtl;
}

/* TradingView Widget RTL */
[dir="rtl"] .tradingview-widget-container {
    direction: ltr;
}

/* Корректировка для phone input в RTL */
[dir="rtl"] .iti {
    direction: ltr;
}

[dir="rtl"] .iti__flag-container {
    left: auto;
    right: 0;
}

[dir="rtl"] .form-input[type="tel"] {
    padding-left: 52px;
    padding-right: 16px;
}

