/* ============================================
   RTL Support for Arabic Language
   ============================================ */

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .header-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .search-bar .search-icon {
    left: auto;
    right: var(--space-3);
}

[dir="rtl"] .search-bar input {
    padding-left: var(--space-4);
    padding-right: 2.5rem;
}

[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .tool-page {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .tool-card-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .bento-card::before {
    content: none;
}

[dir="rtl"] .bento-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--primary));
    opacity: 0;
    transition: opacity var(--transition);
}

[dir="rtl"] .bento-card:hover::after {
    opacity: 1;
}

[dir="rtl"] .toast {
    right: auto;
    left: var(--space-6);
}

[dir="rtl"] .toast.success {
    border-left: none;
    border-right: 3px solid var(--success);
}

[dir="rtl"] .toast.error {
    border-left: none;
    border-right: 3px solid var(--danger);
}

[dir="rtl"] .action-bar {
    flex-direction: row-reverse;
}

/* Keep tool layout consistent on tablet/mobile where main.css switches to column layout. */
@media (max-width: 1024px) {
    [dir="rtl"] .tool-page {
        flex-direction: column;
    }
}

/* Arabic typography */
[dir="rtl"] body {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

@media (max-width: 768px) {
    [dir="rtl"] .footer-inner {
        flex-direction: column;
    }
}
