/* Base Text Styles (applies to all pages) */
#intro-text,
#nav-link-1, 
#nav-link-2,
#page-title,
#kuenstler-button,
#impressum-button,
#impressum-text,
#artist-text {
  font-weight: 200;
  padding: 0 15px;
  transition: all 0.3s ease; /* Smooth language switching */
}

/* Default LTR Specific Styles */
[dir="ltr"] {
  text-align: left;
  font-family: "nimbus-sans", sans-serif;
}

/* Arabic/RTL Overrides */
[dir="rtl"] {
  unicode-bidi: embed;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  text-align: right;
}

[dir="rtl"] #intro-text,
[dir="rtl"] #nav-link-1,
[dir="rtl"] #nav-link-2 {
  line-height: 1.6;
  padding-right: 20px;
  padding-left: 0; /* Reset LTR padding */
}

[dir="rtl"] #page-title {
  margin-left: 0vw;
  margin-right: 0vw; /* Reset any default right margin */
  font-weight: 400;
}

/* Element-Specific Adjustments */
/* Only apply if elements exist on page */
.text {
  padding: 20px;
  line-height: 1.6;
}

/* Arabic Font Face (optional) */
@font-face {
  font-family: 'Tajawal';
  src: url('https://fonts.googleapis.com/css2?family=Tajawal&display=swap');
}

/* Fallback for browsers without Arabic support */
[lang="ar"] {
  font-family: 'Tajawal', 'Segoe UI', Arial, sans-serif;
}

/* Language Selector Styles - UPDATED */
.language-selector-container {
  position: relative;
  display: flex;
  align-items: center;
}

.language-options {
  display: none;
  position: absolute;
  top: 100%;
  background-color: black;
  white-space: nowrap;
  z-index: 2000;
  gap: 1vw;
  overflow-x: auto;
  scrollbar-width: none;
  scrollbar-color: #484848 black;
  inset-inline-start: 0;
  inset-inline-end: auto;
  margin-top: 0.7vh;
}

.language-options.show {
  display: flex;
}

/* Custom scrollbar */
/* .language-options::-webkit-scrollbar {
  height: 0.7rem;
} */

.language-options::-webkit-scrollbar-track {
  background: black;
}

.language-options::-webkit-scrollbar-thumb {
  background-color: #484848;
  border-radius: 1%;
}

.language-option {
  cursor: pointer;
  color: #484848;
  text-decoration: none;
  font-size: 1.3vh;
  transition: color 0.3s ease;
  flex-shrink: 0;
  display: block;
  padding: 0 12px;
}

.language-option:hover {
  color: #959595;
}

#language-selector {
  display: none;
}

@media (max-width: 768px) {
  .language-options {
    position: absolute;
    top: 100%;
    max-width: 70vw;
    padding-left: 5vw;
  }
  
  /* RTL positioning for mobile - FIXED */
  html[dir="rtl"] .language-selector-container .language-options,
  body.rtl .language-selector-container .language-options {
    right: 0 !important;
    left: auto !important;
    padding-right: 5vw;
    padding-left: 1vw;
  }
  
  .language-options.show {
    display: flex;
    gap: 5vw;
  }
}
/* ---------- Sprachfächer: Kürzel bauen sich nacheinander um den Globus auf ---------- */
.language-selector-container { position: relative; display: flex; align-items: center; }
.lang-fan { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 3000; pointer-events: none; }
.lang-chip {
  --x: 0px; --y: 0px;
  position: absolute; left: 0; top: 0;
  min-width: 2.2em; padding: 0.35em 0; text-align: center;
  font-size: 0.8rem; font-weight: 400; letter-spacing: 0.06em; line-height: 1; text-decoration: none;
  color: rgba(255, 255, 255, 0.6); text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) translate(0, 0) scale(0.3);
  transition: transform 0.38s cubic-bezier(0.55, 0, 0.8, 0.3), opacity 0.22s ease, color 0.2s ease;
  transition-delay: calc((5 - var(--i)) * 28ms);
}
.language-selector-container.open .lang-chip {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1);
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, color 0.2s ease;
  transition-delay: calc(var(--i) * 60ms);
}
.lang-chip:hover, .lang-chip.active-language { color: #fff; }
.lang-chip.active-language { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1px; }
.language-toggle { transform-origin: 50% 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.language-selector-container.open .language-toggle { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .lang-chip, .language-toggle { transition-duration: 0.01s !important; transition-delay: 0s !important; } }

@media (min-width: 1024px) { .lang-chip { font-size: 0.66rem; min-width: 2em; } }
