/**
 * NotStudio RTL Styles
 * Right-to-Left layout support for Arabic
 */

/* ============================================
   RTL BASE STYLES
   ============================================ */

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

/*
 * Horizontal RTL “page slide”: clip ONLY the scrollable content wrappers — never html/body overflow-x
 * (that breaks vertical scroll + pull-to-refresh on iOS/WebKit).
 */
html[dir="rtl"] #smooth-wrapper,
html[dir="rtl"] #smooth-content {
  overflow-x: clip;
  max-width: 100%;
}

/* Niches landing (no smooth-wrapper) */
html[dir="rtl"] #scroll_container {
  overflow-x: clip;
  max-width: 100%;
}

/* Safari / older engines: clip may be unsupported — hidden on wrappers only (not body) */
@supports not (overflow-x: clip) {
  html[dir="rtl"] #smooth-wrapper,
  html[dir="rtl"] #smooth-content,
  html[dir="rtl"] #scroll_container {
    overflow-x: hidden;
  }
}

[dir="rtl"] body {
  font-family: 'Tajawal', 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ELEGANT ARABIC TYPOGRAPHY ENHANCEMENTS
   ============================================ */

/* Improve Arabic text rendering and spacing */
[dir="rtl"] {
  line-height: 1.8;
}

/* Slider section - elegant Arabic typography */
[dir="rtl"] .dest-title-1,
[dir="rtl"] .dest-title-2 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}

/* Main headings - bolder and more elegant */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

/* Hero headline specific */
[dir="rtl"] .hero-headline,
[dir="rtl"] .headline-line {
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  line-height: 1.2;
}

/* Section titles - elegant weight */
[dir="rtl"] .splitTextStyleOne {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  line-height: 1.4;
}

/* Body text - lighter weight for elegance */
[dir="rtl"] p,
[dir="rtl"] .dest-desc {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400;
  line-height: 1.9;
}

/* Button text - medium weight */
[dir="rtl"] .btn,
[dir="rtl"] .button__label,
[dir="rtl"] .dest-discover {
  font-family: 'Tajawal', sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Navigation and labels */
[dir="rtl"] .nav-menu__link,
[dir="rtl"] .sidebar-panel__label,
[dir="rtl"] .sidebar-panel__sublink {
  font-family: 'Tajawal', sans-serif;
  font-weight: 500;
}

/* FAQ section */
[dir="rtl"] .faq-card__question {
  font-family: 'Tajawal', sans-serif;
  font-weight: 600;
}

[dir="rtl"] .faq-card__answer {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400;
  line-height: 1.9;
}

/* Blog and article cards */
[dir="rtl"] .article-card__title {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  line-height: 1.5;
}

[dir="rtl"] .article-card__excerpt {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400;
  line-height: 1.8;
}

/* ============================================
   SIDEBAR LAYOUT - SWAPPED SIDES
   ============================================ */

[dir="rtl"] .sidebar-left {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .sidebar-right {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .sidebar-trigger__text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

[dir="rtl"] .sidebar-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

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

/* ============================================
   SIDEBAR PANEL
   ============================================ */

/* Panel slides from left in RTL; transform is controlled by GSAP (sidebar-panel.js), not CSS */
[dir="rtl"] .sidebar-panel {
  right: auto;
  left: 0;
}

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

[dir="rtl"] .sidebar-panel__num {
  margin-right: 0;
  margin-left: 16px;
}

/* ============================================
   HERO SECTION
   ============================================ */

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

[dir="rtl"] .hero-top-left {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .hero-top-right {
  margin-left: 0;
  margin-right: auto;
  order: -1;
  text-align: left;
}

/* Position logo on left side in RTL mode */
[dir="rtl"] .hero-section .hero-top-right {
  right: auto;
  left: 40px;
}

/* Logo should NOT be flipped in RTL - brand identity must remain consistent */
[dir="rtl"] .hero-section .hero-top-right img {
  transform: none;
}

/* Hero headline and typewriter for RTL */
[dir="rtl"] .hero-headline {
  text-align: right;
}

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

@media (max-width: 767px) {
  [dir="rtl"] .hero-top {
    flex-direction: column;
  }
  
  [dir="rtl"] .hero-top-left {
    text-align: center;
    margin-left: 0;
  }
  
  [dir="rtl"] .hero-top-right {
    margin-right: 0;
    order: 0;
  }
  
  [dir="rtl"] .hero-section .hero-top-right {
    left: auto;
    right: auto;
  }
  
  [dir="rtl"] .hero-headline,
  [dir="rtl"] .headline-line {
    text-align: center;
  }
}

/* Typewriter container - RTL support */
[dir="rtl"] .typewriter-container {
  direction: rtl;
  display: inline-flex;
  flex-direction: row-reverse;
}

[dir="rtl"] .typewriter-prefix {
  margin-right: 0;
  margin-left: 4px;
}

/* ============================================
   NAVIGATION & MOBILE MENU
   ============================================ */

[dir="rtl"] .nav-menu__item.has-submenu .nav-menu__link::after {
  right: auto;
  left: 0;
  transform: rotate(135deg);
}

[dir="rtl"] .nav-submenu {
  padding-left: 0;
  padding-right: 20px;
}

/* ============================================
   BRAND SLIDER
   ============================================ */

[dir="rtl"] .brand-slider {
  direction: ltr;
  /* Keep slider direction for consistent UX */
}

/* ============================================
   MARQUEE SECTION
   ============================================ */

[dir="rtl"] .marquee_left {
  direction: ltr;
  /* Keep marquee animation direction consistent */
}

[dir="rtl"] .marquee_right {
  direction: ltr;
  /* Keep marquee animation direction consistent */
}

[dir="rtl"] .marquee_left .animation-item,
[dir="rtl"] .marquee_right .animation-item {
  direction: ltr;
  /* Keep text inside LTR for English words */
}

[dir="rtl"] .marquee_left h2,
[dir="rtl"] .marquee_right h2 {
  direction: ltr;
  /* Keep marquee text LTR */
}

/* ============================================
   STATS GRID
   ============================================ */

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

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

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

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

/* ============================================
   SERVICES SHOWCASE (DESTINATIONS)
   ============================================ */

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

[dir="rtl"] .dest-nav > div:first-child {
  flex-direction: row-reverse;
}

[dir="rtl"] .dest-nav > div:first-child .dest-svg-container {
  margin-right: 0;
  margin-left: 12px;
}

[dir="rtl"] .dest-details {
  direction: rtl;
}

[dir="rtl"] .dest-title-box-1,
[dir="rtl"] .dest-title-box-2 {
  direction: ltr;
  /* Keep titles LTR for brand consistency */
}

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

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

[dir="rtl"] .dest-arrow-left {
  transform: rotate(180deg);
}

[dir="rtl"] .dest-arrow-right {
  transform: rotate(180deg);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

[dir="rtl"] .project-slider .swiper-wrapper {
  direction: ltr;
  /* Keep slider LTR */
}

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

[dir="rtl"] .notstudio-card-fluid .align-self-center {
  text-align: right;
}

/* ============================================
   BLOG SECTION
   ============================================ */

[dir="rtl"] #featuredArticlesSlider,
[dir="rtl"] #aboutArticlesSlider,
[dir="rtl"] .blog-slider,
[dir="rtl"] .articles-slider {
  direction: ltr;
}

/* Featured articles slider specific RTL fixes */
[dir="rtl"] .article-card {
  direction: rtl;
  text-align: right;
}

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

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

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

/* Blog section heading RTL - FIX: Button left, Text right */
[dir="rtl"] .blog .d-flex.align-items-center.justify-content-between,
[dir="rtl"] section.blog > .container > .d-flex.align-items-center.justify-content-between,
[dir="rtl"] .blog > div > .d-flex.flex-wrap.align-items-center.justify-content-between {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .blog .max-w-680-px {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .blog h2.splitTextStyleOne {
  text-align: right;
}

/* Ensure blog section header button goes to left in RTL */
[dir="rtl"] section.blog .d-flex.justify-content-between > a.btn,
[dir="rtl"] .blog .d-flex.justify-content-between > a.btn {
  margin-left: 0;
  margin-right: auto;
  order: -1;
}

/* Ensure split text animations work in RTL */
[dir="rtl"] .splitTextStyleOne {
  direction: rtl;
  unicode-bidi: normal;
}

/* ============================================
   FAQ SECTION
   ============================================ */

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

[dir="rtl"] .faq-card__icon {
  margin-right: 0;
  margin-left: 16px;
}

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

[dir="rtl"] .faq-card__answer {
  padding-right: 56px;
  padding-left: 24px;
}

/* ============================================
   COMPARISON TABLE
   ============================================ */

[dir="rtl"] .comparison-header,
[dir="rtl"] .comparison-row {
  direction: rtl;
}

[dir="rtl"] .comparison-header > div:first-child,
[dir="rtl"] .comparison-row > div:first-child {
  text-align: right;
}

[dir="rtl"] .comparison-header > div:last-child,
[dir="rtl"] .comparison-row > div:last-child {
  background: rgba(255, 107, 43, 0.05);
}

/* ============================================
   SECTION HEADINGS & BUTTONS
   ============================================ */

/* Section heading RTL alignment - CENTERED titles remain centered */
[dir="rtl"] .section-heading {
  text-align: right;
}

/* IMPORTANT: mx-auto text-center sections should stay CENTERED, not right-aligned */
[dir="rtl"] .max-w-890-px.mx-auto.text-center,
[dir="rtl"] .text-center.max-w-680-px.mx-auto,
[dir="rtl"] .text-center.max-w-680-px,
[dir="rtl"] .max-w-680-px.text-center,
[dir="rtl"] .mx-auto.text-center {
  text-align: center !important;
}

/* Ensure centered section headings stay centered in RTL */
[dir="rtl"] .text-center.max-w-680-px.mx-auto h2,
[dir="rtl"] .max-w-890-px.mx-auto.text-center h2,
[dir="rtl"] .max-w-680-px.text-center h2,
[dir="rtl"] .text-center h2,
[dir="rtl"] .faq-header.text-center h2,
[dir="rtl"] .comparison-section .text-center h2,
[dir="rtl"] section .text-center h2 {
  text-align: center !important;
}

/* Also center the subtitles */
[dir="rtl"] .text-center p,
[dir="rtl"] .faq-header.text-center .faq-description,
[dir="rtl"] .text-center .text-neutral-500 {
  text-align: center !important;
}

[dir="rtl"] .d-flex.align-items-center.justify-content-between {
  flex-direction: row-reverse;
}

/* Don't change text-align for centered containers */
[dir="rtl"] .d-flex.align-items-center.justify-content-between .max-w-680-px:not(.text-center) {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

/* Button arrows in RTL */
[dir="rtl"] .btn .ph-arrow-right,
[dir="rtl"] .btn-main-outline .ph-arrow-right,
[dir="rtl"] .btn-main-two .ph-arrow-right {
  transform: rotate(180deg);
}

/* Service cards button RTL */
[dir="rtl"] .service-card__actions {
  flex-direction: row-reverse;
}

/* Projects section RTL fixes */
[dir="rtl"] .swiper-slide .d-flex.flex-lg-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .swiper-slide .align-self-center {
  text-align: right;
}

/* Stats section RTL */
[dir="rtl"] .stats-card {
  text-align: right;
}

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

/* Destinations showcase RTL text alignment */
[dir="rtl"] .dest-details {
  text-align: right;
}

[dir="rtl"] .dest-title-1,
[dir="rtl"] .dest-title-2,
[dir="rtl"] .dest-desc {
  text-align: right;
}

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

/* Navigation arrows in RTL */
[dir="rtl"] .dest-arrow-left svg {
  transform: rotate(180deg);
}

[dir="rtl"] .dest-arrow-right svg {
  transform: rotate(180deg);
}

/* ============================================
   LEAD FORM
   ============================================ */

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

[dir="rtl"] .lead-form input,
[dir="rtl"] .lead-form select,
[dir="rtl"] .lead-form textarea {
  text-align: right;
}

[dir="rtl"] select.form-control,
[dir="rtl"] select {
  background-position: left 16px center;
  padding-right: 20px;
  padding-left: 48px;
}

[dir="rtl"] .lead-form .btn-submit {
  direction: rtl;
}

/* ============================================
   FOOTER
   ============================================ */

[dir="rtl"] .footer-modern__side-text--left {
  left: auto;
  right: 40px;
}

[dir="rtl"] .footer-modern__side-text--right {
  right: auto;
  left: 40px;
}

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

[dir="rtl"] .footer-modern__column h4::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .footer-modern__links li {
  padding-left: 0;
  padding-right: 20px;
}

[dir="rtl"] .footer-modern__links li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .footer-modern__contact-item {
  padding-left: 0;
  padding-right: 32px;
}

[dir="rtl"] .footer-modern__contact-item i {
  left: auto;
  right: 0;
}

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

/* ============================================
   LANGUAGE TOGGLE
   ============================================ */

.lang-toggle {
  position: fixed;
  top: 24px;
  right: 80px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  transition: all 0.3s ease;
}

[dir="rtl"] .lang-toggle {
  right: auto;
  left: 80px;
}

.lang-toggle__btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

/* Show only the inactive button */
.lang-toggle__btn:not(.active) {
  display: flex;
}

.lang-toggle__btn:hover {
  background: rgba(255, 107, 43, 0.3);
}

.lang-toggle__btn.active {
  display: none;
}

/* Hide toggle on mobile initially - can be moved to mobile menu */
@media (max-width: 991px) {
  .lang-toggle {
    width: 44px;
    height: 44px;
  }
}

/* ============================================
   RESPONSIVE RTL ADJUSTMENTS
   ============================================ */

@media (max-width: 767px) {
  [dir="rtl"] .hero-top {
    flex-direction: column;
  }
  
  [dir="rtl"] .notstudio-card-fluid {
    flex-direction: column;
  }
  
  [dir="rtl"] .comparison-header,
  [dir="rtl"] .comparison-row {
    grid-template-columns: 1fr;
  }
  
  [dir="rtl"] .lead-form-container {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ANIMATION FIXES FOR RTL
   ============================================ */

/* Ensure smooth transitions when switching languages */
[data-i18n] {
  transition: opacity 0.2s ease;
}

/* Cursor adjustments for RTL */
[dir="rtl"] .view-cursor {
  direction: rtl;
}

/* ============================================
   GSAP & SCROLL ANIMATION FIXES FOR RTL
   ============================================ */

/* Fix AOS (Animate On Scroll) for RTL */
[dir="rtl"] [data-aos="fade-left"] {
  transform: translate3d(100px, 0, 0);
}

[dir="rtl"] [data-aos="fade-right"] {
  transform: translate3d(-100px, 0, 0);
}

[dir="rtl"] [data-aos="slide-left"] {
  transform: translate3d(100px, 0, 0);
}

[dir="rtl"] [data-aos="slide-right"] {
  transform: translate3d(-100px, 0, 0);
}

/* Ensure proper text reveal animations in RTL */
[dir="rtl"] .splitTextStyleOne .char,
[dir="rtl"] .splitTextStyleOne .word {
  display: inline-block;
  direction: rtl;
}

/* Fix for absolutely positioned elements in sliders */
[dir="rtl"] .swiper-slide {
  direction: rtl;
}

[dir="rtl"] .swiper-slide .align-self-center {
  text-align: right;
}

/* Ensure consistent arrow directions in RTL */
[dir="rtl"] .ph-arrow-right {
  transform: rotate(180deg);
}

[dir="rtl"] .arrow-right-img {
  transform: rotate(180deg);
}

/* Brand slider fixes */
[dir="rtl"] .brand-slider-wrapper {
  direction: ltr;
}

/* Stats canvas fix for RTL */
[dir="rtl"] #stats-canvas {
  direction: ltr;
}

/* Hero video background - keep centered */
[dir="rtl"] .hero-video-bg {
  direction: ltr;
}

/* Typewriter animation container - RTL support for Arabic */
[dir="rtl"] .typewriter-container {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .typewriter-prefix {
  order: 2;
}

[dir="rtl"] .typewriter-text {
  order: 1;
}

[dir="rtl"] .typewriter-cursor {
  order: 3;
}

/* ============================================
   SWIPER/SLIDER SPECIFIC FIXES
   ============================================ */

/* Ensure pagination dots work correctly */
[dir="rtl"] .swiper-pagination {
  direction: ltr;
}

/* Fix slider navigation arrows */
[dir="rtl"] .swiper-button-next,
[dir="rtl"] .swiper-button-prev {
  direction: ltr;
}

/* ============================================
   Z-INDEX AND POSITIONING FIXES
   ============================================ */

/* Ensure sidebar panel is properly positioned */
[dir="rtl"] .sidebar-panel {
  z-index: 1000;
}

/* Fix any potential z-index issues with language toggle */
.lang-toggle {
  z-index: 9999;
}
