/* Mobile app-style navigation (bottom bar + sidebar) */

@media (max-width: 991px) {
  /* Hide desktop dropdown nav on mobile */
  body .navbar-collapse {
    display: none !important;
  }

  /* Bottom navigation bar — iOS/Android app style */
  .app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(64px + env(safe-area-inset-bottom, 0));
    min-height: 64px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(56, 81, 133, 0.1);
    box-shadow: 0 -6px 30px rgba(56, 81, 133, 0.1);
    padding: 6px 8px env(safe-area-inset-bottom, 6px);
  }

  .app-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    max-width: 72px;
    padding: 4px 2px;
    border: none;
    background: transparent;
    color: #8a96a8;
    text-decoration: none;
    font-family: var(--body-font);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    transition: color 0.2s ease;
    cursor: pointer;
    position: relative;
    border-radius: 12px;
  }

  .app-bottom-nav-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--theme-color2);
    transition: width 0.2s ease;
  }

  .app-bottom-nav-item.active::before {
    width: 24px;
  }

  .app-bottom-nav-item i {
    font-size: 21px;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  .app-bottom-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .app-bottom-nav-item.active {
    color: var(--theme-color);
  }

  .app-bottom-nav-item.active i {
    color: var(--theme-color2);
    transform: scale(1.05);
  }

  .app-bottom-nav-item:active {
    opacity: 0.7;
  }

  /* Sidebar overlay */
  .app-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .app-sidebar-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* Sidebar panel */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 88vw);
    height: 100%;
    height: 100dvh;
    z-index: 10000;
    background: #ffffff;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top, 0)) 18px 16px;
    background: var(--theme-color);
    flex-shrink: 0;
  }

  .app-sidebar-logo img {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: brightness(0) invert(1);
  }

  .app-sidebar-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .app-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0 24px;
    -webkit-overflow-scrolling: touch;
  }

  .app-sidebar-label {
    margin: 8px 0 6px;
    padding: 0 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #94a3b8;
  }

  .app-sidebar-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
  }

  .app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--color-dark);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .app-sidebar-link:active,
  .app-sidebar-link.active {
    background: var(--theme-color-light);
    color: var(--theme-color);
  }

  .app-sidebar-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--theme-color-light);
    color: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
  }

  .app-sidebar-link.active .app-sidebar-link-icon {
    background: var(--theme-color);
    color: #fff;
  }

  .app-sidebar-link-apply .app-sidebar-link-icon {
    background: rgba(163, 31, 52, 0.12);
    color: var(--theme-color2);
  }

  .app-sidebar-link-arrow {
    margin-left: auto;
    font-size: 12px;
    color: #cbd5e1;
  }

  .app-sidebar-contact {
    list-style: none;
    margin: 0 0 16px;
    padding: 0 20px;
  }

  .app-sidebar-contact li {
    margin-bottom: 10px;
  }

  .app-sidebar-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-dark);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
  }

  .app-sidebar-contact a i {
    color: var(--theme-color2);
    width: 20px;
    font-size: 16px;
  }

  .app-sidebar-social {
    display: flex;
    gap: 10px;
    padding: 0 20px;
  }

  .app-sidebar-social a {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--theme-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    text-decoration: none;
  }

  body.app-sidebar-open {
    overflow: hidden;
  }
}

@media (min-width: 992px) {
  .app-bottom-nav,
  .app-sidebar,
  .app-sidebar-overlay {
    display: none !important;
  }
}
