/* ==========================================================================
   CarePDF - RTL (Right-to-Left) Language Support
   For Arabic, Urdu, Hebrew, Persian, etc.
   ========================================================================== */

/* ==========================================================================
   1. Base RTL Overrides
   ========================================================================== */

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

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

/* ==========================================================================
   2. Typography RTL
   ========================================================================== */

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] p {
    text-align: right;
}

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

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

/* ==========================================================================
   3. Flexbox RTL
   ========================================================================== */

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

[dir="rtl"] .flex-col {
    flex-direction: column;
}

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

[dir="rtl"] .justify-start {
    justify-content: flex-end;
}

[dir="rtl"] .justify-end {
    justify-content: flex-start;
}

/* ==========================================================================
   4. Margins & Paddings RTL
   ========================================================================== */

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

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

[dir="rtl"] .pl-md {
    padding-left: 0;
    padding-right: var(--spacing-md);
}

[dir="rtl"] .pr-md {
    padding-right: 0;
    padding-left: var(--spacing-md);
}

/* ==========================================================================
   5. Navigation RTL
   ========================================================================== */

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

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

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

[dir="rtl"] .navbar-actions {
    flex-direction: row-reverse;
    margin-left: 0;
    margin-right: 8px;
    padding-left: 0;
    padding-right: 16px;
    border-left: none;
    border-right: 1px solid var(--gray-200);
}

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

[dir="rtl"] .mobile-menu-btn {
    order: -1;
}

@media (max-width: 768px) {
    [dir="rtl"] .navbar-menu {
        flex-direction: column;
    }
    
    [dir="rtl"] .navbar-links {
        flex-direction: column;
    }
    
    [dir="rtl"] .navbar-actions {
        flex-direction: column;
        margin-right: 0;
        padding-right: 0;
        border-right: none;
    }
}

/* ==========================================================================
   6. Hero Section RTL
   ========================================================================== */

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

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

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

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

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

/* ==========================================================================
   7. Tool Cards RTL
   ========================================================================== */

[dir="rtl"] .tool-card,
[dir="rtl"] .tool-card-premium {
    flex-direction: row-reverse;
    text-align: right;
}

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

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

[dir="rtl"] .tool-card:hover .tool-arrow {
    transform: scaleX(-1) translateX(-4px);
}

/* ==========================================================================
   8. Upload Zone RTL
   ========================================================================== */

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

[dir="rtl"] .upload-zone-content {
    text-align: center;
}

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

/* ==========================================================================
   9. File Cards RTL
   ========================================================================== */

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

[dir="rtl"] .file-card {
    direction: ltr; /* Keep card internal layout LTR */
}

[dir="rtl"] .file-number {
    left: auto;
    right: -6px;
}

[dir="rtl"] .file-actions {
    right: auto;
    left: -8px;
}

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

/* ==========================================================================
   10. Tool Options RTL
   ========================================================================== */

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

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

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

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

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

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

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

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

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

/* ==========================================================================
   11. Forms RTL
   ========================================================================== */

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

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

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

[dir="rtl"] select.form-control {
    background-position: left 0.75rem center;
    padding-left: 2.5rem;
    padding-right: 1rem;
}

[dir="rtl"] .input-icon-wrapper .form-control {
    padding-left: 1rem;
    padding-right: 2.75rem;
}

[dir="rtl"] .input-icon-wrapper svg {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .password-input-wrapper input {
    padding-left: 3rem;
    padding-right: 1rem;
}

[dir="rtl"] .password-toggle {
    right: auto;
    left: 1rem;
}

/* ==========================================================================
   12. Buttons RTL
   ========================================================================== */

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

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

/* ==========================================================================
   13. Alerts & Notifications RTL
   ========================================================================== */

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

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

[dir="rtl"] .notification-container {
    left: var(--spacing-lg);
    right: auto;
}

@media (max-width: 767px) {
    [dir="rtl"] .notification-container {
        left: var(--spacing-sm);
        right: var(--spacing-sm);
    }
}

/* ==========================================================================
   14. Footer RTL
   ========================================================================== */

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

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

[dir="rtl"] .footer-brand {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .footer-social {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

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

[dir="rtl"] .footer-links li a {
    text-align: right;
}

[dir="rtl"] .footer-links li a:hover {
    transform: translateX(-3px);
}

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

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

[dir="rtl"] .footer-lang-menu {
    right: auto;
    left: 0;
}

@media (max-width: 768px) {
    [dir="rtl"] .footer-about {
        text-align: center;
    }
    
    [dir="rtl"] .footer-brand {
        justify-content: center;
    }
    
    [dir="rtl"] .footer-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .footer-column {
        text-align: center;
    }
    
    [dir="rtl"] .footer-bottom {
        flex-direction: column;
    }
    
    [dir="rtl"] .footer-lang-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(8px) scale(0.98);
    }
    
    [dir="rtl"] .footer-lang-menu.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ==========================================================================
   15. Category Headers RTL
   ========================================================================== */

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

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

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

/* ==========================================================================
   16. Steps/How It Works RTL
   ========================================================================== */

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

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

/* ==========================================================================
   17. Features Section RTL
   ========================================================================== */

[dir="rtl"] .features-row {
    direction: rtl;
}

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

/* ==========================================================================
   18. Sidebar RTL
   ========================================================================== */

[dir="rtl"] .tool-layout {
    direction: rtl;
}

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

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

[dir="rtl"] .widget-links li a {
    flex-direction: row-reverse;
}

/* ==========================================================================
   19. Trust Badges RTL
   ========================================================================== */

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

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

/* ==========================================================================
   20. Breadcrumbs & Pagination RTL
   ========================================================================== */

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

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

/* ==========================================================================
   21. Compression Options RTL
   ========================================================================== */

[dir="rtl"] .compression-options {
    direction: rtl;
}

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

/* ==========================================================================
   22. Processing Modal RTL
   ========================================================================== */

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

/* ==========================================================================
   23. Section Headers RTL
   ========================================================================== */

[dir="rtl"] .section-header,
[dir="rtl"] .section-header-modern {
    text-align: center;
}

/* ==========================================================================
   24. Page Header RTL
   ========================================================================== */

[dir="rtl"] .page-header-content {
    text-align: center;
}

/* ==========================================================================
   25. Blog RTL
   ========================================================================== */

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

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

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

/* ==========================================================================
   26. Icons RTL (Mirror arrows and directional icons)
   ========================================================================== */

[dir="rtl"] .icon-arrow-right,
[dir="rtl"] .icon-chevron-right {
    transform: scaleX(-1);
}

[dir="rtl"] .icon-arrow-left,
[dir="rtl"] .icon-chevron-left {
    transform: scaleX(-1);
}

/* ==========================================================================
   27. Scrollbar RTL
   ========================================================================== */

[dir="rtl"] ::-webkit-scrollbar {
    /* Keep scrollbar on right side */
}

/* ==========================================================================
   28. Tables RTL
   ========================================================================== */

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

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