/* RTL (Right-to-Left) Support for Arabic */

[dir="rtl"] {
    direction: rtl;
}

/* Navigation RTL */
[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-brand {
    margin-right: 0;
    margin-left: auto;
}

/* Hero Section RTL */
[dir="rtl"] .hero .container {
    grid-template-columns: 1fr 1fr;
}

[dir="rtl"] .hero-buttons {
    flex-direction: row-reverse;
}

/* Features Grid RTL */
[dir="rtl"] .features-grid,
[dir="rtl"] .features-detailed,
[dir="rtl"] .free-features-grid {
    direction: rtl;
}

/* Stats RTL */
[dir="rtl"] .stats-grid {
    direction: rtl;
}

/* Footer RTL */
[dir="rtl"] .footer-content {
    direction: rtl;
}

[dir="rtl"] .footer-links ul {
    text-align: right;
}

/* Language Switcher */
.language-switcher {
    position: relative;
    margin-left: 1rem;
}

[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 1rem;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
    font-weight: 500;
}

.lang-current:hover {
    background: var(--border-color);
}

.lang-icon {
    font-size: 1.25rem;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

.language-switcher:hover .lang-dropdown,
.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 1px solid var(--border-color);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: var(--bg-light);
}

.lang-option.active {
    background: var(--bg-light);
    color: var(--primary-color);
    font-weight: 600;
}

.lang-option .lang-icon {
    font-size: 1.5rem;
}

.lang-name {
    flex: 1;
}

.lang-code {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Mobile Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin: 1rem 0;
    }
    
    .lang-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 0.5rem;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Anime Cards RTL */
[dir="rtl"] .anime-card {
    text-align: right;
}

[dir="rtl"] .anime-info {
    text-align: right;
}

/* Browse Page RTL */
[dir="rtl"] .filter-group {
    text-align: right;
}

[dir="rtl"] .anime-grid {
    direction: rtl;
}

/* Anime Detail RTL */
[dir="rtl"] .anime-header-content {
    direction: rtl;
}

[dir="rtl"] .anime-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .genre-tag {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .episode-list {
    direction: rtl;
}

[dir="rtl"] .episode-card {
    text-align: right;
}

/* Watch Page RTL */
[dir="rtl"] .episode-sidebar {
    direction: rtl;
}

[dir="rtl"] .info-tabs {
    flex-direction: row-reverse;
}

/* Policy Pages RTL */
[dir="rtl"] .policy-wrapper {
    direction: rtl;
}

[dir="rtl"] .policy-nav {
    text-align: right;
}

[dir="rtl"] .policy-section {
    text-align: right;
}

[dir="rtl"] .policy-section ul {
    margin-right: 1.5rem;
    margin-left: 0;
}

/* Buttons RTL */
[dir="rtl"] .btn svg {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* FAQ RTL */
[dir="rtl"] .faq-item {
    text-align: right;
}
