/*
 * Navigation menus (views/layouts/main.php, behaviour in assets/js/nav.js).
 * Courses, Test Series, Placement and Resources open a panel: plain names on the left, and a card for the
 * hovered item on the right (it shows the latest added item until something is hovered).
 * The two-row bar (primary links plus quick links below) keeps the original --nav-h values from app.css.
 */
.nav__links { gap: 2px; }
.nav__dropdown-wrap { position: relative; }

/* ── panel shell ── */
.nav__panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 500; display: grid; grid-template-columns: minmax(0, 1fr) 272px; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 70px -18px rgba(15, 23, 42, .32), 0 2px 10px rgba(15, 23, 42, .08);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px) scale(.985); transform-origin: top left;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1), visibility .18s;
}
.nav__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }   /* hover bridge */
.nav__dropdown-wrap:hover .nav__panel, .nav__dropdown-wrap:focus-within .nav__panel { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.nav__dropdown-wrap:hover .nav__chevron { transform: rotate(180deg); }
.nav__panel--courses { width: 920px; }
.nav__panel--tests { width: 560px; }
.nav__panel--guides { width: 620px; }
.nav__panel--resources { width: 560px; }

/* ── left: names ── */
.nav__lists { padding: 20px 10px 8px 20px; display: grid; gap: 4px 14px; min-width: 0; align-content: start; }
.nav__lists--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav__lists--2, .nav__lists--1 { grid-template-columns: minmax(0, 1fr); }
.nav__col { min-width: 0; }
.nav__col-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 8px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.nav__col-title::after { content: ""; flex: 1; height: 1px; background: var(--border); margin-right: 8px; }
.nav__col-title:hover { color: var(--accent); }
.nav__list2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }

.nav__item {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 2px; border-radius: 12px; text-decoration: none; color: var(--text-primary);
  opacity: 0; transform: translateY(8px);
  transition: background .15s ease, color .15s ease, opacity .28s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
  transition-delay: 0s, 0s, calc(var(--i, 0) * 30ms + 50ms), calc(var(--i, 0) * 30ms + 50ms);
}
.nav__dropdown-wrap:hover .nav__item, .nav__dropdown-wrap:focus-within .nav__item { opacity: 1; transform: none; }
.nav__item::after {
  content: ""; width: 7px; height: 7px; margin-left: auto; flex: none; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg) translate(-6px, 6px); opacity: 0;
  transition: opacity .15s ease, transform .2s ease;
}
.nav__item:hover, .nav__item:focus-visible { background: var(--accent-light); color: var(--accent); outline: none; transition-delay: 0s; }
.nav__item:hover::after, .nav__item:focus-visible::after { opacity: .9; transform: rotate(45deg) translate(0, 0); }
.nav__name { min-width: 0; font-size: .9rem; font-weight: 650; line-height: 1.3; }
.nav__item em { flex: none; font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-light); padding: 2px 7px; border-radius: 99px; }
.nav__item:hover em { background: var(--bg-card); }

/* ── right: the card ── */
.nav__card {
  display: flex; flex-direction: column; gap: 6px; margin: 14px 14px 8px 4px; padding: 12px; border-radius: 16px; text-decoration: none; color: var(--text-primary);
  background: linear-gradient(160deg, var(--bg-secondary), var(--bg-card)); border: 1px solid var(--border);
  transition: opacity .16s ease, transform .16s ease, border-color .15s ease, box-shadow .15s ease;
}
.nav__card:hover { border-color: var(--accent); box-shadow: 0 14px 28px -18px rgba(13, 110, 86, .6); }
.nav__card.is-swap { opacity: 0; transform: translateY(6px); }
.nav__card-img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; border-radius: 11px; overflow: hidden; background: linear-gradient(135deg, #064e3b, #10b981); }
.nav__card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.nav__card:hover .nav__card-img img { transform: scale(1.05); }
.nav__card-img b { font-size: 2.2rem; font-weight: 800; color: rgba(255, 255, 255, .92); }
.nav__card-tag { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 99px; background: rgba(15, 23, 42, .72); color: #fff; font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nav__card-title { font-size: .98rem; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.nav__card-sub { font-size: .76rem; line-height: 1.45; color: var(--text-secondary); min-height: 3.2em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nav__card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }
.nav__card-meta { font-style: normal; font-size: .8rem; font-weight: 800; color: var(--accent); }
.nav__card-cta { font-size: .78rem; font-weight: 700; color: var(--accent); }

.nav__panel-foot { grid-column: 1 / -1; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.nav__panel-foot a { font-size: .85rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.nav__panel-foot a:hover { text-decoration: underline; }

@media (max-width: 1180px) {
  .nav__panel--courses { width: 760px; grid-template-columns: minmax(0, 1fr) 232px; }
  .nav__panel--guides, .nav__panel--tests, .nav__panel--resources { width: 520px; grid-template-columns: minmax(0, 1fr) 224px; }
}
@media (max-width: 980px) {
  .nav__dropdown-wrap:nth-last-of-type(1) .nav__panel { left: auto; right: 0; transform-origin: top right; }
}
@media (prefers-reduced-motion: reduce) {
  .nav__panel, .nav__item, .nav__card, .nav__card-img img { transition: none; }
  .nav__item { opacity: 1; transform: none; }
}

/* ── search: icon in the bar, floating panel on click ── */
.nav__searchbtn {
  width: 38px; height: 38px; margin-left: auto; padding: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}
.nav__searchbtn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); transform: translateY(-1px); }
.nav__searchbtn:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }
.sx { position: fixed; inset: 0; z-index: 3000; display: flex; justify-content: center; align-items: flex-start; padding: 84px 16px 16px; }
.sx[hidden] { display: none; }
.sx__backdrop { position: absolute; inset: 0; background: rgba(8, 15, 30, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: sxFade .18s ease both; }
.sx__card { position: relative; width: 100%; max-width: 520px; border-radius: 14px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 24px 60px -18px rgba(2, 8, 23, .5); animation: sxIn .2s cubic-bezier(.2, .8, .2, 1) both; }
.sx__form { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
.sx__ico { flex: none; width: 18px; height: 18px; color: var(--text-muted); }
.sx__form input { flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; font: inherit; font-size: .94rem; color: var(--text-primary); }
.sx__form input::placeholder { color: var(--text-muted); }
.sx__form input::-webkit-search-cancel-button { display: none; }
.sx__go { flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; font-size: .8rem; color: #fff; background: var(--accent); }
.sx__go:hover { filter: brightness(1.08); }
.sx__x { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sx__x:hover { background: var(--bg-secondary); color: var(--text-primary); }
.sx__body { padding: 10px 14px 4px; }
.sx__label { margin: 0 0 6px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.sx__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sx__chips a { padding: 4px 11px; border-radius: 999px; background: var(--bg-secondary); border: 1px solid var(--border); font-size: .78rem; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: all .15s ease; }
.sx__chips a:hover { border-color: var(--accent); color: var(--accent); }
.sx__links { display: flex; flex-direction: column; margin: 0 -6px 6px; }
.sx__links a { display: flex; align-items: baseline; gap: 10px; padding: 7px 8px; border-radius: 8px; text-decoration: none; transition: background .15s ease; }
.sx__links a:hover { background: var(--bg-secondary); }
.sx__links b { font-size: .84rem; font-weight: 600; color: var(--text-primary); }
.sx__links small { font-size: .75rem; color: var(--text-muted); }
.sx__hint { margin: 0; padding: 8px 14px; border-top: 1px solid var(--border); font-size: .7rem; color: var(--text-muted); background: var(--bg-secondary); }
.sx__hint kbd { padding: 0 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-card); font: inherit; font-size: .68rem; font-weight: 600; color: var(--text-secondary); }
@keyframes sxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sxIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .sx { padding-top: 64px; } .sx__hint { display: none; } }

/* ── sign in ── */
.nav__signin {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px 0 14px; border-radius: 999px; text-decoration: none; white-space: nowrap; flex: none;
  font-size: .86rem; font-weight: 700; letter-spacing: .01em; color: #fff; background: linear-gradient(135deg, #0d6e56 0%, #10b981 100%);
  box-shadow: 0 10px 22px -12px rgba(13, 110, 86, .95), inset 0 1px 0 rgba(255, 255, 255, .22); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.nav__signin:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 26px -12px rgba(13, 110, 86, 1), inset 0 1px 0 rgba(255, 255, 255, .22); }
.nav__signin:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }
.nav__signin svg { flex: none; }
@media (max-width: 420px) { .nav__signin { padding: 0 12px 0 10px; height: 36px; gap: 6px; font-size: .8rem; } }

/* ── WhatsApp floating button ── */
.wa-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 940; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none;
  background: transparent; box-shadow: none; transition: transform .18s ease, box-shadow .18s ease;
}
.wa-fab img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(18, 140, 126, .45)); }
.wa-fab::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25d366; z-index: -1; animation: waPulse 2.6s ease-out infinite; }
.wa-fab:hover { transform: scale(1.07); box-shadow: 0 16px 30px -8px rgba(18, 140, 126, .85); }
.wa-fab--raised { bottom: 84px; }                       /* the feedback button sits at the corner for signed-in users */
.wa-fab__tip {
  position: absolute; right: 68px; top: 50%; padding: 7px 12px; border-radius: 10px; background: #0f172a; color: #fff; font-size: .78rem; font-weight: 600; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(8px, -50%); transition: opacity .18s ease, transform .18s ease;
}
.wa-fab:hover .wa-fab__tip, .wa-fab:focus-visible .wa-fab__tip { opacity: 1; transform: translate(0, -50%); }
@keyframes waPulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
@media (max-width: 640px) {
  .wa-fab { right: 14px; bottom: 84px; width: 52px; height: 52px; }
  .wa-fab--raised { bottom: 148px; }
  .wa-fab__tip { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wa-fab::before, .sx__card, .sx__backdrop { animation: none; } .wa-fab, .wa-fab__tip, .sx * { transition: none; } }

/* Tablets and small laptops: the full menu does not fit, so use the menu button (drawer) instead of a half-hidden bar */
@media (max-width: 1024px) {
  .nav__links { display: none !important; }
  .nav__hamburger { display: flex !important; }
}

/* main menu items inside the second row (tablets and phones only) */
.nav__subnav-main { display: none !important; }
.nav__subnav-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--border-strong, var(--border)); flex: none; }
@media (max-width: 1024px) {
  .nav__subnav-main.nav__subnav-link { display: inline-flex !important; font-weight: 700; color: var(--text-primary); }
  .nav__subnav-main.nav__subnav-link--active { color: var(--accent); }
  .nav__subnav-sep.nav__subnav-main { display: block !important; }
  .nav__subnav-scroll { justify-content: flex-start !important; }
}

/* Tablets and phones: free space sits between the logo and the right-hand group, so coin + search + icons stay right-aligned */
@media (max-width: 1024px) {
  .nav__actions { margin-left: 0 !important; }
}

/* SAP: dedicated item, panel footer link, phone drawer tile */
.nav__panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nav__panel-foot .nav__panel-sap { color: var(--accent); font-weight: 700; }
.nav__mobile-tile--sap { grid-column: 1 / -1; }
