/* hide horizontal scrollbar without disabling scroll */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none; /* IE & Edge */
  scrollbar-width: none; /* Firefox */
}

/* Collapse transition */
/* Collapse transition */
/* Custom footer accordion */
.footer-accordion-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

/* Plus icon rotation */
.plus-icon {
  transition: transform 0.3s ease;
  font-size: 1.25rem;
}

.plus-icon.rotate-45 {
  transform: rotate(45deg);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .mobile-accordion-section {
    border-bottom: 1px solid #e5e7eb;
  }

  .mobile-accordion-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1rem;
  }

  .desktop-only {
    display: none !important;
  }

  /* Hide accordion content on mobile by default */
  .footer-accordion-content {
    max-height: 0;
  }

  .footer-accordion-content.open {
    max-height: 500px;
  }
}

@media (min-width: 769px) {
  .mobile-accordion-section {
    display: block !important;
  }

  .mobile-accordion-button {
    display: none !important;
  }

  .footer-accordion-content {
    display: block !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

.logo-light {
  font-weight: 300;
}

.logo-bold {
  font-weight: 700;
}

/* --- Header Transitions --- */
#header-wrapper {
  transition: background-color 0.3s ease, color 0.3s ease;

  /* 1. MOBILE DEFAULT: Black Background, White Text */
  background-color: black;
  color: white;
}

/* 2. MOBILE HAMBURGER: Always White (to show on black bg) */
#mobile-menu-open-btn {
  color: white;
  transition: color 0.3s ease;
}

/* 3. DESKTOP LOGIC (Only applies to screens wider than 768px) */
@media (min-width: 768px) {
  /* Desktop Initial State: Transparent */
  #header-wrapper {
    background-color: transparent;
    color: black;
  }

  /* Desktop Scrolled State: Black */
  #header-wrapper.scrolled {
    background-color: black;
    color: white;
  }

  /* Desktop Hamburger Color Logic */
  #mobile-menu-open-btn {
    color: black;
  }

  #header-wrapper.scrolled #mobile-menu-open-btn {
    color: white;
  }

  /* Desktop Nav Hover Logic */
  .nav-item {
    transition: color 0.3s ease;
  }

  #header-wrapper.scrolled .nav-item:hover {
    color: #e5e7eb;
  }

  /* Desktop Utility Icons Logic */
  .utility-icon {
    transition: stroke 0.3s ease;
    stroke: black;
  }

  #header-wrapper.scrolled .utility-icon {
    stroke: white;
  }
}

/* Animated Bottom Line */
.nav-item span {
  position: relative;
  display: inline-block;
}

.nav-item span::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 0%;
  height: 4px;
  background-color: #ffb100;
  transition: width 0.3s ease-in-out;
  margin-top: 2px;
}

.nav-item:hover span::before,
.nav-item.active span::before {
  width: 100%;
}

/* Overlays */
#mega-menu,
#lang-dropdown {
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

#search-overlay {
  transition: visibility 0s linear 0.2s, opacity 0.2s linear;
}

#search-overlay.visible {
  transition-delay: 0s;
}

#search-panel-wrapper {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease-out;
  transform: translateY(-20px);
  opacity: 0;
}

#search-overlay.visible #search-panel-wrapper {
  transform: translateY(0);
  opacity: 1;
}

#mobile-menu-overlay {
  transition: transform 0.3s ease-in-out;
  background-color: black;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.accordion-content {
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.accordion-content.open {
  max-height: 1000px;
  opacity: 1;
}

.accordion-btn > svg {
  transition: transform 0.3s ease-in-out;
}

.accordion-btn.open > svg {
  transform: rotate(90deg);
}

.accordion-btn.open {
  background-color: #1f2937;
}

.sub-item-dash::before {
  content: "-";
  color: #fbbf24;
  margin-right: 8px;
  font-weight: bold;
}

/* Header Start Trading Button */
#header-wrapper .start-trading-btn {
  color: black !important;
}

/* AN AWARD-WINNING PLATFORM! */
.carousel-track {
  transition: transform 0.6s ease-in-out;
  display: flex;
}

.dragging {
  cursor: grabbing;
  user-select: none;
}

.dragging .carousel-track {
  transition: none;
}

.carousel-wrapper {
  overflow: hidden;
  position: relative;
}

.carousel-card {
  flex: 0 0 auto;
}

/* Hide right column on mobile */
@media (max-width: 1023px) {
  .right-column-mobile-hidden {
    display: none;
  }
}

/* Mobile layout reorder and background colors */
@media (max-width: 1023px) {
  .mobile-reorder {
    display: flex;
    flex-direction: column;
  }

  .mobile-text-first {
    order: 1;
    background-color: black;
    padding: 0rem 1.5rem;
    margin: 0rem 0rem 0 -1.5rem;
    color: white;
  }

  .mobile-box-second {
    order: 2;
    margin-top: 0;
    background-color: black;
    padding: 1rem 0rem;
    color: white;
  }

  .mobile-carousel-last {
    order: 3;
    margin-top: 0;
    background-color: white;
    padding: 2rem 1.5rem;
    margin: 0 -1.5rem -2rem -1.5rem;
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 1;
  }

  /* Adjust text colors for black background */
  .mobile-black-bg h1,
  .mobile-black-bg p {
    color: white !important;
  }

  /* Make the right box text white on mobile */
  .mobile-right-box h2,
  .mobile-right-box p {
    color: white !important;
  }

  /* Black background wrapper for text and right box */
  .mobile-black-section {
    background-color: black;
    margin: -2rem -1.5rem 0 -1.5rem;
    padding: 2rem 1.5rem 0 1.5rem;
    color: white;
  }
}

/* Desktop styles */
@media (min-width: 1024px) {
  .mobile-black-section {
    background-color: transparent;
    margin: 0;
    padding: 0;
    color: inherit;
  }

  .mobile-text-first,
  .mobile-box-second,
  .mobile-carousel-last {
    background-color: transparent;
    padding: 0;
    margin: 0;
    color: inherit;
  }
}

/* Extracted from index.html header */
/* Desktop Hover Logic */
                @media (min-width: 1024px) {
                  .lang-group:hover #lang-dropdown {
                    visibility: visible !important;
                    opacity: 1 !important;
                    display: block !important;
                  }
                }

                .mobile-visible {
                  visibility: visible !important;
                  opacity: 1 !important;
                  display: block !important;
                }

                /* Bridge: This invisible area prevents the menu from closing 
         when moving the mouse from button to dropdown */
                #lang-dropdown::before {
                  content: "";
                  position: absolute;
                  top: -10px;
                  /* Covers the gap */
                  left: 0;
                  right: 0;
                  height: 10px;
                  background: transparent;
                }

                #lang-dropdown {
                  display: none;
                }
