/* Dropdown Menu Styles - Loaded after original CSS to override */

/* Desktop menu styles - đảm bảo menu hiển thị trên PC */
@media (min-width: 769px) {
  .top-center {
    display: flex !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    z-index: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
  }
  
  .top-center::before {
    display: none !important;
  }
  
  .mobile-menu-header {
    display: none !important;
  }
  
  /* Đảm bảo menu desktop hiển thị đúng */
  .top-menu {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .top-menu .menu-item {
    width: auto !important;
    border-bottom: none !important;
  }
  
  .top-menu .menu-item .menu-link {
    padding: 0.5rem 1rem !important;
    white-space: nowrap !important;
  }
}

.top-menu {
  position: relative;
}

.top-menu .menu-item.dropdown {
  position: relative;
}

.top-menu .menu-item.dropdown .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background-color: #2b3348 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  z-index: 99999 !important;
  padding: 8px 0 !important;
  margin-top: 8px !important;
  display: none !important;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease !important;
  pointer-events: auto !important;
  visibility: hidden;
}

.top-menu .menu-item.dropdown.active .sub-menu,
.top-menu .menu-item.dropdown:hover .sub-menu {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.top-menu .menu-item.dropdown .sub-menu a {
  display: block !important;
  padding: 10px 20px !important;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 14px !important;
  transition: background-color 0.2s ease, color 0.2s ease !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10000 !important;
}

.top-menu .menu-item.dropdown .sub-menu a:hover {
  background-color: #e2fe35 !important;
  color: #000 !important;
}

.top-menu .menu-item.dropdown .sub-menu a:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.top-menu .menu-item.dropdown .sub-menu a:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Arrow indicator */
.top-menu .menu-item.dropdown .menu-link::after {
  content: '▼';
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.top-menu .menu-item.dropdown.active .menu-link::after,
.top-menu .menu-item.dropdown:hover .menu-link::after {
  transform: rotate(180deg);
}

/* Mobile menu toggle button */
.for-mobile.menu-toggle {
  display: none !important;
  cursor: pointer !important;
  z-index: 10001 !important;
  position: relative;
  padding: 8px !important;
  margin-right: 10px;
  background: transparent !important;
  border: none !important;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
}

.for-mobile.menu-toggle:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.for-mobile.menu-toggle .icon-menu {
  width: 24px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.for-mobile.menu-toggle .icon-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.for-mobile.menu-toggle.active .icon-menu span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.for-mobile.menu-toggle.active .icon-menu span:nth-child(2) {
  opacity: 0;
}

.for-mobile.menu-toggle.active .icon-menu span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu styles */
@media (max-width: 768px) {
  .for-mobile.menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .top-center {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 320px !important;
    height: 100vh !important;
    background: linear-gradient(180deg, #0f1117 0%, #1a1d26 50%, #0f1117 100%) !important;
    background-color: #0f1117 !important;
    background-image: 
      radial-gradient(circle at 20% 50%, rgba(77, 64, 156, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(226, 254, 53, 0.05) 0%, transparent 50%) !important;
    z-index: 10000 !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5) !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  /* Mobile menu header với logo */
  .top-center::before {
    content: '';
    display: block;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1117 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1;
  }

  /* Khi menu mobile được mở (có inline style display: block) */
  .top-center[style*="display: block"],
  .top-center[style*="display:block"] {
    transform: translateX(0) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Mobile menu header */
  .mobile-menu-header {
    display: block !important;
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1117 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
  
  .mobile-menu-close {
    transition: all 0.2s ease;
  }
  
  .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1);
  }

  .top-menu {
    flex-direction: column;
    gap: 0;
    padding: 0 20px 20px;
    margin-top: 0;
  }

  .top-menu .menu-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
  }
  
  .top-menu .menu-item:last-child {
    border-bottom: none;
  }

  .top-menu .menu-item .menu-link {
    display: block;
    padding: 16px 0;
    font-size: 15px;
    width: 100%;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s ease;
    position: relative;
  }
  
  .top-menu .menu-item .menu-link:hover {
    color: #e2fe35 !important;
    padding-left: 8px;
  }
  
  .top-menu .menu-item.active .menu-link {
    color: #e2fe35 !important;
    font-weight: 600;
  }
  
  .top-menu .menu-item.active .menu-link::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #e2fe35;
    border-radius: 0 2px 2px 0;
  }

  .menu-item.dropdown .sub-menu {
    position: static !important;
    display: none !important;
    box-shadow: none;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0;
    padding: 0 0 0 30px;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .menu-item.dropdown.active .sub-menu {
    display: block !important;
    max-height: 500px;
    padding: 8px 0 12px 30px !important;
  }
  
  .menu-item.dropdown .sub-menu a {
    padding: 12px 0 !important;
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-bottom: none !important;
    position: relative;
  }
  
  .menu-item.dropdown .sub-menu a:hover {
    color: #e2fe35 !important;
    background-color: transparent !important;
    padding-left: 8px !important;
  }
  
  .menu-item.dropdown .menu-link {
    cursor: pointer;
    user-select: none;
  }
  
  .menu-item.dropdown .menu-link::after {
    content: '▼';
    margin-left: 8px;
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.3s ease;
    display: inline-block;
    float: right;
  }
  
  .menu-item.dropdown.active .menu-link::after {
    transform: rotate(180deg);
    opacity: 1;
  }
  
  /* App download button trên mobile */
  .app-download-button-mobile {
    text-decoration: none !important;
  }
  
  .app-download-button-mobile:active {
    transform: translateY(0) !important;
  }

  .menu-item.dropdown .sub-menu a {
    padding: 12px 20px !important;
    font-size: 14px;
  }

  /* Overlay khi menu mở */
  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    pointer-events: auto;
  }
}

