/* =================================================================
   RTL (Right-to-Left) SPECIFIC STYLES
   =================================================================
   
   This file contains all RTL-specific styles for Persian/Arabic content.
   These styles ensure proper layout and typography for RTL languages.
================================================================= */

/* RTL Base Styles */
[dir="rtl"] {
  text-align: right;
}

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

/* Typography RTL Adjustments */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  text-align: right;
}

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

/* Navigation RTL */
[dir="rtl"] .header-content {
  flex-direction: row;
}

[dir="rtl"] nav ul {
  flex-direction: row;
}

[dir="rtl"] nav li {
  margin-left: 0;
  margin-right: 2rem;
}

[dir="rtl"] nav li:last-child {
  margin-right: 0;
}

/* Cards and Grid RTL */
[dir="rtl"] .card-grid {
  direction: rtl;
}

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

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

/* Form Elements RTL */
[dir="rtl"] form {
  direction: rtl;
}

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

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

/* Button RTL */
[dir="rtl"] button,
[dir="rtl"] .btn {
  direction: rtl;
}

/* List RTL */
[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-right: 1.5rem;
  padding-left: 0;
}

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

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

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

/* Flexbox RTL Utilities */
[dir="rtl"] .flex-row {
  flex-direction: row;
}

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

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

/* Margin and Padding RTL Helpers */
[dir="rtl"] .mr-auto {
  margin-right: 0;
  margin-left: auto;
}

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

/* Float RTL */
[dir="rtl"] .float-left {
  float: right;
}

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

/* Text Alignment RTL */
[dir="rtl"] .text-left {
  text-align: right;
}

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

/* Border Radius RTL */
[dir="rtl"] .rounded-l {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

[dir="rtl"] .rounded-r {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

/* Responsive RTL Adjustments */
@media (max-width: 768px) {
  [dir="rtl"] .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  [dir="rtl"] nav ul {
    flex-direction: column;
    text-align: center;
  }
  
  [dir="rtl"] nav li {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}