/**
 * RTL (Right-to-Left) Styles for Arabic
 * Applied when html[dir="rtl"]
 */

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

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

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

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

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

[dir="rtl"] .header__logo-icon {
    margin-left: 8px;
    margin-right: 0;
}

/* Buttons */
[dir="rtl"] .btn {
    direction: ltr;
}

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

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

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

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

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

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

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

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

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

/* Search */
[dir="rtl"] .search-bar {
    flex-direction: row-reverse;
}

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

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

/* Grid layouts */
[dir="rtl"] .features-grid {
    direction: rtl;
}

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

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

/* Listing page */
[dir="rtl"] .listing-header {
    text-align: right;
}

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

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

[dir="rtl"] .content-grid {
    direction: rtl;
}

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

/* Contact card */
[dir="rtl"] .contact-card {
    text-align: right;
}

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

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

/* Share buttons */
[dir="rtl"] .share-buttons {
    flex-direction: row-reverse;
}

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

/* Gallery */
[dir="rtl"] .gallery-nav-prev {
    right: 20px;
    left: auto;
}

[dir="rtl"] .gallery-nav-next {
    left: 20px;
    right: auto;
}

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

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

[dir="rtl"] .footer__grid {
    direction: rtl;
}

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

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

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

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

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

/* Breadcrumb */
[dir="rtl"] .breadcrumb {
    flex-direction: row-reverse;
}

[dir="rtl"] .breadcrumb-separator {
    transform: scaleX(-1);
}

/* Modal */
[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

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

/* Notifications */
[dir="rtl"] .notification {
    right: auto;
    left: 20px;
}

/* Pagination */
[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

[dir="rtl"] .pagination-prev::before {
    content: '→';
}

[dir="rtl"] .pagination-next::after {
    content: '←';
}

/* Icons with text */
[dir="rtl"] [class*="icon-"] + span,
[dir="rtl"] span + [class*="icon-"] {
    margin-right: 8px;
    margin-left: 0;
}

/* Flex items with gaps */
[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

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

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

/* Dropdowns */
[dir="rtl"] .dropdown {
    right: auto;
    left: 0;
}

/* Admin panel */
[dir="rtl"] .admin-sidebar {
    right: 0;
    left: auto;
}

[dir="rtl"] .admin-content {
    margin-right: 250px;
    margin-left: 0;
}

/* Messages */
[dir="rtl"] .message-list {
    text-align: right;
}

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

[dir="rtl"] .message-avatar {
    margin-left: 12px;
    margin-right: 0;
}

/* Alert boxes */
[dir="rtl"] .alert {
    text-align: right;
    flex-direction: row-reverse;
}

[dir="rtl"] .alert-icon {
    margin-left: 12px;
    margin-right: 0;
}

/* Prices (keep LTR for numbers) */
[dir="rtl"] .price,
[dir="rtl"] .listing-price,
[dir="rtl"] .card__price {
    direction: ltr;
    display: inline-block;
}

/* Phone numbers (keep LTR) */
[dir="rtl"] .phone-number {
    direction: ltr;
    display: inline-block;
}

/* Map */
[dir="rtl"] .map-container {
    direction: ltr;
}

/* Animation adjustments */
@keyframes slideInRTL {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRTL {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-400px);
        opacity: 0;
    }
}

[dir="rtl"] .notification {
    animation: slideInRTL 0.3s ease;
}

/* Arabic font adjustments */
[dir="rtl"] body {
    font-family: 'Noto Sans Arabic', 'Inter', 'Segoe UI', sans-serif;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Noto Sans Arabic', 'Inter', 'Segoe UI', sans-serif;
}
