/* Shared Layout Styles - Top Bar, Navigation, Footer */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Alexandria', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F8FAFB;
    color: #101727;
    direction: ltr;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 0 !important;
}

body.ar {
    direction: rtl;
}

/* Container */
.container {
    max-width: 1880px;
    margin: 0 auto;
    background-color: #F8FAFB;
}

/* Sticky Header Containers */
#top-bar-container,
#nav-bar-container {
    position: -webkit-sticky;
    position: sticky;
    background-color: inherit;
    -webkit-transform: translateZ(0); /* iOS fix */
    transform: translateZ(0);
}

#top-bar-container {
    top: 0;
    z-index: 1000;
}

#nav-bar-container {
    top: 26px;
    z-index: 999;
}

/* Top Bar - Sticky */
.top-bar {
    width: 100%;
    height: 26px;
    background-color: #F8FAFB;
}

.top-bar-wrapper {
    height: 25px;
    border-bottom: 1px solid #E5E7EB;
    background-color: #F8FAFB;
}

.top-bar-content {
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* في الإنجليزي: Top Bar على اليمين فوق القائمة */
    direction: ltr;
    padding-bottom: 1px;
    padding-left: 192px;
    padding-right: 192px;
}

body.ar .top-bar-content {
    justify-content: flex-start; /* في العربي: Top Bar على اليسار فوق القائمة */
}

.top-bar-items {
    display: flex;
    align-items: center;
    gap: 24px;
    direction: ltr;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #495565;
    font-size: 12px !important;
    font-weight: 400;
    font-family: 'Alexandria', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 14px;
    line-height: 1.0;
    transition: color 0.2s ease;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    flex-direction: row;
}

body.ar .top-bar-item {
    flex-direction: row-reverse;
}

.top-bar-item:hover {
    color: #C62030;
}

.top-bar-item svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

/* Navigation Bar */
/* Navigation Bar - Sticky */
.nav-bar {
    width: 100%;
    height: 70px;
    background-color: white;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.nav-content {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: ltr;
    padding-left: 192px;
    padding-right: 192px;
    flex-direction: row; /* الإنجليزي: اللوقو يسار، القائمة يمين */
}

/* في العربي: نعكس - اللوقو يمين والقائمة يسار */
body.ar .nav-content {
    direction: ltr;
    flex-direction: row-reverse;
}

.nav-logo {
    width: 144px;
    height: 59px;
}

.nav-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    direction: ltr; /* الإنجليزي: Home على اليسار من القائمة */
}

/* في العربي: القائمة على اليسار والرئيسية تبدأ من اليمين */
body.ar .nav-menu {
    direction: rtl;
}

.nav-item {
    color: #495565;
    font-size: 13.1px;
    font-weight: 400;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.53;
}

.nav-item:hover,
.nav-item.active {
    color: #101727;
}

.nav-item::after {
    content: '';
    width: 40px;
    height: 2px;
    background-color: transparent;
    margin-top: 4px;
    transition: background-color 0.2s ease;
}

.nav-item.active::after {
    background-color: #C62030;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    overscroll-behavior: contain;
}

/* Custom scrollbar for dropdown */
.dropdown-content::-webkit-scrollbar {
    width: 8px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #C62030;
    border-radius: 4px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #A01828;
}

body.ar .dropdown-content {
    right: auto;
    left: 0;
}

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

/* Prevent page scroll when scrolling dropdown */
.has-dropdown:hover {
    position: relative;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #101727;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid #f1f1f1;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #FFF5F5;
    color: #C62030;
}

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

/* Footer */
.footer {
    background-color: #1A1A1A;
    color: white;
    padding: 48px 192px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-about h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.footer-about p {
    font-size: 13px;
    color: #9CA3AF;
    margin-bottom: 8px;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
}

.footer-link {
    display: block;
    color: #D1D5DB;
    font-size: 13px;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    color: #6B7280;
    font-size: 12px;
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-bottom-links li {
    color: #6B7280;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1199px) {
    .top-bar-content,
    .nav-content,
    .footer {
        padding-left: calc(10% - 8px);
        padding-right: calc(10% - 8px);
    }
}

@media (max-width: 899px) {
    .top-bar-content,
    .nav-content,
    .footer {
        padding-left: 52px;
        padding-right: 52px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 599px) {
    .top-bar-content,
    .nav-content,
    .footer {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .top-bar-items {
        gap: 16px;
    }
    
    .top-bar-item span:not(.language-item span) {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}


/* Footer CTA Section (Red) - نفس Flutter بالضبط */
.footer-cta {
    width: 100%;
    background-color: #C62030; /* AppColors.primary */
    padding: 28px calc(10% - 8px);
    text-align: center;
}

.footer-cta-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-cta-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 10px;
}

.footer-cta-icon svg {
    width: 100%;
    height: 100%;
    fill: white;
}

.footer-cta-title {
    color: white;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 4px 0;
    text-align: center;
}

.footer-cta-subtitle {
    color: white;
    font-size: 11px;
    font-weight: 300;
    line-height: 1.5;
    margin: 0 0 14px 0;
    text-align: center;
}

.footer-cta-button {
    display: inline-block;
    background-color: white;
    color: #C62030;
    font-size: 12px;
    font-weight: 500;
    padding: 9px 24px;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.footer-cta-button:hover {
    opacity: 0.9;
}

/* Arabic RTL Support for CTA */
body.ar .footer-cta-content {
    direction: rtl;
}

/* Mobile Responsive for CTA */
@media (max-width: 599px) {
    .footer-cta {
        padding: 28px 24px;
    }
}


/* Mobile Menu Toggle Button - Hidden by default */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #1F2937;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Menu - Inline Dropdown */
.mobile-menu {
    display: none;
    background-color: white;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    display: block;
    max-height: 500px;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

.mobile-nav-item {
    padding: 16px 20px;
    color: #1F2937;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #F3F4F6;
    transition: background-color 0.2s;
}

.mobile-nav-item:hover {
    background-color: #F9FAFB;
}

.mobile-nav-item.active {
    color: #C62030;
    background-color: rgba(198, 32, 48, 0.05);
    border-left: 4px solid #C62030;
}

body.ar .mobile-nav-item.active {
    border-left: none;
    border-right: 4px solid #C62030;
}

/* Show mobile menu toggle on mobile and hide desktop menu */
@media (max-width: 899px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .nav-menu {
        display: none !important;
    }
    
    .nav-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Hide mobile menu toggle on desktop and show desktop menu */
@media (min-width: 900px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
    }
    
    .mobile-menu {
        display: none !important;
    }
}


/* Dropdown Menu Styles */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.nav-item-dropdown .nav-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    max-height: 500px;
    overflow-y: auto;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overscroll-behavior: contain;
}

/* Custom scrollbar for dropdown */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: #C62030;
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #A01828;
}

body.ar .dropdown-menu {
    left: auto;
    right: 0;
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #495565;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: #F9FAFB;
    color: #C62030;
    padding-left: 24px;
}

body.ar .dropdown-item:hover {
    padding-left: 20px;
    padding-right: 24px;
}

/* Hide dropdown on mobile */
@media (max-width: 899px) {
    .dropdown-menu {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Search Dropdown Styles - SIMPLE VERSION (CENTERED)
   ═══════════════════════════════════════════════════════════════════════════ */

.search-dropdown {
  position: fixed;
  background: white;
  border-radius: 16px;
  width: 600px;
  max-height: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 10000 !important;
  overflow: hidden;
  animation: dropdownFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #F3F4F6;
}

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

.search-header::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, #C62030 0%, #E53935 100%);
  border-radius: 2px;
}

.search-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #F9FAFB;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  padding: 0;
  color: #6B7280;
}

.search-close-btn:hover {
  background: #C62030;
  color: white;
  transform: rotate(90deg);
}

.search-close-btn svg {
  width: 20px;
  height: 20px;
}

.search-input-wrapper {
  position: relative;
  padding: 0 24px 16px;
}

.search-input-icon {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(calc(-50% - 8px));
  width: 20px;
  height: 20px;
  color: #9CA3AF;
  pointer-events: none;
}

[dir="rtl"] .search-input-icon {
  left: auto;
  right: 40px;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  background: #F9FAFB;
  transition: all 0.2s;
  color: #111827;
}

[dir="rtl"] .search-input {
  padding: 14px 48px 14px 16px;
}

.search-input:focus {
  border-color: #C62030;
  background: white;
  box-shadow: 0 0 0 4px rgba(198, 32, 48, 0.1);
}

.search-input::placeholder {
  color: #9CA3AF;
}

.search-results {
  max-height: 480px;
  overflow-y: auto;
  direction: inherit;
  padding: 8px;
}

/* Custom Scrollbar */
.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: #F9FAFB;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #C62030;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #A51C28;
}

.search-empty,
.search-loading {
  padding: 60px 20px;
  text-align: center;
  color: #9CA3AF;
  font-size: 14px;
  direction: inherit;
}

.search-result {
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  direction: inherit;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.search-result:hover {
  background: linear-gradient(135deg, #FFF5F7 0%, #FFEBEF 100%);
  border-color: rgba(198, 32, 48, 0.2);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(198, 32, 48, 0.1);
}

[dir="rtl"] .search-result:hover {
  transform: translateX(-4px);
}

.search-result-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  direction: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #C62030;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-result-desc {
  font-size: 13px;
  color: #6B7280;
  direction: inherit;
  line-height: 1.5;
  padding-left: 14px;
}

[dir="rtl"] .search-result-desc {
  padding-left: 0;
  padding-right: 14px;
}

/* RTL Support */
[dir="rtl"] .search-input {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .search-result {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .search-result-title {
  text-align: right;
  direction: rtl;
  flex-direction: row-reverse;
}

[dir="rtl"] .search-result-desc {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .search-empty,
[dir="rtl"] .search-loading {
  text-align: right;
  direction: rtl;
}

/* Mobile */
@media (max-width: 599px) {
  .search-dropdown {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    border-radius: 12px;
  }
  
  .search-header {
    padding: 16px 20px 12px;
  }
  
  .search-input-wrapper {
    padding: 0 20px 12px;
  }
  
  .search-input {
    font-size: 14px;
    padding: 12px 14px 12px 44px;
  }
  
  [dir="rtl"] .search-input {
    padding: 12px 44px 12px 14px;
  }
  
  .search-results {
    max-height: calc(100vh - 240px);
  }
  
  /* Force RTL alignment on mobile */
  [dir="rtl"] .search-input {
    text-align: right !important;
    direction: rtl !important;
  }
  
  [dir="rtl"] .search-result {
    text-align: right !important;
    direction: rtl !important;
  }
  
  [dir="rtl"] .search-result-title {
    text-align: right !important;
    direction: rtl !important;
  }
  
  [dir="rtl"] .search-result-desc {
    text-align: right !important;
    direction: rtl !important;
  }
  
  [dir="rtl"] .search-empty,
  [dir="rtl"] .search-loading {
    text-align: right !important;
    direction: rtl !important;
  }
  
  @keyframes dropdownFadeIn {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
}



/* ═══════════════════════════════════════════════════════════════════════════
   Contact Section Highlight Animation
   ═══════════════════════════════════════════════════════════════════════════ */

.highlight-pulse {
  animation: pulseGlow 3s ease-in-out;
  border-radius: 8px;
  padding: 16px;
  margin: -16px;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(198, 32, 48, 0);
    background-color: transparent;
  }
  10% {
    box-shadow: 0 0 0 8px rgba(198, 32, 48, 0.4),
                0 0 20px 12px rgba(198, 32, 48, 0.3);
    background-color: rgba(198, 32, 48, 0.1);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(198, 32, 48, 0.2),
                0 0 30px 16px rgba(198, 32, 48, 0.2);
    background-color: rgba(198, 32, 48, 0.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(198, 32, 48, 0);
    background-color: transparent;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Q4 Widget Styling Overrides - Company Overview & History Headers
   ═══════════════════════════════════════════════════════════════════════════ */

/* Target the Company Overview and Company History section headers in Q4 widgets */
.module-content h3,
.module-content h4,
.q4-module h3,
.q4-module h4,
[class*="company-overview"] h3,
[class*="company-history"] h3,
[class*="CompanyOverview"] h3,
[class*="CompanyHistory"] h3 {
  font-weight: 700 !important;
  font-size: 18px !important;
}

/* More specific targeting for Q4 widget headers */
iframe[src*="q4"] + * h3,
iframe[src*="q4web"] + * h3,
.widget-container h3,
.ir-widget h3 {
  font-weight: 700 !important;
  font-size: 18px !important;
}

/* Target any heading that contains "Company overview" or "Company History" text */
h3:has-text("Company overview"),
h3:has-text("Company Overview"),
h3:has-text("Company History"),
h4:has-text("Company overview"),
h4:has-text("Company Overview"),
h4:has-text("Company History") {
  font-weight: 700 !important;
  font-size: 18px !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Arabic Pages - Use Western (English) Numerals
   ═══════════════════════════════════════════════════════════════════════════ */

html[lang="ar"],
html[lang="ar"] *,
[dir="rtl"],
[dir="rtl"] * {
    font-variant-numeric: lining-nums;
}

/* Force Western numerals for all Arabic pages */
html[lang="ar"] {
    -webkit-font-feature-settings: "numr" 0;
    font-feature-settings: "numr" 0;
}
