/* ==========================================================================
   RadheeVan Mega Menu, Mobile Drawer, Button & Footer Responsive Styles
   ========================================================================== */

/* ----- Global Top Page Loading Bar ----- */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary, #a855f7);
  transform-origin: left;
  transform: scaleX(0);
  opacity: 0;
  z-index: 100001;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

html.page-loading .page-loader {
  opacity: 1;
  transform: scaleX(0.9);
}

.page-loader.page-loaded {
  opacity: 0;
  transform: scaleX(1);
}

/* ----- Mega Menu Desktop Base ----- */
.mega-nav-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mega-nav-item {
  position: relative;
}

.mega-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  color: #d0c0c0;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  font-family: "poppins", sans-serif;
}

.mega-nav-link:hover,
.mega-nav-link.active,
.mega-nav-item.open > .mega-nav-link {
  color: #ffffff;
}

/* Mega Menu Dropdown Panel */
.mega-menu-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: max-content;
  min-width: 580px;
  max-width: 820px;
  background: rgb(0, 0, 0);
  border-radius: 40px;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1000;
}

.mega-nav-item.open .mega-menu-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 1.5rem;
}

.mega-column-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Prevent underline on brand logo and title on all interactions */
.nav-left a,
.nav-logo-link,
.nav-title,
.mega-drawer-brand {
  text-decoration: none !important;
  border-bottom: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.nav-left a:hover,
.nav-left a:focus,
.nav-left a:active,
.nav-title:hover,
.nav-title:focus,
.nav-title:active {
  text-decoration: none !important;
  border-bottom: none !important;
}

.nav-left a::after,
.nav-logo-link::after,
.nav-title::after {
  display: none !important;
  content: none !important;
}

/* Hide badges everywhere */
.mega-badge {
  display: none !important;
}

.mega-item-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  text-decoration: none;
  color: #f0e6e6;
  background: transparent;
  border: 1px solid transparent;
  transition: none;
}

.mega-item-card:hover {
  background: transparent !important;
  border-color: transparent !important;
  transform: none !important;
  box-shadow: none !important;
}

.mega-item-card.active {
  background: rgba(168, 85, 247, 0.16) !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
}

.mega-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mega-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: "Poppins", sans-serif;
}

.mega-item-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: #ffffff;
  transition: none;
}

.mega-item-card:hover .mega-item-title {
  color: #ffffff !important;
  text-shadow: none !important;
}

.mega-item-desc {
  font-size: 0.8rem;
  color: #a19090;
  line-height: 1.35;
  transition: none;
}

.mega-item-card:hover .mega-item-desc {
  color: #a19090 !important;
}

/* ----- Mobile Hamburger & Slide-Out Drawer ----- */
.mega-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.12);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  z-index: 1000002 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mega-hamburger svg,
.mega-hamburger .hamburger-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.mega-hamburger:hover,
.mega-hamburger:focus-visible {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.7);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.mega-hamburger.open,
body.mega-drawer-open .mega-hamburger {
  background: rgba(168, 85, 247, 0.35);
  border-color: var(--primary, #a855f7);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.mega-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 1000000 !important;
}

.mega-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88vw;
  max-width: 380px;
  background: #0d0a0f;
  border-left: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 1000001 !important;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

body.mega-drawer-open {
  overflow: hidden;
}

body.mega-drawer-open .mega-mobile-overlay {
  opacity: 1;
  visibility: visible;
}

body.mega-drawer-open .mega-mobile-drawer {
  transform: translateX(0);
}

.mega-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.2rem;
}

.mega-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.mega-drawer-brand img {
  height: 32px;
  width: auto;
  border-radius: 6px;
}

.mega-drawer-brand span {
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
}

.mega-drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mega-drawer-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.mega-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mega-drawer-acc-item {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: all 0.2s ease;
}

.mega-drawer-acc-item.active {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.35);
}

.mega-drawer-acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: none !important;
  background: transparent !important;
  color: #f0e6e6 !important;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.mega-drawer-acc-btn:hover,
.mega-drawer-acc-item.active .mega-drawer-acc-btn {
  color: #ffffff !important;
  background: rgba(168, 85, 247, 0.12) !important;
}

.mega-drawer-acc-body {
  display: none;
  padding: 0.5rem 0.75rem 0.75rem 0.75rem;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mega-drawer-acc-item.active .mega-drawer-acc-body {
  display: flex;
}

.mega-drawer-acc-item.active .mega-arrow {
  transform: rotate(180deg);
  color: #c084fc;
}

.mega-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: #f0e6e6 !important;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.mega-drawer-acc-body .mega-drawer-link {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #d0c0c0 !important;
  transition: none;
}

.mega-drawer-acc-body .mega-drawer-link:hover {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: #d0c0c0 !important;
}

.mega-drawer-link:hover,
.mega-drawer-link.active {
  background: rgba(168, 85, 247, 0.2) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  color: #ffffff !important;
}

.mega-drawer-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mega-drawer-cta {
  display: block;
  text-align: center;
  padding: 0.8rem;
  border-radius: 12px;
  background: var(--primary, #a855f7);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.mega-drawer-cta:hover {
  background: var(--primary-hover, #c084fc);
}

/* Responsive Media Queries for Navigation Breakpoint (Mobile & Tablet) */
@media (max-width: 1200px) {
  nav .nav-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  .mega-nav-container {
    display: none !important;
  }

  .mega-hamburger {
    display: inline-flex !important;
  }

  .mobile-bottom-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    z-index: 999999 !important;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(10, 8, 12, 0.98) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 -12px 36px rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(22px) !important;
    -webkit-backdrop-filter: blur(22px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .mobile-bottom-nav .bottom-nav-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    max-width: 580px !important;
    margin: 0 auto !important;
    padding: 0 0.25rem !important;
    width: 100% !important;
    gap: 0.35rem !important;
  }

  .bottom-nav-link {
    flex: 1 1 0% !important;
    width: auto !important;
    max-width: 72px !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 16px !important;
    color: #a19090 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }

  .bottom-nav-link svg {
    width: 22px !important;
    height: 22px !important;
    fill: currentColor !important;
    display: block !important;
    flex-shrink: 0 !important;
  }

  .bottom-nav-link span {
    display: none !important;
  }

  .bottom-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06) !important;
  }

  .bottom-nav-link.active {
    color: #ffffff !important;
    background: rgba(168, 85, 247, 0.22) !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2) !important;
  }

  body {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 1201px) {
  .mobile-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}


/* ==========================================================================
   2. Button Optimization (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 820px) {
  .hero-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 540px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .hero-buttons .btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 130px;
    padding: 0.8rem 1.1rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .pbtn-primary,
  .btn-primary {
    font-size: 1.15rem;
  }
}

/* Small tablet screen button order (521px to 820px) where hero buttons display in 2-top, 1-bottom format:
   - Minecraft Tools in position 2 (top-right, 50% width, outline style)
   - Download Craziness! in position 3 (bottom row, 100% full width, highlighted primary style) */
@media (min-width: 521px) and (max-width: 820px) {
  .hero-grid > div.hero-buttons:nth-of-type(2) {
    display: flex !important;
    justify-content: center !important;
  }

  .hero-grid > div.hero-buttons:nth-of-type(2) > a:nth-of-type(1) {
    order: 1 !important;
  }

  /* Minecraft Tools button -> position 2 (top right, 50% width) */
  .hero-grid > div.hero-buttons:nth-of-type(2) > a:nth-of-type(3) {
    order: 2 !important;
  }

  /* Download Craziness! button -> position 3 (bottom row, full width) */
  .hero-grid > div.hero-buttons:nth-of-type(2) > a:nth-of-type(2) {
    order: 3 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

@media (max-width: 520px) {
  .hero-buttons {
    gap: 0.65rem !important;
  }

  .hero-buttons .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-height: 46px;
    padding: 0.85rem 1.2rem;
  }
}


/* ==========================================================================
   3. Footer Optimization (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 992px) {
  .footer-top {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem 1.5rem !important;
  }
}

@media (max-width: 580px) {
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .footer-about,
  .footer-links,
  .footer-contact {
    text-align: left;
  }

  .footer-links a,
  .footer-contact p,
  .footer-contact a {
    padding: 0.4rem 0 !important;
    min-height: 42px;
    display: inline-flex !important;
    align-items: center;
  }

  .footer-social {
    gap: 0.8rem !important;
    margin-top: 1.2rem !important;
  }

  .footer-social a {
    min-width: 44px;
    min-height: 44px;
    padding: 0.6rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.8rem !important;
    padding-top: 1.5rem !important;
  }

  .footer-bottom .legal,
  .footer-bottom .footer-note {
    text-align: center !important;
    flex: 1 1 100% !important;
  }
}
