/* RTL (Right-to-Left) Support for TikBeSave */

/* IMPORTANTE: Regra para garantir que logos NUNCA sejam espelhadas */
.rtl-layout svg,
.rtl-layout .navbar-brand svg,
[dir="rtl"] svg,
[dir="rtl"] .navbar-brand svg {
    transform: none !important;
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
}

/* RTL Layout Adjustments */
.rtl-layout {
    direction: rtl;
}

.rtl-layout .navbar-brand {
    margin-left: auto;
    margin-right: 0;
}

.rtl-layout .navbar-nav {
    margin-left: 0;
    margin-right: auto;
}

.rtl-layout .dropdown-menu-end {
    right: auto;
    left: 0;
}

.rtl-layout .text-md-end {
    text-align: right !important;
}

.rtl-layout .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

.rtl-layout .ms-1 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

.rtl-layout .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

.rtl-layout .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* SVG Logo RTL Adjustments */
/* .rtl-layout svg {
    transform: scaleX(-1);
} */
/* Comentado: Esta regra deforma as logos. Logos devem manter seu design original. */

/* Regra adicional para garantir que NENHUM SVG seja espelhado */
.rtl-layout svg {
    transform: none !important;
}

.rtl-layout .navbar-brand svg {
    margin-left: 16px;
    margin-right: 0;
    transform: none !important; /* Garante que a logo não seja espelhada */
}

/* Form Elements RTL */
.rtl-layout .input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

.rtl-layout .input-group .btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
}

/* Cards and Content RTL */
.rtl-layout .d-flex.justify-content-between {
    flex-direction: row-reverse;
}

/* Language Selector RTL */
.rtl-layout .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.255em;
}

/* Animation Adjustments for RTL */
.rtl-layout .feature-card:hover {
    transform: translateX(10px) translateY(-10px);
}

/* Bootstrap RTL Overrides */
.rtl-layout .col-md-6:last-child {
    text-align: left;
}

@media (min-width: 768px) {
    .rtl-layout .text-md-end {
        text-align: left !important;
    }
}

/* Font Adjustments for RTL Languages */
[lang="ar"], [lang="he"], [lang="fa"], [lang="ur"] {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    font-weight: 400;
}

[lang="ar"] {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', 'Noto Sans Arabic', sans-serif;
}

[lang="he"] {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', 'Noto Sans Hebrew', sans-serif;
}

[lang="zh"] {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}

[lang="ja"] {
    font-family: 'Segoe UI', 'Yu Gothic', 'Noto Sans CJK JP', sans-serif;
}

[lang="ko"] {
    font-family: 'Segoe UI', 'Malgun Gothic', 'Noto Sans CJK KR', sans-serif;
}

[lang="th"] {
    font-family: 'Segoe UI', 'Leelawadee UI', 'Noto Sans Thai', sans-serif;
}

[lang="hi"] {
    font-family: 'Segoe UI', 'Nirmala UI', 'Noto Sans Devanagari', sans-serif;
}

[lang="ru"] {
    font-family: 'Segoe UI', 'Calibri', 'Noto Sans', sans-serif;
}

/* Language-specific text adjustments */
[lang="ar"] .hero-title,
[lang="he"] .hero-title,
[lang="fa"] .hero-title,
[lang="ur"] .hero-title {
    font-size: 3rem;
    line-height: 1.2;
}

/* Mobile RTL Adjustments */
@media (max-width: 768px) {
    .rtl-layout .navbar-brand svg {
        margin-left: 8px;
        margin-right: 0;
        width: 180px;
        height: 50px;
    }
    
    .rtl-layout .hero-title {
        font-size: 2.2rem;
    }
    
    .rtl-layout .download-card {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .rtl-layout .navbar-brand svg {
        width: 160px;
        height: 45px;
    }
    
    .rtl-layout .hero-title {
        font-size: 2rem;
    }
    
    .rtl-layout .input-group {
        flex-direction: column;
    }
    
    .rtl-layout .input-group .form-control {
        border-radius: 15px !important;
        margin-bottom: 10px;
    }
    
    .rtl-layout .input-group .btn {
        border-radius: 15px !important;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rtl-layout .navbar-brand svg {
        width: 140px;
        height: 40px;
    }
    
    .rtl-layout .hero-title {
        font-size: 1.8rem;
    }
}

/* Touch device optimizations for RTL */
@media (hover: none) and (pointer: coarse) {
    .rtl-layout .feature-card:hover {
        transform: none;
    }
}

/* Landscape mode for small screens RTL */
@media (max-height: 600px) and (orientation: landscape) {
    .rtl-layout .hero-section {
        padding: 50px 0;
    }
}

/* Language selector responsive improvements */
@media (max-width: 576px) {
    .rtl-layout .dropdown-menu {
        max-height: 250px;
        min-width: 200px;
    }
    
    .rtl-layout .dropdown-item {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Improved spacing for RTL on mobile */
@media (max-width: 768px) {
    .rtl-layout .me-2 {
        margin-left: 0.3rem !important;
        margin-right: 0 !important;
    }
    
    .rtl-layout .ms-1 {
        margin-right: 0.2rem !important;
        margin-left: 0 !important;
    }
}
