/* Desktop root entry point. Keep the proven layout as the base and layer only the current desktop polish on top. */
@import url("./desktop-shell-base.css");
@import url("./desktop-shell-polish.css");

/* Desktop-only navigation refinement.
   - Keeps the approved primary desktop header.
   - Reuses the real mobile bottom navigation as the lower desktop header.
   - Reuses the real mobile hamburger/menu runtime, changing only its desktop presentation.
   Mobile/PWA behavior below 1100px remains untouched. */

@media (min-width: 1100px) {
  body.disciply-desktop-app {
    --root-desktop-primary-header-height: 74px;
    --root-desktop-header-height: var(--root-desktop-primary-header-height);
    padding-top: var(--root-desktop-header-height);
    padding-bottom: 94px;
  }

  body.disciply-desktop-app .desktop-shell__quick {
    display: none !important;
  }

  body.disciply-desktop-app .desktop-shell {
    height: var(--root-desktop-primary-header-height);
    min-height: var(--root-desktop-primary-header-height);
  }

  /* Reserve a compact slot for the hamburger between brand and desktop links. */
  body.disciply-desktop-app .desktop-shell__nav,
  body.disciply-desktop-collapsed .desktop-shell__nav {
    margin-inline-start: 48px;
  }

  body.disciply-desktop-app.menu-auth-enabled #hamburgerBtn {
    top: 17px !important;
    left: 170px !important;
    right: auto !important;
    bottom: auto !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    border: 1px solid rgba(244, 189, 24, 0.3) !important;
    border-radius: 11px !important;
    background: linear-gradient(180deg, rgba(17, 22, 30, 0.97), rgba(8, 12, 18, 0.99)) !important;
    color: #f4c945 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    z-index: 12130 !important;
  }

  body.disciply-desktop-app #hamburgerBtn:hover,
  body.disciply-desktop-app #hamburgerBtn:focus-visible {
    border-color: rgba(244, 189, 24, 0.62) !important;
    background: linear-gradient(180deg, rgba(31, 30, 24, 0.98), rgba(12, 15, 19, 0.99)) !important;
    outline: none;
  }

  body.disciply-desktop-app #hamburgerBtn span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
  }

  /* Desktop hamburger drawer: professional side navigation, not a mobile card grid. */
  body.disciply-desktop-app.menu-auth-enabled #mobileMenu {
    top: var(--root-desktop-header-height) !important;
    left: 0 !important;
    right: auto !important;
    width: min(390px, calc(100vw - 40px)) !important;
    height: calc(100dvh - var(--root-desktop-header-height)) !important;
    max-height: calc(100dvh - var(--root-desktop-header-height)) !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 2px !important;
    padding: 12px 10px 20px !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    border: 0;
    border-right: 1px solid rgba(244, 189, 24, 0.18);
    border-radius: 0 18px 18px 0;
    background:
      radial-gradient(circle at 10% 0%, rgba(244, 189, 24, 0.08), transparent 26%),
      linear-gradient(180deg, rgba(12, 18, 27, 0.997), rgba(5, 9, 15, 0.999));
    box-shadow: 26px 0 64px rgba(0, 0, 0, 0.4), inset -1px 0 0 rgba(255, 255, 255, 0.022);
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(calc(-100% - 24px));
    transition: transform 210ms ease, opacity 170ms ease, visibility 170ms ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 189, 24, 0.22) transparent;
    z-index: 12120 !important;
  }

  body.disciply-desktop-app.menu-auth-enabled #mobileMenu::before {
    content: "DISCIPLY";
    flex: 0 0 auto;
    display: block;
    margin: 0 4px 8px;
    padding: 7px 8px 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    color: #f4c945;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.18em;
    line-height: 1;
  }

  body.disciply-desktop-app.menu-auth-enabled #mobileMenu.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
  }

  body.disciply-desktop-app #mobileMenu .menu-link {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid transparent !important;
    border-radius: 9px;
    background: transparent !important;
    color: #aeb8c5 !important;
    font-size: 11.5px;
    font-weight: 670;
    line-height: 1.2;
    text-align: start;
    box-shadow: none !important;
    transform: none !important;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, padding 150ms ease;
  }

  body.disciply-desktop-app #mobileMenu .menu-link:hover,
  body.disciply-desktop-app #mobileMenu .menu-link:focus-visible {
    padding-inline-start: 13px;
    border-color: rgba(244, 189, 24, 0.14) !important;
    background: linear-gradient(90deg, rgba(244, 189, 24, 0.085), rgba(255, 255, 255, 0.018)) !important;
    color: #f5f7fa !important;
    outline: none;
  }

  body.disciply-desktop-app #mobileMenu .menu-link:hover::before,
  body.disciply-desktop-app #mobileMenu .menu-link:focus-visible::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px 0;
    width: 2px;
    border-radius: 999px;
    background: #f4bd18;
    box-shadow: 0 0 10px rgba(244, 189, 24, 0.32);
  }

  body.disciply-desktop-app #mobileMenu .menu-link-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    opacity: 0.88;
  }

  body.disciply-desktop-app #mobileMenu .menu-link-icon-svg,
  body.disciply-desktop-app #mobileMenu .menu-link-icon-img {
    width: 17px;
    height: 17px;
  }

  body.disciply-desktop-app #mobileMenu #menuSubscribeLink {
    min-height: 44px;
    justify-content: center;
    margin: 8px 0 5px;
    border-color: rgba(244, 189, 24, 0.32) !important;
    background: linear-gradient(180deg, rgba(244, 189, 24, 0.13), rgba(244, 189, 24, 0.045)) !important;
    color: #f6cf58 !important;
    font-weight: 780;
  }

  body.disciply-desktop-app #mobileMenu #menuSubscribeLink:hover,
  body.disciply-desktop-app #mobileMenu #menuSubscribeLink:focus-visible {
    padding-inline-start: 10px;
    border-color: rgba(244, 189, 24, 0.55) !important;
    background: linear-gradient(180deg, rgba(244, 189, 24, 0.18), rgba(244, 189, 24, 0.07)) !important;
    color: #ffe08a !important;
  }

  body.disciply-desktop-app #mobileMenu #menuSubscribeLink::before {
    display: none;
  }

  body.disciply-desktop-app #mobileMenu #logoutBtn {
    min-height: 42px;
    margin-top: 8px;
    border-top-color: rgba(255, 255, 255, 0.06) !important;
  }

  body.disciply-desktop-app.menu-auth-enabled #menuBackdrop {
    inset: var(--root-desktop-header-height) 0 0 0 !important;
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 180ms ease, visibility 180ms ease;
    z-index: 12110 !important;
  }

  body.disciply-desktop-app.menu-auth-enabled #menuBackdrop.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Lower desktop header: the same real Dashboard / Results / Account / Markets / Tool nav used on mobile. */
  body.disciply-desktop-app .disciply-bottom-nav {
    left: 50%;
    right: auto;
    bottom: 0;
    width: min(720px, calc(100vw - 96px));
    min-height: 72px;
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between;
    gap: 5px;
    padding: 7px 18px 10px;
    border-radius: 28px 28px 0 0;
    border-top: 1px solid rgba(244, 189, 24, 0.18);
    border-left: 1px solid rgba(255, 255, 255, 0.045);
    border-right: 1px solid rgba(255, 255, 255, 0.045);
    background:
      radial-gradient(circle at 50% -90%, rgba(244, 189, 24, 0.08), transparent 38%),
      linear-gradient(180deg, rgba(18, 19, 22, 0.97), rgba(5, 6, 8, 0.992));
    box-shadow: 0 -12px 38px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(18px) saturate(112%);
    -webkit-backdrop-filter: blur(18px) saturate(112%);
    transform: translateX(-50%);
    z-index: 12000;
  }

  body.disciply-desktop-app .disciply-bottom-nav.hidden {
    display: none !important;
  }

  body.disciply-desktop-app .disciply-bottom-nav__item {
    min-height: 52px;
    gap: 5px;
    padding: 5px 8px 4px;
    border-radius: 13px;
    font-size: inherit;
  }

  body.disciply-desktop-app .disciply-bottom-nav__item:not(.disciply-bottom-nav__item--account) {
    transform: translateY(-1px);
  }

  body.disciply-desktop-app .disciply-bottom-nav__item:not(.disciply-bottom-nav__item--account):hover,
  body.disciply-desktop-app .disciply-bottom-nav__item:not(.disciply-bottom-nav__item--account):focus-visible {
    background: rgba(255, 255, 255, 0.035);
  }

  body.disciply-desktop-app .disciply-bottom-nav__icon {
    width: 24px;
    height: 24px;
  }

  body.disciply-desktop-app .disciply-bottom-nav__label {
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.018em;
  }

  body.disciply-desktop-app .disciply-bottom-nav__item--account {
    flex: 0 0 92px;
    transform: translateY(-12px);
  }

  body.disciply-desktop-app .disciply-bottom-nav__account-bubble {
    width: 58px;
    height: 58px;
    border-width: 1px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.11) inset;
  }

  body.disciply-desktop-app .disciply-bottom-nav__account-bubble.is-connected .disciply-bottom-nav__account-icon {
    width: 33px;
    height: 33px;
  }

  body.disciply-desktop-app #app {
    padding-top: 18px;
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  body.disciply-desktop-app .desktop-shell__nav,
  body.disciply-desktop-collapsed .desktop-shell__nav {
    margin-inline-start: 44px;
  }

  body.disciply-desktop-app.menu-auth-enabled #hamburgerBtn {
    left: 140px !important;
  }

  body.disciply-desktop-app.menu-auth-enabled #mobileMenu {
    width: min(360px, calc(100vw - 32px)) !important;
  }

  body.disciply-desktop-app .disciply-bottom-nav {
    width: min(680px, calc(100vw - 80px));
  }
}

@media (min-width: 1440px) {
  body.disciply-desktop-app.menu-auth-enabled #hamburgerBtn {
    left: 188px !important;
  }

  body.disciply-desktop-app.menu-auth-enabled #mobileMenu {
    width: min(410px, calc(100vw - 48px)) !important;
  }

  body.disciply-desktop-app .disciply-bottom-nav {
    width: min(760px, calc(100vw - 120px));
  }
}

@media (min-width: 1100px) {
  html[dir="rtl"] body.disciply-desktop-app.menu-auth-enabled #hamburgerBtn {
    left: auto !important;
    right: 244px !important;
  }

  html[dir="rtl"] body.disciply-desktop-app.menu-auth-enabled #mobileMenu {
    left: auto !important;
    right: 0 !important;
    border-right: 0;
    border-left: 1px solid rgba(244, 189, 24, 0.18);
    border-radius: 18px 0 0 18px;
    transform: translateX(calc(100% + 24px));
  }

  html[dir="rtl"] body.disciply-desktop-app.menu-auth-enabled #mobileMenu.open {
    transform: translateX(0) !important;
  }

  html[data-theme="light"] body.disciply-desktop-app.menu-auth-enabled #hamburgerBtn,
  html[data-background-style="light"] body.disciply-desktop-app.menu-auth-enabled #hamburgerBtn {
    border-color: rgba(139, 100, 26, 0.24) !important;
    background: rgba(250, 248, 243, 0.96) !important;
    color: #9a6c12 !important;
    box-shadow: 0 8px 20px rgba(70, 55, 28, 0.11);
  }

  html[data-theme="light"] body.disciply-desktop-app.menu-auth-enabled #mobileMenu,
  html[data-background-style="light"] body.disciply-desktop-app.menu-auth-enabled #mobileMenu {
    border-color: rgba(139, 100, 26, 0.16);
    background:
      radial-gradient(circle at 10% 0%, rgba(214, 168, 79, 0.075), transparent 28%),
      linear-gradient(180deg, rgba(250, 248, 243, 0.997), rgba(239, 235, 225, 0.999));
    box-shadow: 24px 0 54px rgba(70, 55, 28, 0.15);
  }

  html[data-theme="light"] body.disciply-desktop-app #mobileMenu::before,
  html[data-background-style="light"] body.disciply-desktop-app #mobileMenu::before {
    border-bottom-color: rgba(16, 24, 40, 0.08);
    color: #9a6c12;
  }

  html[data-theme="light"] body.disciply-desktop-app #mobileMenu .menu-link,
  html[data-background-style="light"] body.disciply-desktop-app #mobileMenu .menu-link {
    color: #5f6975 !important;
  }

  html[data-theme="light"] body.disciply-desktop-app #mobileMenu .menu-link:hover,
  html[data-theme="light"] body.disciply-desktop-app #mobileMenu .menu-link:focus-visible,
  html[data-background-style="light"] body.disciply-desktop-app #mobileMenu .menu-link:hover,
  html[data-background-style="light"] body.disciply-desktop-app #mobileMenu .menu-link:focus-visible {
    border-color: rgba(139, 100, 26, 0.14) !important;
    background: linear-gradient(90deg, rgba(214, 168, 79, 0.11), rgba(255, 255, 255, 0.35)) !important;
    color: #1f2937 !important;
  }

  html[data-theme="light"] body.disciply-desktop-app .disciply-bottom-nav,
  html[data-background-style="light"] body.disciply-desktop-app .disciply-bottom-nav {
    border-top-color: rgba(139, 100, 26, 0.16);
    border-left-color: rgba(16, 24, 40, 0.06);
    border-right-color: rgba(16, 24, 40, 0.06);
    background:
      radial-gradient(circle at 50% -90%, rgba(214, 168, 79, 0.08), transparent 40%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(242, 239, 232, 0.99));
    box-shadow: 0 -10px 28px rgba(70, 55, 28, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }
}
