/**
 * JobTermin - RTL (Right-to-Left) Styles for Arabic
 * FIXED VERSION - Newsletter + Footer Copyright Layout
 * 
 * @package JobTermin
 * @version 1.0.4 - COMPLETE FIX
 */

/* ==========================================================================
   1. GLOBAL RTL ADJUSTMENTS
   ========================================================================== */

body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl * {
    direction: rtl;
}

/* ==========================================================================
   2. HEADER RTL - FIXED (Logo and hamburger stay in same position)
   ========================================================================== */

/* ✅ CRITICAL: Override RTL for header structure - keep visual layout the same */
body.rtl header {
    direction: ltr; /* Keep header structure LTR */
}

body.rtl .header-container {
    direction: ltr !important; /* Logo left, buttons right - same as English/German */
}

/* ✅ But keep text content RTL where needed */
body.rtl .nav-menu a,
body.rtl .link-default,
body.rtl .link-signup,
body.rtl .link-logout {
    direction: rtl; /* Text reads RTL */
}

/* Logo stays LEFT (same position as EN/DE) */
body.rtl .logo {
    direction: ltr; /* Logo icon and text LTR */
}

body.rtl .logo-text {
    direction: rtl; /* But logo text reads RTL */
}

/* Navigation stays in CENTER */
body.rtl .nav-menu {
    direction: ltr; /* Container stays LTR */
}

body.rtl .nav-menu li {
    direction: ltr; /* Items stay LTR order */
}

/* Header right section stays RIGHT */
body.rtl .header-right {
    direction: ltr !important; /* Keep visual order: Lang | Login | Sign Up */
}

/* Language switcher */
body.rtl .lang-switcher {
    direction: ltr; /* Buttons stay in same order */
}

/* Auth links stay in same visual order */
body.rtl .auth-links {
    direction: ltr !important; /* Visual: Login | Sign Up (same as EN/DE) */
}

/* ==========================================================================
   3. MOBILE MENU RTL - FIXED
   ========================================================================== */

@media (max-width: 1023px) {
    /* ✅ Mobile hamburger stays RIGHT (same as EN/DE) */
    body.rtl #mobile-menu-toggle {
        /* No special positioning needed - stays in header-right */
    }
    
    /* ✅ Mobile menu content is RTL */
    body.rtl .mobile-menu {
        direction: rtl !important;
        text-align: right;
    }
    
    body.rtl .mobile-menu-content {
        direction: rtl;
        text-align: right;
    }
    
    body.rtl .mobile-nav-menu {
        direction: rtl;
        text-align: right;
    }
    
    body.rtl .mobile-nav-menu a {
        direction: rtl;
        text-align: right;
    }
    
    body.rtl .mobile-lang-switcher {
        direction: rtl;
    }
    
    body.rtl .mobile-auth-links {
        direction: rtl;
    }
}

/* ==========================================================================
   4. FOOTER RTL - FIXED
   ========================================================================== */

body.rtl footer {
    direction: rtl;
    text-align: right;
}

body.rtl footer > div > div {
    direction: rtl;
}

body.rtl .footer-nav-list {
    text-align: right;
    padding-left: 0;
    padding-right: 0;
}

body.rtl .footer-nav-list li {
    text-align: right;
}

body.rtl .footer-nav-list li a::before {
    content: '‹' !important; /* RTL arrow points left */
    margin-right: 0;
    margin-left: 0;
    transform: translateX(8px); /* Flip the animation direction */
}

body.rtl .footer-nav-list li a:hover {
    transform: translateX(-6px); /* Slide to the left in RTL */
}

body.rtl .footer-nav-list li a:hover::before {
    transform: translateX(0);
}

body.rtl .social-link {
    margin-left: 0;
    margin-right: 0.75rem;
}

body.rtl .social-link:first-child {
    margin-right: 0;
}

body.rtl .social-link:last-child {
    margin-left: 0.75rem;
}

/* ==========================================================================
   NEWSLETTER FORM - COMPLETE FIX (Desktop + Mobile)
   ========================================================================== */

/* Desktop: Horizontal layout with swapped positions */
body.rtl .newsletter-form {
    flex-direction: row;
    direction: rtl;
}

body.rtl .newsletter-input {
    text-align: right;
    border-radius: 0.85rem;
    order: 2; /* Input on right */
}

body.rtl .newsletter-btn {
    border-radius: 0.85rem;
    order: 1; /* Button on left */
    direction: rtl;
}

/* Mobile/Tablet: Stack vertically (same as LTR) */
@media (max-width: 1024px) {
    body.rtl .newsletter-form {
        flex-direction: column !important;
    }
    
    body.rtl .newsletter-input {
        order: 1 !important; /* Input first (top) */
        width: 100%;
        border-radius: 0.85rem;
    }
    
    body.rtl .newsletter-btn {
        order: 2 !important; /* Button second (bottom) */
        width: 100%;
        border-radius: 0.85rem;
    }
}

@media (max-width: 768px) {
    body.rtl .newsletter-form {
        flex-direction: column !important;
        gap: 0.6rem;
    }
    
    body.rtl .newsletter-input,
    body.rtl .newsletter-btn {
        width: 100%;
        border-radius: 0.85rem;
    }
}

@media (max-width: 480px) {
    body.rtl .newsletter-form {
        flex-direction: column !important;
        gap: 0.6rem;
    }
    
    body.rtl .newsletter-input,
    body.rtl .newsletter-btn {
        width: 100%;
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 0.85rem;
    }
}

/* ==========================================================================
   FOOTER BOTTOM - COPYRIGHT & LEGAL - COMPLETE FIX
   ========================================================================== */

body.rtl .footer-bottom {
    direction: rtl;
    text-align: center;
}

body.rtl .footer-bottom-content {
    direction: rtl;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.rtl .footer-copyright {
    text-align: center;
    direction: rtl;
}

body.rtl .footer-legal {
    direction: rtl;
    flex-direction: row-reverse;
    justify-content: center;
}

/* ✅ FIX: Ensure proper spacing and alignment */
body.rtl .footer-legal .legal-link {
    direction: rtl;
}

body.rtl .footer-legal .divider {
    margin: 0 0.5rem;
}

/* ✅ FIX: Mobile copyright section */
@media (max-width: 768px) {
    body.rtl .footer-bottom-content {
        text-align: center;
    }
    
    body.rtl .footer-copyright {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    body.rtl .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    body.rtl .footer-copyright {
        font-size: 0.8rem;
        text-align: center;
    }
    
    body.rtl .footer-legal {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    body.rtl .footer-legal .divider {
        display: none;
    }
}

/* ==========================================================================
   5. FORMS RTL
   ========================================================================== */

body.rtl input,
body.rtl textarea,
body.rtl select {
    text-align: right;
    direction: rtl;
}

body.rtl input[type="email"],
body.rtl input[type="url"] {
    direction: ltr;
    text-align: left;
}

body.rtl input[type="checkbox"],
body.rtl input[type="radio"] {
    margin-left: 0.5rem;
    margin-right: 0;
}

body.rtl label {
    text-align: right;
}

/* ==========================================================================
   6. BUTTONS RTL - FIXED FOR ALL ICON POSITIONS
   ========================================================================== */

body.rtl button,
body.rtl .btn {
    direction: rtl;
}

/* ✅ CRITICAL: Fix icon positions in ALL buttons */
body.rtl button svg,
body.rtl .btn svg,
body.rtl .hero-ctas svg,
body.rtl .cta-primary svg,
body.rtl .cta-secondary svg,
body.rtl .newsletter-btn svg,
body.rtl a svg {
    margin-left: 0;
    margin-right: 0;
}

/* ✅ Fix hero CTA buttons - keep icons on LEFT */
body.rtl .hero-ctas a {
    flex-direction: row !important; /* Icon stays LEFT */
    direction: rtl; /* Text reads RTL */
}

body.rtl .cta-primary,
body.rtl .cta-secondary {
    flex-direction: row !important; /* Icon LEFT, text RIGHT */
}

/* ✅ Fix newsletter button */
body.rtl .newsletter-btn {
    direction: rtl;
}

/* ==========================================================================
   7. HOME PAGE RTL
   ========================================================================== */

body.rtl main {
    direction: rtl;
}

body.rtl #jobtermin-search {
    direction: rtl;
}

body.rtl #jobtermin-search > div {
    direction: rtl;
    flex-direction: row-reverse;
}

body.rtl #jobtermin-search input {
    text-align: right;
    direction: rtl;
}

body.rtl #jobtermin-search button {
    direction: rtl;
}

body.rtl .hero-ctas {
    direction: rtl;
}

/* ✅ CRITICAL: Keep icons on LEFT side visually */
body.rtl .hero-ctas a {
    flex-direction: row !important; /* Icon stays on LEFT visually */
    direction: rtl; /* But text reads RTL */
}

body.rtl .cta-primary,
body.rtl .cta-secondary {
    flex-direction: row !important;
}

/* ✅ Fix icon gaps */
body.rtl .hero-ctas a svg,
body.rtl .cta-primary svg,
body.rtl .cta-secondary svg {
    order: 1; /* Icon first (left side) */
    margin-left: 0;
    margin-right: 0;
}

body.rtl .hero-ctas a > span,
body.rtl .cta-primary > span,
body.rtl .cta-secondary > span {
    order: 2; /* Text second (right side) */
}

body.rtl main > section:nth-of-type(2) > div > div {
    text-align: center;
}

body.rtl .steps-container > div {
    text-align: center;
}

/* ✅ FIXED: Keep icon on left, text in middle, arrow on right - same visual layout */
body.rtl .hiring-category {
    flex-direction: row !important; /* Keep same visual order as EN/DE */
}

body.rtl .category-icon {
    order: 1; /* Icon stays LEFT */
}

body.rtl .category-content {
    order: 2; /* Text in middle */
    direction: rtl; /* But text reads RTL */
    text-align: right;
}

body.rtl .category-arrow {
    order: 3; /* Arrow stays RIGHT */
}

body.rtl .category-arrow svg {
    transform: scaleX(-1); /* Flip arrow direction */
}

body.rtl .service-card {
    text-align: center;
}

/* ==========================================================================
   8. CARDS & CONTENT RTL
   ========================================================================== */

body.rtl .card {
    text-align: right;
}

body.rtl .card-header {
    text-align: right;
}

body.rtl .card-body {
    text-align: right;
}

body.rtl ul,
body.rtl ol {
    padding-right: 1.5rem;
    padding-left: 0;
}

body.rtl li svg {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* ==========================================================================
   9. TABLES RTL
   ========================================================================== */

body.rtl table {
    direction: rtl;
}

body.rtl th {
    text-align: right;
}

body.rtl td {
    text-align: right;
}

/* ==========================================================================
   10. MODALS & POPUPS RTL
   ========================================================================== */

body.rtl .modal {
    direction: rtl;
}

body.rtl .modal-header {
    flex-direction: row-reverse;
}

body.rtl .modal-close {
    left: auto;
    right: 1rem;
}

body.rtl .modal-body {
    text-align: right;
}

/* ==========================================================================
   11. TOOLTIPS & DROPDOWNS RTL
   ========================================================================== */

body.rtl .tooltip {
    direction: rtl;
    text-align: right;
}

body.rtl .dropdown-menu {
    right: auto;
    left: 0;
    text-align: right;
}

/* ==========================================================================
   12. PAGINATION RTL
   ========================================================================== */

body.rtl .pagination {
    flex-direction: row-reverse;
}

/* ==========================================================================
   13. BREADCRUMBS RTL
   ========================================================================== */

body.rtl .breadcrumb {
    flex-direction: row-reverse;
}

body.rtl .breadcrumb-separator {
    transform: scaleX(-1);
}

/* ==========================================================================
   14. ALERTS & NOTIFICATIONS RTL
   ========================================================================== */

body.rtl .alert {
    text-align: right;
}

body.rtl .alert-icon {
    margin-left: 0.75rem;
    margin-right: 0;
}

body.rtl .notification,
body.rtl #footer-notification {
    right: auto;
    left: 30px;
}

/* ==========================================================================
   15. SPECIAL ADJUSTMENTS
   ========================================================================== */

/* Numbers and dates stay LTR */
body.rtl .number,
body.rtl .date,
body.rtl .time,
body.rtl .phone,
body.rtl .email,
body.rtl .ai-stat-number,
body.rtl .price-range {
    direction: ltr;
    display: inline-block;
}

/* Code blocks stay LTR */
body.rtl pre,
body.rtl code {
    direction: ltr;
    text-align: left;
}

/* Floats reversal */
body.rtl .float-left {
    float: right !important;
}

body.rtl .float-right {
    float: left !important;
}

/* Text alignment */
body.rtl .text-left {
    text-align: right !important;
}

body.rtl .text-right {
    text-align: left !important;
}

/* Margins and padding swap */
body.rtl .mr-1 { margin-right: 0; margin-left: 0.25rem !important; }
body.rtl .mr-2 { margin-right: 0; margin-left: 0.5rem !important; }
body.rtl .mr-3 { margin-right: 0; margin-left: 0.75rem !important; }
body.rtl .mr-4 { margin-right: 0; margin-left: 1rem !important; }

body.rtl .ml-1 { margin-left: 0; margin-right: 0.25rem !important; }
body.rtl .ml-2 { margin-left: 0; margin-right: 0.5rem !important; }
body.rtl .ml-3 { margin-left: 0; margin-right: 0.75rem !important; }
body.rtl .ml-4 { margin-left: 0; margin-right: 1rem !important; }

body.rtl .pr-1 { padding-right: 0; padding-left: 0.25rem !important; }
body.rtl .pr-2 { padding-right: 0; padding-left: 0.5rem !important; }
body.rtl .pr-3 { padding-right: 0; padding-left: 0.75rem !important; }
body.rtl .pr-4 { padding-right: 0; padding-left: 1rem !important; }

body.rtl .pl-1 { padding-left: 0; padding-right: 0.25rem !important; }
body.rtl .pl-2 { padding-left: 0; padding-right: 0.5rem !important; }
body.rtl .pl-3 { padding-left: 0; padding-right: 0.75rem !important; }
body.rtl .pl-4 { padding-left: 0; padding-right: 1rem !important; }

/* ==========================================================================
   16. RESPONSIVE RTL
   ========================================================================== */

@media (max-width: 768px) {
    body.rtl #footer-notification {
        left: 20px;
        right: auto;
    }
}

@media (max-width: 480px) {
    body.rtl #footer-notification {
        left: 20px;
        right: auto;
        max-width: calc(100vw - 40px);
    }
}

/* ==========================================================================
   17. EUROPE PAGE RTL - WORK IN EUROPE SPECIFIC STYLES
   ========================================================================== */

/* ✅ Europe Main Container */
body.rtl .europe-main {
    direction: rtl;
}

/* ✅ Hero Banner RTL */
body.rtl .europe-banner {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-banner__container {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-banner__content {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-banner__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-banner__subtitle {
    direction: rtl;
    text-align: center;
}

/* ✅ Metrics Grid RTL */
body.rtl .europe-metrics {
    direction: rtl;
}

body.rtl .europe-metrics__item {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-metrics__number {
    direction: ltr;
    display: inline-block;
}

/* ✅ Button Group RTL */
body.rtl .europe-btn-group {
    direction: rtl;
    flex-direction: row;
}

body.rtl .europe-btn {
    direction: rtl;
    flex-direction: row;
}

body.rtl .europe-btn svg {
    margin-left: 0;
    margin-right: 0.75rem;
}

/* ✅ Problem Section RTL */
body.rtl .europe-problem {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-problem__wrapper {
    direction: rtl;
}

body.rtl .europe-problem__heading {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-comparison {
    direction: rtl;
    flex-direction: row-reverse;
}

body.rtl .europe-comparison__column {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-comparison__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-comparison__list {
    direction: rtl;
    text-align: right;
    padding-right: 1.5rem;
    padding-left: 0;
}

body.rtl .europe-comparison__list li {
    direction: rtl;
    text-align: right;
}

/* ✅ Tiers Section RTL */
body.rtl .europe-tiers {
    direction: rtl;
}

body.rtl .europe-tiers__wrapper {
    direction: rtl;
}

body.rtl .europe-tiers__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-tiers__subtitle {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-tiers__grid {
    direction: rtl;
}

/* ✅ Tier Cards RTL */
body.rtl .europe-tier {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__header {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__title {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__label {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__pricing {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__price {
    direction: ltr;
    display: inline-block;
}

body.rtl .europe-tier__frequency {
    direction: rtl;
}

body.rtl .europe-tier__description {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__features {
    direction: rtl;
    text-align: right;
    padding-right: 1.5rem;
    padding-left: 0;
}

body.rtl .europe-tier__features li {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__note {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-tier__cta {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-tier__badge {
    direction: rtl;
    text-align: center;
}

/* ✅ Assessment Section RTL */
body.rtl .europe-assessment {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-assessment__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-assessment__description {
    direction: rtl;
    text-align: right;
}

/* ✅ What's Included Section RTL */
body.rtl .europe-whats-included {
    direction: rtl;
}

body.rtl .europe-whats-included__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-whats-included__grid {
    direction: rtl;
}

body.rtl .europe-component {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-component__icon {
    direction: rtl;
}

body.rtl .europe-component__content {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-component__title {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-component__description {
    direction: rtl;
    text-align: right;
}

/* ✅ What We Do / What We Don't RTL */
body.rtl .europe-what-we-do {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-what-we-do__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-do-dont {
    direction: rtl;
    flex-direction: row-reverse;
}

body.rtl .europe-legal__box {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-legal__title {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-legal__list {
    direction: rtl;
    text-align: right;
    padding-right: 1.5rem;
    padding-left: 0;
}

body.rtl .europe-legal__list li {
    direction: rtl;
    text-align: right;
}

/* ✅ FAQ Section RTL */
body.rtl .europe-faq {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-faq__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-faq__subtitle {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-faq__item {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-faq__question {
    direction: rtl;
    text-align: right;
    flex-direction: row-reverse;
}

body.rtl .europe-faq__question svg {
    order: 1;
    margin-left: 0;
    margin-right: 1rem;
}

body.rtl .europe-faq__question span {
    order: 2;
}

body.rtl .europe-faq__answer {
    direction: rtl;
    text-align: right;
}

/* ✅ Testimonials Section RTL */
body.rtl .europe-testimonials {
    direction: rtl;
}

body.rtl .europe-testimonials__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-testimonial {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-testimonial__quote {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-testimonial__author {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-testimonial__role {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-testimonial__meta {
    direction: rtl;
    text-align: right;
}

/* ✅ Locations Section RTL */
body.rtl .europe-locations {
    direction: rtl;
}

body.rtl .europe-locations__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-locations__grid {
    direction: rtl;
}

body.rtl .europe-location-card {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-location-card__name {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-location-card__country {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-location-card__jobs {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-location-card__salary {
    direction: ltr;
    display: inline-block;
}

/* ✅ Why Europe / Why Us Sections RTL */
body.rtl .europe-why-section {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-why-section__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-why-section__grid {
    direction: rtl;
}

body.rtl .europe-benefit-card {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-benefit-card__title {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-benefit-card__description {
    direction: rtl;
    text-align: right;
}

/* ✅ Process Section RTL */
body.rtl .europe-process {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-process__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-process__grid {
    direction: rtl;
}

body.rtl .europe-step {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-step__number {
    direction: ltr;
    display: inline-block;
}

body.rtl .europe-step__title {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-step__description {
    direction: rtl;
    text-align: right;
}

/* ✅ Eligibility Section RTL */
body.rtl .europe-eligibility {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-eligibility__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-eligibility__grid {
    direction: rtl;
}

body.rtl .europe-eligibility-card {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-eligibility-card__name {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-eligibility-card__description {
    direction: rtl;
    text-align: right;
}

body.rtl .europe-eligibility-card__icon {
    order: 1;
    margin-left: 0;
    margin-right: 1rem;
}

/* ✅ Final CTA RTL */
body.rtl .europe-cta-final {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-cta-final__title {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-cta-final__subtitle {
    direction: rtl;
    text-align: center;
}

body.rtl .europe-cta-final__buttons {
    direction: rtl;
    flex-direction: row;
}

/* ==========================================================================
   END OF EUROPE PAGE RTL STYLES
   ========================================================================== */
