/* ============================================
   PREMIUM MOBILE MENU - BEST UI/UX
   ============================================ */
@media (max-width: 991px) {
  /* Mobile Menu Trigger Button */
  .mobile-menu-trigger {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 10001;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 193, 7, 0.2);
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    color: transparent;
  }

  .mobile-menu-trigger:hover,
  .mobile-menu-trigger:focus {
    transform: scale(1.1);
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.4), 0 0 30px rgba(255, 193, 7, 0.3);
  }

  .mobile-menu-trigger:active {
    transform: scale(1.05);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-trigger:focus {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-trigger * {
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
  }

  .mobile-menu-trigger.active {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 152, 0, 0.25));
    border-color: rgba(255, 193, 7, 0.6);
    /* Hide hamburger trigger when menu is open to avoid confusion */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .burger-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.4), transparent 70%);
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: burgerPulse 2s ease-in-out infinite;
  }

  @keyframes burgerPulse {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.2); }
  }

  .mobile-menu-trigger.active .burger-glow {
    opacity: 1;
    animation: none;
  }

  .burger-icon {
    position: relative;
    width: 26px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
  }

  .burger-line {
    position: relative;
    width: 100%;
    height: 3px;
    background: #ffc107;
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
  }

  .mobile-menu-trigger.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .mobile-menu-trigger.active .burger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }

  .mobile-menu-trigger.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }

  /* Menu Overlay */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
  }

  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Menu Panel */
  .mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 420px;
    height: 100%;
    z-index: 9999;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  .mobile-menu-panel.active {
    right: 0;
  }

  .menu-panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98), rgba(20, 20, 20, 0.98));
    backdrop-filter: blur(20px);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
  }

  .menu-panel-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
      radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(255, 152, 0, 0.08) 0%, transparent 50%);
    opacity: 0.5;
  }

  /* Menu Header */
  .mobile-menu-header {
    position: relative;
    padding: 2.5rem 2rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08), transparent);
    z-index: 1;
  }

  .menu-header-content {
    flex: 1;
  }

  .menu-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }

  .logo-text {
    color: #fff;
  }

  .logo-accent {
    color: #ffc107;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .menu-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-weight: 500;
  }

  .menu-close-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 193, 7, 0.1) !important;
    border: 2px solid rgba(255, 193, 7, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffc107 !important;
    font-size: 1.3rem;
    outline: none;
    position: relative;
    z-index: 10;
    /* Remove any effects that might cause duplication */
    text-shadow: none !important;
    box-shadow: none !important;
    -webkit-text-stroke: none !important;
    /* Reset all transforms and filters */
    transform: none !important;
    filter: none !important;
    /* Ensure single rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent any background duplication */
    background-image: none !important;
    background-repeat: no-repeat !important;
  }

  /* Completely remove any pseudo-elements */
  .menu-close-btn::before,
  .menu-close-btn::after {
    display: none !important;
    content: '' !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Ensure icon is not duplicated - completely reset */
  .menu-close-btn i,
  .menu-close-btn i::before {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    text-shadow: none !important;
    box-shadow: none !important;
    -webkit-text-stroke: none !important;
    filter: none !important;
    transform: none !important;
    opacity: 1 !important;
    /* Ensure Font Awesome renders only once */
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
  }

  /* Remove any pseudo-elements from the icon */
  .menu-close-btn i::after {
    display: none !important;
    content: '' !important;
  }

  /* Prevent any duplicate rendering */
  .menu-close-btn * {
    pointer-events: none;
  }

  .menu-close-btn:hover,
  .menu-close-btn:focus {
    background: rgba(255, 193, 7, 0.2);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
    /* Ensure no duplication on hover */
    text-shadow: none !important;
  }

  .menu-close-btn:hover i,
  .menu-close-btn:focus i {
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }

  /* Ensure no duplicate rendering on active states */
  .menu-close-btn:active {
    transform: scale(0.95);
  }

  .menu-close-btn:active::before,
  .menu-close-btn:active::after,
  .menu-close-btn:hover::before,
  .menu-close-btn:hover::after,
  .menu-close-btn:focus::before,
  .menu-close-btn:focus::after {
    display: none !important;
    content: none !important;
  }

  /* Menu Navigation */
  .mobile-menu-nav {
    position: relative;
    flex: 1;
    padding: 2rem 0;
    overflow-y: auto;
    z-index: 1;
  }

  .mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-nav-item {
    margin: 0.75rem 1.5rem;
    opacity: 0;
    transform: translateX(50px);
  }

  .mobile-menu-panel.active .mobile-nav-item {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .mobile-nav-item:nth-child(1) { animation-delay: 0.1s; }
  .mobile-nav-item:nth-child(2) { animation-delay: 0.2s; }
  .mobile-nav-item:nth-child(3) { animation-delay: 0.3s; }
  .mobile-nav-item:nth-child(4) { animation-delay: 0.4s; }

  @keyframes slideInRight {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .mobile-nav-link {
    position: relative;
    display: block;
    padding: 1.5rem 1.75rem;
    text-decoration: none;
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    color: inherit;
    outline: none;
  }

  .mobile-nav-link:link,
  .mobile-nav-link:visited,
  .mobile-nav-link:active,
  .mobile-nav-link:focus {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-link * {
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-link,
  .mobile-nav-link * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  .nav-link-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 18px;
  }

  .mobile-nav-link:active .nav-link-bg,
  .mobile-nav-link:hover .nav-link-bg {
    width: 100%;
  }

  .nav-link-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    z-index: 2;
  }

  .nav-icon-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .icon-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.5), transparent 70%);
    border-radius: 50%;
    transition: width 0.4s ease, height 0.4s ease;
  }

  .mobile-nav-link:active .icon-ripple {
    width: 90px;
    height: 90px;
  }

  .nav-icon-wrapper i {
    font-size: 1.4rem;
    color: #ffc107 !important;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
  }

  .mobile-nav-link:active .nav-icon-wrapper i,
  .mobile-nav-link:focus .nav-icon-wrapper i,
  .mobile-nav-link:visited .nav-icon-wrapper i {
    color: #ffc107 !important;
  }

  .mobile-nav-link:active .nav-icon-wrapper,
  .mobile-nav-link:hover .nav-icon-wrapper {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.4);
  }

  .nav-text {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff !important;
    transition: all 0.3s ease;
  }

  .mobile-nav-link:active .nav-text,
  .mobile-nav-link:hover .nav-text,
  .mobile-nav-link:focus .nav-text,
  .mobile-nav-link:visited .nav-text {
    color: #ffc107 !important;
    transform: translateX(5px);
  }

  .nav-arrow {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.4) !important;
    transition: all 0.3s ease;
  }

  .mobile-nav-link:active .nav-arrow,
  .mobile-nav-link:hover .nav-arrow,
  .mobile-nav-link:focus .nav-arrow,
  .mobile-nav-link:visited .nav-arrow {
    color: #ffc107 !important;
    transform: translateX(5px);
  }

  .nav-link-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #ffc107, #ff9800);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-nav-link:active .nav-link-indicator,
  .mobile-nav-link:hover .nav-link-indicator {
    height: 70%;
  }

  .mobile-nav-item.active .nav-link-indicator {
    height: 80%;
  }

  .mobile-nav-item.active .nav-text {
    color: #ffc107;
  }

  .mobile-nav-item.active .nav-icon-wrapper {
    background: rgba(255, 193, 7, 0.25);
    border-color: rgba(255, 193, 7, 0.5);
  }

  /* Menu Footer */
  .mobile-menu-footer {
    position: relative;
    padding: 2rem 2rem 2.5rem;
    border-top: 1px solid rgba(255, 193, 7, 0.15);
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
  }

  .menu-social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .social-link {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc107;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.3rem;
  }

  .social-link:active,
  .social-link:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
  }

  .menu-footer-text {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
  }

  /* Smooth Scrollbar */
  .mobile-menu-panel::-webkit-scrollbar {
    width: 6px;
  }

  .mobile-menu-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }

  .mobile-menu-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.3);
    border-radius: 3px;
  }

  .mobile-menu-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 193, 7, 0.5);
  }

  /* Smaller screens adjustments */
  @media (max-width: 576px) {
    .mobile-menu-trigger {
      width: 56px;
      height: 56px;
      top: 20px;
      right: 20px;
    }

    .mobile-menu-panel {
      width: 90%;
    }

    .mobile-menu-header {
      padding: 2rem 1.5rem;
    }

    .menu-logo {
      font-size: 1.75rem;
    }

    .mobile-nav-item {
      margin: 0.6rem 1.25rem;
    }

    .mobile-nav-link {
      padding: 1.25rem 1.5rem;
    }

    .nav-icon-wrapper {
      width: 48px;
      height: 48px;
    }

    .nav-icon-wrapper i {
      font-size: 1.3rem;
    }

    .nav-text {
      font-size: 1.05rem;
    }
  }
}

