/* إصلاحات الجوال لمنصة KYC الكويت */

/* ضمان ظهور زر الهمبرجر على جميع الأجهزة المحمولة */
@media screen and (max-width: 900px) {
  .mobile-menu-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    position: relative;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
  }
  
  .mobile-menu-toggle span {
    display: block !important;
    width: 24px;
    height: 3px;
    background-color: #003366;
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 2px;
  }
  
  /* تأكيد إخفاء القائمة بشكل افتراضي */
  .nav-menu {
    display: none !important;
  }
  
  .nav-menu.active {
    display: block !important;
  }
}

@media screen and (max-width: 768px) {
  /* تحسين ترتيب عناصر النافبار */
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    flex-wrap: nowrap;
  }
  
  .brand-identity {
    flex: 0 0 auto;
    order: 1;
  }
  
  .nav-actions {
    flex: 0 0 auto;
    order: 2;
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 0.5rem;
  }
  
  .mobile-menu-toggle {
    flex: 0 0 auto;
    order: 3;
    display: flex !important;
  }
  
  /* تحسين القائمة المنسدلة */
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    z-index: 1001;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-links {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  
  .nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
    text-align: right;
    transition: all 0.2s ease;
  }
  
  .nav-link:hover {
    background-color: #f8fafc;
    color: #003366;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  /* إصلاح مشكلة المحتوى في قسم "من نحن" */
  .about-section {
    padding: 2rem 0;
    overflow-x: hidden;
  }
  
  .about-grid {
    display: block;
    gap: 2rem;
  }
  
  .about-content {
    width: 100%;
    padding: 0 1rem;
    margin-bottom: 2rem;
  }
  
  .about-visual {
    width: 100%;
    margin: 0 1rem;
    max-width: calc(100% - 2rem);
  }
  
  /* إصلاح النصوص الطويلة */
  .about-content .feature-list {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  
  .about-content .feature-list li {
    display: block;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f3f4f6;
  }
  
  .about-content .feature-list li:last-child {
    border-bottom: none;
  }
  
  .about-content .feature-list li strong {
    display: block;
    color: #003366;
    margin-bottom: 0.3rem;
    font-size: 1rem;
  }
  
  .about-content .feature-list li span {
    display: block;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

@media screen and (max-width: 600px) {
  /* تحسينات للشاشات الصغيرة جداً */
  .brand-identity .brand-text {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }
  
  .nav-actions .login-btn .btn-text {
    display: none;
  }
  
  .nav-actions .login-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
  
  .language-switcher {
    scale: 0.8;
  }
  
  /* تحسين المحتوى الرئيسي */
  .main-hero {
    padding: 1.5rem 0;
    min-height: auto;
  }
  
  .hero-content {
    padding: 1rem 0.5rem;
  }
  
  .hero-title {
    font-size: 1.6rem !important;
    line-height: 1.3;
  }
  
  .hero-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 1.5rem 0;
  }
  
  .stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 0.4rem;
    border-radius: 8px;
    text-align: center;
  }
  
  .stat-number {
    font-size: 1.3rem;
    color: #dfbb00;
  }
  
  .stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.3rem;
  }
  
  /* إصلاح المحتوى في قسم "من نحن" للشاشات الصغيرة */
  .about-content {
    padding: 0 0.5rem;
  }
  
  .about-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .about-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  
  .about-visual {
    margin: 0 0.5rem;
    max-width: calc(100% - 1rem);
    min-height: 180px;
    max-height: 220px;
  }
  
  /* تحسين الصور */
  .about-visual img,
  .rotating-image img {
    max-width: 100%;
    object-fit: cover;
    height: 100%;
  }
}

/* إصلاح مشاكل التداخل */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* منع التمرير الأفقي */
body {
  overflow-x: hidden;
}

/* تحسين الانتقالات */
* {
  box-sizing: border-box;
}

/* إصلاح مشاكل اللمس على الأجهزة المحمولة */
.mobile-menu-toggle,
.nav-link,
.login-btn,
.language-toggle {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* تحسين إمكانية الوصول */
.mobile-menu-toggle:focus {
  outline: 2px solid #003366;
  outline-offset: 2px;
}

/* إصلاح مشاكل Safari على iOS */
@supports (-webkit-appearance: none) {
  .nav-menu {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* إصلاحات خاصة بالمحتوى */
.container {
  max-width: 100%;
  overflow-x: hidden;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }
}

/* إصلاح مشكلة النصوص الطويلة */
.section-subtitle,
.hero-description,
.about-content p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
