/* ملف CSS جاهز للاستخدام خارجيًا */

.tafgeet-container,
.tafgeet-container * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.tafgeet-container {
  font-size: 14px;
  line-height: 1.4;
  color: #0f172a;
  background: #f1f5f9;
  padding: 12px;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

.main-header {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  margin-bottom: 16px;
}

.main-header h1 {
  color: #1e40af;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.main-header p {
  color: #64748b;
  font-size: 0.85rem;
}

.main-content {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-bottom: 20px;
}

@media (min-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }

  .input-section {
    grid-column: 2;
    grid-row: 1;
  }

  .result-section {
    grid-column: 1;
    grid-row: 1;
  }

  .examples-section,
  .explanation-section {
    grid-column: 1 / span 2;
  }
}

.input-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef6ff;
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  font-weight: 600;
  color: #1e40af;
  font-size: 0.85rem;
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-hint {
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 4px;
}

.unit-options {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .unit-options {
    flex-direction: column;
    gap: 8px;
  }
}

.unit-category,
.unit-type {
  flex: 1;
}

.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.9rem;
  text-align: right;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.dropdown-btn:hover {
  border-color: #2563eb;
}

.dropdown-btn:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-btn .arrow {
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.dropdown-btn.active .arrow {
  transform: rotate(180deg);
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
}

.dropdown-content.active {
  display: block;
}

.dropdown-option {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.dropdown-option:hover {
  background: #dbeafe;
}

.dropdown-option input {
  margin-left: 8px;
  cursor: pointer;
}

.dropdown-option label {
  cursor: pointer;
  flex: 1;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-option .option-icon {
  font-size: 1rem;
}

.extra-options {
  margin-bottom: 12px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.checkbox-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.85rem;
  color: #0f172a;
  cursor: pointer;
}

.custom-ending-group {
  margin-bottom: 10px;
}

.ending-suggestions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.suggestion-btn {
  padding: 4px 8px;
  border-radius: 12px;
  background: #dbeafe;
  border: 1px solid #2563eb;
  color: #2563eb;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.suggestion-btn:hover {
  background: #2563eb;
  color: white;
}

.convert-btn {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: none;
  color: white;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.convert-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.result-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-container {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(5, 150, 105, 0.2);
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  /* أضف هذه السطرين الجدد: */
  width: 100%;
  overflow: hidden;
    
}

.result-title {
  font-size: 1rem;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.original-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2563eb;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  background: #f1f8ff;
  border: 1px dashed rgba(37, 99, 235, 0.2);
  margin-bottom: 8px;
}

.result-arrow {
  text-align: center;
  color: #0891b2;
  margin: 8px 0;
  font-size: 1rem;
}

.converted-text {
  font-size: 1rem;
  color: #0f172a;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  background: #fbfdff;
  border: 1px solid rgba(9, 145, 178, 0.1);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* حافظ على هذه: */
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  flex: 1;
  max-width: 100%;
  /* أضف هذه السطر الجديد: */
  overflow: auto;
    
}

@media (max-width: 768px) {
  .converted-text {
    font-size: 0.95rem;
    padding: 10px;
    line-height: 1.5;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
  
  .result-container {
    overflow: hidden;
  }
}
/* ============================================
   أزرار الإجراءات - Action Buttons
   ============================================ */

/* الحاوية الرئيسية لأزرار الإجراءات */
/* ---------- استبدال: تحسين سلوك أزرار الإجراءات (فليكسبوكس، ومركز، ومرونة) ---------- */

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center; /* يوسّط العناصر عندما الصف مش مليان */
  align-items: stretch;    /* يخلي ارتفاع كل الأزرار موحّد */
  margin-top: 12px;
}

/* قاعدة عامة للأزرار - تمنع الانكماش الغريب وتحدّد العرض الأساسي */
.action-btn {
  flex: 0 1 150px; /* flex: [grow] [shrink] [basis] */
  min-width: 120px; /* يمنع الانكماش لدرجة عدم قابلية النقر */
  max-width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  min-height: 36px;
  box-sizing: border-box;
  /* أزل position: relative/z-index إن موجود هنا لتفادي تداخل الطبقات */
  position: static;
  z-index: auto;
}

/* اجعل حاوية التصدير تتصرف كفليكس وتملأ زر التحميل المساحة داخليًا */
.export-dropdown {
  display: inline-flex;
  flex: 0 1 150px;
  min-width: 120px;
  align-items: stretch;
}

/* زر التصدير الداخلي يملأ الحاوية */
.export-dropdown .export-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* تصرفات على شاشات صغيرة (محايدة وسهلة القراءة) */
@media (max-width: 640px) {
  .action-buttons {
    gap: 6px;
  }

  /* صفين على الموبايل: كل زر يشغل حوالي نصف العرض مع الحفاظ على الفراغ */
  .action-btn,
  .export-dropdown {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .action-btn {
    padding: 6px 8px;
    font-size: 0.78rem;
    min-height: 34px;
  }
}

@media (min-width: 1024px) {
  /* على الشاشات الكبيرة نسمح لكل زر أن يأخذ مساحة أقرب للـ 4 أعمدة */
  .action-btn {
    flex: 0 1 18%;
    min-width: 130px;
  }

  .export-dropdown {
    flex: 0 1 18%;
  }
}


/* النمط الأساسي لكل أزرار الإجراءات */

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
  transform: translateY(0);
}

/* أيقونة داخل الأزرار */
.btn-icon {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* زر النسخ - أخضر */
.copy-btn {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #047857, #0d9668);
  color: white !important;
}
/* زر السجل - برتقالي */
.history-btn {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: white;
}

.history-btn:hover {
  background: linear-gradient(135deg, #b45309, #d97706);
}

/* زر التحميل مع القائمة المنسدلة */
.export-dropdown {
  position: relative;
}


.export-btn:hover {
  background: linear-gradient(135deg, #4b5563, #6b7280);
}

/* قائمة خيارات التحميل */
.export-options {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 4px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.export-options.active {
  display: block;

    
}

.export-option {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: white;
  text-align: right;
  cursor: pointer;
  font-size: 0.85rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.export-option:last-child {
  border-bottom: none;
}

.export-option:hover {
  background: #f8fafc;
  color: #2563eb;
}

.export-option:active {
  background: #e2e8f0;
}

/* زر الترجمة - بنفسجي */
.language-btn {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: white;
}

.language-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

/* زر السماع - أزرق داكن */
.listen-btn {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
}

.listen-btn:hover {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
}

/* زر المسح - أحمر */
.reset-btn {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
}

.reset-btn:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

/* زر التحويل الرئيسي */
.convert-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  color: white;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.convert-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* زر التحويل في حالة التحميل */
.convert-btn.loading {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  cursor: not-allowed;
  opacity: 0.8;
}

/* ============================================
   تحسينات للشاشات الصغيرة
   ============================================ */
@media (max-width: 480px) {
  .action-buttons {
    gap: 4px;
  }
  
  .action-btn {
    padding: 6px 4px;
    font-size: 0.75rem;
    min-height: 32px;
  }
  
  .btn-icon {
    font-size: 0.8rem;
  }
  
  .convert-btn {
    padding: 10px;
    font-size: 0.95rem;
  }
}

/* ============================================
   تحسينات للشاشات الكبيرة
   ============================================ */
@media (min-width: 768px) {
  .action-buttons {
    gap: 8px;
  }
  
  .action-btn {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
}

/* ============================================
   تأثيرات الحركة
   ============================================ */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.action-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  animation: pulse 0.3s ease;
}

/* ============================================
   حالات خاصة للأزرار المعطلة
   ============================================ */
.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}


.history-container {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: none;
  border: 1px solid #e2e8f0;
}

.history-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
}

.history-item {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.history-item:last-child {
  border-bottom: none;
}

.history-number {
  font-weight: 700;
  color: #2563eb;
  font-size: 0.8rem;
  min-width: 60px;
}

.history-result {
  flex: 1;
  text-align: right;
  font-size: 0.8rem;
  color: #0f172a;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.history-actions button {
  background: none;
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #2563eb;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.history-actions button:hover {
  background: #2563eb;
  color: white;
}

.examples-section,
.explanation-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef6ff;
  max-width: 100%;
  overflow-x: hidden;
}
/* أضف هذه القاعدة في نهاية CSS الخاص ب examples-section */
.examples-section .example-card:last-child .example-number {
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: normal;
  font-size: 0.85rem;
  line-height: 1.3;
  max-width: 100%;
  display: block;
}

.section-title {
  font-size: 1rem;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 768px) {
  .examples-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .examples-grid {
    grid-template-columns: 1fr;
  }
}

.example-card {
  padding: 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
}

.example-number {
  font-weight: 700;
  color: #2563eb;
  font-size: 1rem;
  padding: 8px;
  border-radius: 4px;
  background: white;
  text-align: center;
}

.example-result {
  font-size: 0.85rem;
  color: #0f172a;
  text-align: center;
  line-height: 1.4;
}

/* قسم الشرح الموسع */
.explanation-section {
  margin-top: 20px;
}

.explanation-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #334155;
  max-width: 100%;
  overflow-x: hidden;
}
.explanation-content h2 {
  color: #1e40af;
  font-size: 1.1rem;
  margin: 20px 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #dbeafe;
}

.explanation-content h3 {
  color: #2563eb;
  font-size: 1rem;
  margin: 15px 0 8px 0;
}

.explanation-content p {
  margin-bottom: 12px;
  text-align: right;
}

.explanation-content ul, 
.explanation-content ol {
  margin-right: 20px;
  margin-bottom: 15px;
}

.explanation-content li {
  margin-bottom: 8px;
  padding-right: 10px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.feature-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
  display: block;
}

.feature-card h3 {
  color: #1e40af;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: #475569;
  margin: 0;
}

.steps-container {
  counter-reset: step-counter;
  margin: 20px 0;
}

.step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
  border-right: 3px solid #2563eb;
}

.step:before {
  counter-increment: step-counter;
  content: counter(step-counter);
  background: #2563eb;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 15px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  color: #1e40af;
  margin-bottom: 5px;
  font-size: 0.95rem;
}

.step-content p {
  margin: 0;
  font-size: 0.85rem;
}

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}


.use-case-item {
  background: #f0f9ff;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #bae6fd;
}

.use-case-item h3 {
  color: #0369a1;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.use-case-item p {
  font-size: 0.8rem;
  color: #0c4a6e;
  margin: 0;
}

.benefits-list {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #86efac;
}

.benefits-list h2 {
  color: #059669;
  margin-bottom: 15px;
}

.benefits-list ul {
  list-style-type: none;
  margin: 0;
}

.benefits-list li {
  position: relative;
  padding-right: 25px;
  margin-bottom: 10px;
}

.benefits-list li:before {
  content: "✓";
  position: absolute;
  right: 0;
  color: #059669;
  font-weight: bold;
}

.faq-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
}

.faq-question {
  color: #1e40af;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.faq-answer {
  color: #475569;
  font-size: 0.85rem;
  margin: 0;
}

.highlight-box {
  background: linear-gradient(135deg, #dbeafe, #f0f9ff);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border: 2px solid #2563eb;
  text-align: center;
}

.highlight-box h3 {
  color: #1e40af;
  margin-bottom: 10px;
}

.highlight-box p {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.tips-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.tip-item {
  background: #fef3c7;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #fbbf24;
}

.tip-item h3 {
  color: #d97706;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.tip-item p {
  font-size: 0.8rem;
  color: #92400e;
  margin: 0;
}

.note-box {
  margin-top: 12px;
  background: #fff7ed;
  border-right: 3px solid #d97706;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #92400e;
}

/* تذييل الصفحة */
.main-footer {
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-top: 16px;
}

.main-footer p {
  color: #64748b;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.footer-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  color: #64748b;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

/* رسائل التنبيه */
.message-toast {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: 10px 14px;
  border-radius: 6px;
  color: white;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.85rem;
  animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s;
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

@media (max-width: 768px) {
  .tafgeet-container {
    padding: 8px;
    overflow-x: hidden;
  }
  
  .main-content {
    gap: 12px;
  }
  
  .converted-text {
    font-size: 0.95rem;
    padding: 10px;
    line-height: 1.5;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    /* أضف هذه: */
    max-height: 200px;
    overflow-y: auto;
  }
  
  .result-container {
    min-height: 350px;
    overflow: hidden;
  }
  
  .original-number {
    font-size: 0.95rem;
    word-break: break-all;
    overflow-wrap: break-word;
  }
}

/* أضف هذه القاعدة الجديدة للمساعدة */
@media (max-width: 480px) {
  .converted-text {
    font-size: 0.9rem;
    padding: 8px;
    max-height: 180px;
  }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {

  .main-header {
    padding: 12px;
  }

  .main-header h1 {
    font-size: 1.1rem;
  }

  .input-card,
  .result-container,
  .examples-section,
  .explanation-section {
    padding: 12px;
  }

  .original-number {
    font-size: 1rem;
    padding: 8px;
  }


  .form-input {
    padding: 8px 10px;
  }

  .action-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-grid,
  .use-case-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .input-card,
  .result-container {
    min-height: 420px;
  }
}

.dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  display: none;
}

.dropdown-backdrop.active {
  display: block;
}

.language-options {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.language-option {
  padding: 4px 8px;
  border-radius: 4px;
  background: #dbeafe;
  border: 1px solid #2563eb;
  color: #2563eb;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.language-option:hover {
  background: #2563eb;
  color: white;
}

.language-option.active {
  background: #2563eb;
  color: white;
}

@media (max-width: 768px) {
  .action-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}

.long-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* أضف هذا في نهاية ملف CSS */
.system-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.system-option {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  text-align: center;
}

.system-option:hover {
  background: #e2e8f0;
}

.system-option.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}


/* ====== CSS الإضافي لإظهار المحتوى الجديد داخل explanation-section فقط ====== */

/* ============================================
   أنماط CSS للمحتوى الجديد المضاف
   ============================================ */

/* قسم المقارنة بين النظامين */
.scales-comparison-section {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc, #e0f2fe);
  border-radius: 10px;
  border: 1px solid #bae6fd;
}

.scales-comparison-section h2 {
  color: #1e40af;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-align: center;
  border-bottom: 2px solid #93c5fd;
  padding-bottom: 10px;
}

.scales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .scales-grid {
    grid-template-columns: 1fr;
  }
}

.scale-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-top: 4px solid transparent;
  transition: transform 0.3s ease;
}

.scale-card:hover {
  transform: translateY(-3px);
}

.us-scale {
  border-top-color: #2563eb;
}

.eu-scale {
  border-top-color: #8b5cf6;
}

.scale-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.scale-flag {
  font-size: 1.5rem;
}

.scale-header h3 {
  color: #1e40af;
  font-size: 1rem;
  margin: 0;
}

.scale-content {
  font-size: 0.85rem;
}

.scale-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scale-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.scale-list li:last-child {
  margin-bottom: 0;
}

.list-icon {
  font-size: 0.9rem;
  color: #2563eb;
  flex-shrink: 0;
  margin-top: 2px;
}

.scale-list li strong {
  color: #1e40af;
}

.scale-note {
  background: #fef3c7;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  border-right: 3px solid #d97706;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.note-icon {
  font-size: 1.2rem;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 2px;
}

.scale-note p {
  margin: 0;
  color: #92400e;
  font-size: 0.9rem;
}

.scale-note strong {
  color: #b45309;
}

/* قسم سعة الأرقام */
/* قسم التفاصيل */
.scales-details-section {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc, #f3e8ff);
  border-radius: 10px;
  border: 1px solid #e9d5ff;
}

.scales-details-section h2 {
  color: #7c3aed;
  font-size: 1.1rem;
  margin-bottom: 20px;
  text-align: center;
}

.scale-detail-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid #8b5cf6;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.scale-detail-card:last-child {
  margin-bottom: 0;
}

.scale-detail-card h3 {
  color: #7c3aed;
  font-size: 1rem;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.scale-detail-card p {
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.scale-detail-card p strong {
  color: #1e40af;
}

.scale-detail-card sup {
  font-size: 0.7em;
  vertical-align: super;
}

.scale-summary {
  background: #f8fafc;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  border-right: 3px solid #a78bfa;
  font-style: italic;
}

.practical-tip {
  background: linear-gradient(135deg, #fef3c7, #fef9c3);
  border-radius: 8px;
  padding: 20px;
  margin-top: 25px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  border: 1px solid #fbbf24;
}

.tip-icon {
  font-size: 1.5rem;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 2px;
}

.tip-content {
  flex: 1;
}

.tip-content h4 {
  color: #b45309;
  font-size: 1rem;
  margin-bottom: 10px;
}

.tip-content p {
  margin: 0;
  color: #92400e;
  font-size: 0.9rem;
}

/* تحسينات للاستجابة */
@media (max-width: 768px) {
  .scales-comparison-section,
  .scales-details-section {
    padding: 15px;
    margin: 20px 0;
  }
  
  .scales-grid {
    gap: 15px;
  }
  
  .scale-card {
    padding: 15px;
  }
  
  .scale-list li {
    font-size: 0.8rem;
  }
  

  .scale-detail-card {
    padding: 15px;
  }
  
  .practical-tip {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }
  
  .tip-icon {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .scale-list li {
    flex-direction: column;
    gap: 5px;
  }
  
  .scale-note {
    flex-direction: column;
    gap: 8px;
  }
  
}

/* قسم سعة الأرقام */
/* قسم سعة الأرقام */
/* ============================================
   إصلاح شامل لمشكلة التجاوز و تصميم الجدول
   ============================================ */

/* قسم سعة الأرقام - تصميم جديد */
.numbers-capacity-section {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 10px;
  border: 1px solid #86efac;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.numbers-capacity-section h2 {
  color: #059669;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-align: center;
  word-wrap: break-word;
}

.numbers-capacity-section h3 {
  color: #047857;
  font-size: 1rem;
  margin: 20px 0 15px 0;
  word-wrap: break-word;
}

.numbers-capacity-section p {
  margin-bottom: 10px;
  text-align: center;
  word-wrap: break-word;
  line-height: 1.5;
}

.capacity-highlight {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border: 2px solid #10b981;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.capacity-highlight p {
  margin-bottom: 10px;
  font-size: 0.9rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.capacity-highlight strong {
  color: #059669;
}

.capacity-conclusion {
  color: #047857;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px dashed #10b981;
  word-wrap: break-word;
}

/* حاوية الجدول - مهم جداً */

/* تحسينات للهواتف */
/* حاوية الجدول - مهم جداً */
.table-container {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  margin: 20px 0;
}

/* الجدول نفسه */
.wp-block-table table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}

.wp-block-table th {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #047857;
}

.wp-block-table td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.wp-block-table tr:nth-child(even) td {
  background: #f0fdf4;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
  .numbers-capacity-section {
    padding: 15px;
    margin: 15px 0;
  }
  
  .capacity-highlight {
    padding: 15px;
    margin: 15px 0;
  }
  
  .table-container {
    margin: 15px -16px;
    width: calc(100% + 32px);
  }
  
  .wp-block-table table {
    min-width: 500px;
  }
}

@media (max-width: 480px) {
  .table-container {
    margin: 15px -12px;
    width: calc(100% + 24px);
  }
  
  .wp-block-table table {
    min-width: 400px;
  }
}

/* تأكد من أن الجدول لا يتسبب في ظهور سكرول بار رأسي */
.explanation-section {
  overflow-x: hidden; /* لمنع التجاوز الأفقي */
  max-width: 100%;
}

/* تحسين الجدول ليكون مستجيبًا */
@media (max-width: 768px) {
  .wp-block-table table {
    min-width: 100% !important; /* بدل 600px */
    font-size: 0.8rem;
  }
  
  .wp-block-table th,
  .wp-block-table td {
    padding: 6px 8px;
  }
}

/* لمنع أي تجاوزات أخرى */
.explanation-content {
  max-width: 100%;
  overflow: hidden;
}