@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@900&display=swap');

/* Form elements override for normalize.css */
button, input, optgroup, select, textarea {
    font-family: sans-serif;
    font-size: 48%;
    line-height: 1.15;
    margin: 0;
}

body, html {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #ddd;
  font-family: 'Montserrat', sans-serif;
  font-size: calc(24px + 3vw); /* Responsive font size */
  text-align: center;
}

/* Only apply absolute positioning to divs within .main, not globally */
.main div,
.scrollDist {
  position: absolute;
}

/* Language Selector Styles */
.language-selector {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.lang-btn {
  padding: 10px 24px;
  border-radius: 28px;
  position: relative;
  isolation: isolate;
  box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.lang-btn:focus {
  outline: none;
}

/* Inner glass layer - very transparent to show sky */
.lang-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 28px;
  box-shadow: inset 0 0 13px -5px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Outer distortion layer */
.lang-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 30px;
  background: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.6;
}

/* Text layer */
.lang-btn > span {
  position: relative;
  z-index: 1;
  color: #ffffff;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

/* Hover state - slightly more visible */
.lang-btn:hover::before {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 
    inset 0 0 15px -3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

.lang-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0px 12px 40px rgba(0, 0, 0, 0.25),
    0 0 20px rgba(255, 255, 255, 0.15);
}

.lang-btn:hover::after {
  opacity: 0.8;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

/* Active state - subtle blue tint while keeping sky visible */
.lang-btn.active::before {
  background-color: rgba(90, 158, 201, 0.18);
  border-color: rgba(90, 158, 201, 0.5);
  box-shadow: 
    inset 0 0 15px -3px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 30px rgba(90, 158, 201, 0.15);
  animation: icy-pulse 3s ease-in-out infinite;
}

.lang-btn.active {
  box-shadow: 
    0px 8px 32px rgba(90, 158, 201, 0.35),
    0 0 25px rgba(90, 158, 201, 0.3),
    0 0 40px rgba(90, 158, 201, 0.15);
}

.lang-btn.active::after {
  background: radial-gradient(circle at center, rgba(90, 158, 201, 0.12) 0%, transparent 70%);
  opacity: 1;
}

@keyframes icy-pulse {
  0%, 100% {
    box-shadow: 
      inset 0 0 15px -3px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      inset 0 -1px 0 rgba(255, 255, 255, 0.2),
      inset 0 0 30px rgba(90, 158, 201, 0.15);
  }
  50% {
    box-shadow: 
      inset 0 0 18px -3px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.3),
      inset 0 0 40px rgba(90, 158, 201, 0.25);
  }
}

/* Hamburger Menu Styles */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 9999; /* Ensure it's above everything */
  pointer-events: none; /* Let clicks pass through to elements below */
}

.hamburger-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
}

.hamburger-icon {
  width: 40px;
  height: 30px;
  position: relative;
  cursor: pointer;
  display: inline-block;
  z-index: 1002;
  transition: transform 0.3s ease;
  pointer-events: auto; /* Ensure the hamburger icon is clickable */
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 4px;
  width: 100%;
  background: #fff;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2) {
  top: 13px;
}

.hamburger-icon span:nth-child(3) {
  top: 26px;
}

.hamburger-icon.open span:nth-child(1) {
  top: 13px;
  transform: rotate(135deg);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger-icon.open span:nth-child(3) {
  top: 13px;
  transform: rotate(-135deg);
}

.menu-items {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  transition: right 0.3s ease;
  padding: 80px 0 0 0;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  pointer-events: none;
}

.menu-items.open {
  right: 0;
  pointer-events: all;
}

.menu-items ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-items ul li {
  padding: 15px 0;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.3s ease forwards;
  animation-delay: calc(0.1s * var(--i, 0));
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-items ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 24px;
  display: block;
  text-align: center;
  transition: color 0.3s ease, transform 0.3s ease;
  padding: 10px;
}

/* Hide all language spans initially */
.menu-items span {
  display: none;
}

/* Show English by default */
.menu-items .en {
  display: inline;
  font-family: 'Montserrat', sans-serif;
}

/* Show Arabic when Arabic is selected */
body[data-lang="ar"] .menu-items .en {
  display: none;
}

body[data-lang="ar"] .menu-items .ar {
  display: inline;
  font-family: 'Tajawal', 'Arabic Typesetting', 'Traditional Arabic', Arial, sans-serif;
}

/* Show Farsi when Farsi is selected */
body[data-lang="fa"] .menu-items .en {
  display: none;
}

body[data-lang="fa"] .menu-items .fa {
  display: inline;
  font-family: 'Vazirmatn', 'Tahoma', 'Iranian Sans', Arial, sans-serif;
}

/* RTL text alignment for Arabic and Farsi in menu */
body[data-lang="ar"] .menu-items,
body[data-lang="fa"] .menu-items {
  text-align: right;
}

.menu-items ul li a:hover {
  color: #87CEEB;
  transform: translateX(5px);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .hamburger-icon {
    width: 30px;
    height: 24px;
    top: 15px;
    right: 15px;
  }
  
  .hamburger-icon span:nth-child(2) {
    top: 10px;
  }
  
  .hamburger-icon span:nth-child(3) {
    top: 20px;
  }
  
  .hamburger-icon.open span:nth-child(1) {
    top: 10px;
  }
  
  .hamburger-icon.open span:nth-child(3) {
    top: 10px;
  }

  .menu-items {
    width: 100%;
    max-width: none;
  }
  
  .menu-items ul li a {
    font-size: 18px;
  }
}

/* Menu overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.main {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed !important; /* Ensure position is maintained */
  top: 0;
  left: 0;
  z-index: 1; /* Lower than content */
}

.main svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ensure sky image has more visible area at the top */
.sky {
  transform-origin: center center; /* Anchor at center */
  transform: scale(1.3) translateY(0); /* More balanced scaling */
  opacity: 1; /* Ensure sky is fully visible */
}

/* Position clouds much lower to reveal more sky */
.cloud1 {
  transform: translateY(250px); /* Move cloud1 significantly down */
}

.cloud2 {
  transform: translateY(300px); /* Move cloud2 significantly down */
}

.cloud3 {
  transform: translateY(350px); /* Move cloud3 significantly down */
}

/* Push mountains down to create more sky space */
.mountBg {
  transform: translateY(150px); /* Adjusted for taller height (1090px) */
}

.mountMg {
  transform: translateY(200px); /* Adjusted for different dimensions */
}

.mountFg {
  transform: translateY(300px); /* Push mountains way down */
}

/* White background below clouds to hide PADRA and mountains */
.white-cloud-bg {
  transform: translateY(350px); /* Position well below clouds */
  opacity: 1;
}

/* Responsive SVG text sizing and positioning */
svg text {
    font-size: 5vw;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.4));
}

/* Style for the SVG text elements */
.explore-text, .further-text {
  dominant-baseline: middle;
}

/* Enhanced styling for PADRA */
.explore-text {
  font-family: 'Montserrat', sans-serif;
  filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.5)); /* Stronger shadow for white text */
  /* Opacity controlled by GSAP animation */
}

/* Enhanced styling for TRADE */
.further-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  filter: drop-shadow(0px 2px 6px rgba(0,0,0,0.3)); /* Add shadow for better contrast */
}

/* Position the arrow button in the center */
.arrow {
  transform-origin: center;
  transition: transform 0.3s ease;
  cursor: pointer; /* Ensure cursor indicates it's clickable */
  pointer-events: all; /* Ensure it can be interacted with */
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.7)); /* Enhanced shadow for better visibility */
  stroke: #000; /* Add outline for better contrast */
  stroke-width: 1px;
}

/* Default styling for desktop arrow */
.desktop-arrow {
  transform: translate(0, 340px);
  fill: white; /* Ensure fill color is white */
}

/* Hide mobile arrow by default */
.mobile-arrow {
  display: none;
  stroke-width: 2px; /* Thicker outline for mobile */
  fill: white; /* Ensure fill color is white */
}

/* HTML arrow buttons for reliable scrolling - styled to look like arrows */
#html-desktop-arrow {
  position: fixed;
  width: 30px;
  height: 30px;
  border-style: solid;
  border-color: white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  top: 320px;
  left: 50%;
  margin-left: -15px;
  cursor: pointer;
  z-index: 1000;
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.7));
  animation: pulse 1.5s infinite ease-in-out;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#html-desktop-arrow.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#html-mobile-arrow {
  position: fixed;
  width: 40px;
  height: 40px;
  border-style: solid;
  border-color: white;
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
  bottom: 100px;
  left: 50%;
  margin-left: -20px;
  cursor: pointer;
  z-index: 1000;
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.7));
  animation: pulse 1.5s infinite ease-in-out;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  max-height: 100vh; /* Ensure it stays within viewport */
}

#html-mobile-arrow.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Pulse animation for arrows */
@keyframes pulse {
  0% {
    transform: rotate(45deg) scale(1);
    opacity: 1;
  }
  50% {
    transform: rotate(45deg) scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: rotate(45deg) scale(1);
    opacity: 1;
  }
}

/* Additional adjustment for better sky visibility */
.scrollDist {
  margin-top: 0; /* Reset margin to prevent layout issues */
  position: absolute !important; /* Ensure position is maintained */
  z-index: 1; /* Lower than the navigation */
}

/* Improve layer visibility and arrangement */
svg image.sky {
  z-index: 0; /* Bottom layer */
  width: 0%; /* Make sky wider than viewport */
  height: 0%; /* Maintain height */
  x: -0%; /* Center the widened sky */
}
/* Adjust mountains for new dimensions */
svg image.mountBg {
  z-index: 2;
  width: 120%; /* Slightly wider to cover entire width */
  x: -10%; /* Center the image */
  object-fit: cover; /* CSS equivalent of preserveAspectRatio */
}

svg image.mountMg {
  z-index: 3;
  width: 110%; /* Ensure it covers the viewport width */
  x: -5%; /* Center the image */
  object-fit: cover; /* CSS equivalent of preserveAspectRatio */
}

svg image.mountFg {
  z-index: 5;
}

svg image.cloud1 {
  z-index: 6; /* Top layer cloud */
}

svg image.cloud2 {
  z-index: 1; /* Behind mountains */
}

svg image.cloud3 {
  z-index: 4; /* Between mountains */
}

/* Media queries for different device sizes */
@media screen and (min-width: 481px) {
  /* Show desktop HTML arrow on larger screens */
  #html-desktop-arrow {
    display: block;
  }
  
  #html-mobile-arrow {
    display: none;
  }
}

/* iPad Pro and larger tablets (portrait and landscape) */
@media screen and (min-width: 769px) and (max-width: 1366px) {
  body, html {
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  
  .main {
    width: 100vw;
    height: 100vh;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
  }
  
  .main svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .language-selector {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .hamburger-menu {
    right: 20px;
  }
}

@media screen and (max-width: 768px) {
  body, html {
    font-size: calc(20px + 2vw);
  }
  
  svg text {
    font-size: 10vw; /* Larger text on tablets */
  }
  
  /* Adjust arrow position for tablets */
  .arrow {
    transform: scale(0.8);
  }
  
  /* Slightly lower clouds for tablets to reveal mountains */
  .cloud1 {
    transform: translateY(300px);
    opacity: 0.85; /* Add some transparency */
  }
  
  .cloud2 {
    transform: translateY(350px);
    opacity: 0.85; /* Add some transparency */
  }
  
  .cloud3 {
    transform: translateY(400px);
    opacity: 0.85; /* Add some transparency */
  }
  
  /* Move mountains up slightly to make them more visible */
  .mountBg {
    transform: translateY(80px); /* Adjusted for new height */
    width: 130% !important; /* Make wider on tablet */
    x: -15% !important; /* Center the wider image */
  }
  
  .mountMg {
    transform: translateY(120px); /* Adjusted for dimensions */
    width: 120% !important; /* Make wider on tablet */
    x: -10% !important; /* Center the wider image */
  }
  
  .mountFg {
    transform: translateY(220px);
  }
}

@media screen and (max-width: 580px) {
  body, html {
    font-size: calc(16px + 2vw);
  }
  
  svg text {
    font-size: 13vw; /* Even larger text on mobile */
    letter-spacing: 0.03em; /* Slightly adjust letter spacing for mobile */
  }
  
  /* Hide desktop arrow and show mobile arrow on mobile */
  .desktop-arrow {
    display: none;
  }
  
  .mobile-arrow {
    display: block;
    fill: #ffffff !important; /* Ensure the arrow is white and visible */
    stroke: #000000; /* Add a stroke for better visibility */
    stroke-width: 2px;
    opacity: 1 !important; /* Force visibility */
    filter: drop-shadow(0px 2px 3px rgba(0,0,0,0.7)); /* Add shadow for better visibility */
    transform: scale(1.5) !important; /* Make arrow larger */
  }
  
  /* Show mobile HTML arrow on mobile */
  #html-desktop-arrow {
    display: none;
  }
  
  #html-mobile-arrow {
    display: block;
  }
  
  /* Make the mobile arrow button visible for debugging */
  #mobileArrowBtn {
    pointer-events: all; /* Ensure clickability */
  }
  
  /* Language selector responsive for mobile */
  .language-selector {
    top: 70px;
    gap: 10px;
  }
  
  .lang-btn {
    padding: 8px 18px;
    font-size: 11px;
    border-radius: 20px;
    letter-spacing: 0.3px;
  }
  
  .lang-btn:hover {
    transform: translateY(-2px) scale(1.03);
  }
  
  /* Make PADRA fade from full opacity on mobile - let animation control it */
  .explore-text {
    /* Opacity controlled by GSAP animation */
    filter: drop-shadow(0px 4px 15px rgba(0,0,0,0.6));
  }
  
  /* Make TRADE much more visible on mobile */
  .further-text {
    font-size: 13vw !important; /* Even larger on mobile */
    font-weight: 900 !important;
    fill: #000000 !important; /* Pure black for maximum visibility */
    filter: drop-shadow(0px 4px 12px rgba(0,0,0,0.5)) !important; /* Stronger shadow */
    letter-spacing: 0.08em !important; /* More letter spacing */
    opacity: 1 !important; /* Ensure full opacity */
  }
  
  /* Hide desktop arrow button on mobile */
  #arrowBtn {
    display: none !important;
  }
  
  /* Mobile arrow is handled above */
  
  /* Enhance mineral/mountain visibility on mobile */
  svg image.mountBg, svg image.mountMg, svg image.mountFg {
    filter: brightness(1.1) contrast(1.05); /* Make mountains pop more */
  }
  
  /* Lower clouds further for mobile to reveal more mountains */
  .cloud1 {
    transform: translateY(350px);
    opacity: 0.8; /* More transparency to see mountains through */
  }
  
  .cloud2 {
    transform: translateY(400px);
    opacity: 0.8; /* More transparency to see mountains through */
  }
  
  .cloud3 {
    transform: translateY(450px);
    opacity: 0.8; /* More transparency to see mountains through */
  }
  
  /* Move mountains up further on mobile to increase visibility */
  .mountBg {
    transform: translateY(0px); /* Adjusted for new height of 1090px */
    width: 100% !important; /* Make wider on mobile */
  
    x: -0% !important; /* Center the wider image */
    
  }
  
  .mountMg {
    transform: translateY(60px); /* Adjusted for dimensions */
    width: 100% !important; /* Make wider on mobile */
    x: -15% !important; /* Center the wider image */
  }
  
  .mountFg {
    transform: translateY(170px); /* Keep as is */
  }
}