/* =========================================
   1. FONTS & GLOBAL RESETS
   ========================================= */
@font-face {
  font-family: 'Avenir Roman';
  src: url('/fonts/avenir-roman.woff2') format('woff2'),
       url('/fonts/avenir-roman.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Avenir Roman', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Global RTL & Mobile Overflow Fix */
html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  position: relative;
}
[dir="rtl"] body {
  margin: 0;
  padding: 0;
}


/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.main-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 2rem;
  border-bottom: 1px solid black;
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo { flex-shrink: 0; }
.logo img { margin-top: 23px; height: auto; width: 100px; }

.main-nav { flex-grow: 1; display: flex; justify-content: center; }

.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.nav-item { position: relative; }

.nav-item > a, .nav-item > p {
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0;
  display: block;
  position: relative;
  transition: color 0.3s ease;
}

/* Red underline on hover - 🌟 RTL Friendly */
.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0; /* Replaces 'left: 0' */
  width: 0;
  height: 3px;
  background-color: #ff4444;
  transition: width 0.3s ease;
}
.nav-item:hover > a::after { width: 100%; }

/* Dropdown styles */
.dropdown {
  position: absolute;
  top: 100%;
  inset-inline-start: 50%; /* Replaces 'left: 50%' */
  transform: translateX(-50%); 
  background: white;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
  list-style: none;
  margin-top: 0.5rem;
}
/* Fix transform for RTL so it centers correctly */
[dir="rtl"] .dropdown { transform: translateX(50%); }

.nav-item:hover .dropdown { opacity: 1; visibility: visible; }
.dropdown li { list-style: none; }
.dropdown li a {
  color: #333; text-decoration: none; padding: 0.5rem 1rem;
  display: block; font-size: 0.9rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.dropdown li a:hover { background: #f5f5f5; color: #ff4444; }

/* Header right section */
.header-right { display: flex; align-items: center; gap: 1.5rem; }
.donate-button { display: block; transition: transform 0.2s ease; }
.donate-button:hover { transform: scale(1.05); }
.donate-img { height: 48px; width: auto; display: block; }
.search-btn { background: none; border: none; cursor: pointer; padding: 0.5rem; color: #333; display: flex; align-items: center; justify-content: center; }

/* Mobile menu button */
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; position: relative; width: 30px; height: 30px; }
.mobile-menu-btn span { display: block; width: 100%; height: 2px; background: #333; margin: 6px 0; transition: all 0.3s ease; }


/* =========================================
   3. CUSTOM LANGUAGE DROPDOWN (CONSOLIDATED)
   ========================================= */
.lang-switcher { position: relative; display: flex; align-items: center; }

.lang-btn {
  border: none; font-weight: 600; font-size: 0.9rem;
  background: transparent; cursor: pointer; padding: 0.5rem 0;
  color: #333; display: flex; align-items: center; gap: 6px;
  transition: color 0.3s ease;
}
.lang-btn:hover, .lang-switcher.active .lang-btn { color: #ff4444; }

.lang-btn .custom-arrow {
  font-size: 0.8rem; transition: transform 0.3s ease;
  margin-inline-start: 4px; /* 🌟 RTL MAGIC */
}
.lang-switcher.active .lang-btn .custom-arrow { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute; top: 100%;
  inset-inline-start: 50%; /* Replaces 'left: 50%' */
  transform: translateX(-50%);
  background: white; border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 120px; z-index: 200;
  padding: 0.5rem 0; list-style: none; margin-top: 0.5rem;
  opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
[dir="rtl"] .lang-dropdown { transform: translateX(50%); }

.lang-switcher.active .lang-dropdown { opacity: 1; visibility: visible; }

.lang-dropdown li a {
  color: #333; text-decoration: none; padding: 0.5rem 1rem;
  display: block; font-size: 0.9rem; font-weight: 600; text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lang-dropdown li a:hover { background: #f5f5f5; color: #ff4444; }
.lang-dropdown li a.active { background: #f5f5f5; color: #ff4444; }


/* =========================================
   4. FOOTER
   ========================================= */
.main-footer { background-color: #004466; color: white; padding: 2rem 0 0; margin-top: auto; }

.footer-container {
  max-width: 100%; margin: 0 auto; padding: 0 2rem;
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 2rem; align-items: start;
}

.footer-logo { text-align: center; }
.logo-img { max-width: 150px; height: auto; }
.footer-section { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.footer-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; text-transform: uppercase; }
.footer-section p { font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Newsletter */
.newsletter-form { display: flex; gap: 0.5rem; margin-top: 0; }
.newsletter-form input { flex-grow: 1; padding: 0.5rem; border: none; border-bottom: 1px solid white; background: transparent; color: white; }
.newsletter-form input::placeholder { color: rgba(255, 255, 255, 0.7); }
.submit-arrow { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; transition: transform 0.3s ease; }
.submit-arrow:hover { transform: translateX(5px); }
[dir="rtl"] .submit-arrow:hover { transform: translateX(-5px); } /* 🌟 RTL MAGIC */

/* Donate & Social */
.donate-section { margin: 1rem 0; }
.donate-link { color: white; text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.donate-icon { color: #ff4444; }
.social-links { display: flex; flex-direction: column; gap: 0.5rem; }
.social-links a { color: white; text-decoration: none; font-size: 0.9rem; }
.social-links a:hover { text-decoration: underline; }

/* Partners */
.partner-logos { display: contents; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; }
.partner-logos img { max-width: 50%; height: auto; }

/* Copyright */
.copyright-bar { background-color: #e6503e; color: white; text-align: center; padding: 1rem; margin-top: 2rem; border-top: 1px solid black; }

/* Virtual Tour in Footer */
.virtual-tour-section { display: flex; flex-direction: column; align-items: flex-start; }
.virtual-tour-section h3 { margin: 0; white-space: nowrap; font-size: 1rem; }

.tour-link { display: inline-block; text-decoration: none; position: relative; }
.tour-badge {
  width: clamp(120px, 12vw, 180px); aspect-ratio: 1 / 1;
  position: relative; display: grid; place-items: center; margin-top: 8px;
  max-width: 220px;
}
.tour-ring { width: 100%; height: 100%; display: block; overflow: visible; animation: tour-spin 10s linear infinite; }
.tour-ring text { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; fill: #fff; }
.tour-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(28px, 3vw, 40px); line-height: 1; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.35); pointer-events: none; }
.tour-link:hover .tour-play { transform: scale(1.05); }

/* Adjust badge position - 🌟 RTL MAGIC */
.footer-section .tour-badge { transform: translate(-30px, -35px); }
[dir="rtl"] .footer-section .tour-badge { transform: translate(30px, -35px); } 

@keyframes tour-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }


/* =========================================
   5. MAIN CONTENT & MISC
   ========================================= */
.main-content { flex-grow: 1; padding: 2rem; max-width: 1280px; margin: 0 auto; width: 100%; }
.terms-link { display: inline-block; margin-bottom: 1rem; color: inherit; text-decoration: none; }
.terms-link strong { font-weight: 700; }
.terms-link:hover strong { text-decoration: underline; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; }


/* =========================================
   6. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1024px) {
  .nav-list { gap: 2rem; }
  .header-container { padding: 0 1rem; }
  .footer-container { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }

  .nav-list {
    position: absolute; top: 80px;
    inset-inline-start: 0; /* 🌟 RTL MAGIC */
    inset-inline-end: 0;   /* 🌟 RTL MAGIC */
    background: white; flex-direction: column;
    padding: 1rem; gap: 0; display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  .nav-list.active { display: block; }
  .nav-item { margin: 0; }
  .nav-item > a { padding: 1rem; }
  .nav-item > a::after { display: none; }

  .dropdown {
    position: static; transform: none; box-shadow: none;
    opacity: 1; visibility: visible; display: none;
    background: #f5f5f5; margin-top: 0;
  }
  .nav-item:hover .dropdown { display: block; }

  .mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
  .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

  .header-right { display: none; }
  .footer-container { grid-template-columns: repeat(2, 1fr); }
  .virtual-tour-button { justify-content: center; }
  
  /* Reset tour badge nudge on mobile so it doesn't overflow */
  .footer-section .tour-badge { transform: translate(0, 0); margin-top: 1rem; }
}

@media (max-width: 640px) {
  .footer-container { grid-template-columns: 1fr; }
  .footer-logo { margin-bottom: 2rem; }
  .partner-logos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .tour-badge { width: 140px; }
}

/* =========================================
   FIX: FontAwesome Icons Showing as Squares
   ========================================= */
i.fas, i.fa-solid, i.far, i.fab, .custom-arrow {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

/* If you use brand icons (like Instagram/Facebook), they need a different font family */
i.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}