/* ==================== */
/* NAVBAR RESPONSIVE (shared) */
/* ==================== */

/* Desktop defaults (desktop menu visible) */
@media (min-width: 993px) {
  .hamburger-menu,
  .mobile-menu,
  .menu-overlay {
    display: none !important;
  }

  .menu {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* Small desktop/laptop widths: avoid navbar overlap */
@media (min-width: 993px) and (max-width: 1400px) {
  .nav-container {
    padding: 0 2rem;
    gap: 1.5rem;
  }

  /* App-level navbar uses absolute positioning; reset to flex flow here */
  .menu {
    position: static !important;
    right: auto !important;
    left: auto !important;
    gap: 1.5rem;
    flex-wrap: nowrap;
  }

  .menu a {
    white-space: nowrap;
    font-size: 1.1rem;
  }

  .register {
    width: 7rem;
    height: 3.5rem;
    flex-shrink: 0;
  }
}

/* Tablet & below: show hamburger + mobile menu, hide desktop menu */
@media (max-width: 992px) {
  .nav-container {
    height: 6rem;
    padding: 0 15px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .menu {
    display: none !important;
  }

  /* Hamburger button */
  .hamburger-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    order: 3; /* right side in RTL */
  }

  .hamburger-menu span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--primary-purple);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(13px) rotate(45deg);
  }
  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-13px) rotate(-45deg);
  }

  /* Logo centered */
  .app-logo {
    order: 2;
    flex-grow: 1;
    text-align: center;
  }

  .app-logo_Img {
    height: 4.5rem;
    margin: 0 auto;
  }

  /* Register button on left */
  .register {
    order: 1;
    width: 7rem;
    height: 3.2rem;
    border-radius: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
  }

  .text-register {
    font-size: 0.9rem;
    margin-top: 0.8rem;
    color: white;
    font-family: "farsi-bold";
    white-space: nowrap;
  }

  /* Overlay */
  .menu-overlay {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Mobile menu panel */
  .mobile-menu {
    display: block !important;
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #ffd95a 100%);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    overflow-y: auto;
    direction: rtl;
    padding: 20px 0;
  }

  .mobile-menu.active {
    right: 0;
  }

  .mobile-menu-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 20px 1rem;
    border-bottom: 2px solid rgba(113, 63, 148, 0.2);
  }

  .mobile-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
  }

  .mobile-menu-header h3 {
    color: var(--primary-purple);
    font-size: 1rem;
    margin: 0;
    font-family: "farsi-bold";
  }

  .mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-menu > ul > li {
    border-bottom: 1px solid rgba(113, 63, 148, 0.1);
  }

  .mobile-menu a {
    color: var(--primary-purple);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    transition: background 0.3s;
    font-family: "farsi-bold";
    font-size: 1.1rem;
  }

  .mobile-menu a:hover {
    background: rgba(113, 63, 148, 0.1);
  }

  .mobile-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: rgba(255, 255, 255, 0.2);
  }

  .mobile-dropdown.active {
    max-height: 500px;
  }

  .mobile-dropdown a {
    font-size: 1rem;
    font-weight: normal;
    color: #555;
    padding: 12px 30px;
    font-family: "farsi-medium";
  }

  .mobile-register-btn {
    background: var(--primary-purple) !important;
    color: white !important;
    text-align: center;
    justify-content: center !important;
    margin: 1rem 20px 0;
    border-radius: 8px;
    padding: 12px !important;
  }
}

@media (max-width: 768px) {
  .nav-container {
    height: 5rem;
  }

  .app-logo_Img {
    height: 4rem;
  }

  .register {
    width: 6.5rem;
    height: 2.8rem;
  }

  .text-register {
    font-size: 0.8rem;
    margin-top: 0.7rem;
  }
}

@media (max-width: 576px) {
  .mobile-menu {
    width: 280px;
  }
}

/* Prevent horizontal scroll on mobile */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

