/* Ẩn trên desktop */
.magic-menu {
  display: none;
}

/* Hiển thị trên mobile */
@media (max-width: 768px) {
  .magic-menu {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #181818;
    width: 92%;
    max-width: 500px;
    height: 40px; /* Giảm từ 70px xuống 40px */
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 12px;
    padding: 0 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    z-index: 9999;
  }

  .magic-menu .tab-item {
    color: #aaa;
    font-size: 10px; /* chữ nhỏ lại */
    text-decoration: none;
    text-align: center;
    flex: 1;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 2px 0;
  }

  .magic-menu .tab-item i {
    font-size: 16px; /* icon nhỏ lại */
    display: block;
    margin-bottom: 2px;
    transition: all 0.3s ease;
  }

  .magic-menu .tab-item:hover {
    color: #ff4d6d;
  }

  .magic-menu .tab-item:hover i {
    transform: translateY(-4px) scale(1.2);
    text-shadow: 0 0 6px #ff4d6d, 0 0 12px #ff4d6d;
  }

  /* Hiệu ứng đặc biệt cho item Menu */
  .magic-menu .menu-highlight {
    position: relative;
    overflow: hidden;
  }

  .magic-menu .menu-highlight::before {
    content: "";
    position: absolute;
    top: -2px; left: -2px;
    right: -2px; bottom: -2px;
    border-radius: 10px;
    background: linear-gradient(270deg, #ff4d6d, #ff9900, #00c3ff, #ff4d6d);
    background-size: 600% 600%;
    animation: glowing 4s linear infinite;
    z-index: -1;
  }

  .magic-menu .menu-highlight::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: #181818;
    border-radius: 8px;
    z-index: -1;
  }

  .magic-menu .menu-highlight i {
    animation: pulse 1.5s infinite;
    color: #ff4d6d;
  }

  @keyframes glowing {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  @keyframes pulse {
    0% { transform: scale(1); text-shadow: 0 0 4px #ff4d6d; }
    50% { transform: scale(1.2); text-shadow: 0 0 12px #ff4d6d, 0 0 20px #ff4d6d; }
    100% { transform: scale(1); text-shadow: 0 0 4px #ff4d6d; }
  }

  /* Modal chung */
  .modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
  }

  .modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: fadeIn 0.4s ease;
  }

  .modal .close {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 22px;
    cursor: pointer;
    color: #888;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
  }

  /* Grid categories */
  .categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .categories-grid a {
    background: #f2f2f2;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: 0.3s;
  }

  .categories-grid a:hover {
    background: #ff4d6d;
    color: #fff;
  }

  .categories-grid .menu-special {
    background: linear-gradient(45deg, #ff4d6d, #ff9900);
    color: #fff;
    font-weight: bold;
  }

  /* Grid languages */
  .lang-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
  }

  .lang-grid img {
    width: 40px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
  }

  .lang-grid img:hover {
    transform: scale(1.2);
  }
}
