/* ============================================================
   RankVision — Nav Header CSS (nav-header.css)
   All header/nav/mega-menu styles in one place.
   ============================================================ */

/* ── Platform Bar ─────────────────────────────────────────── */
.platform-bar {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  height: 28px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.pbar-inner { display: flex; align-items: center; gap: 0.35rem; }
.pbar-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--primary); flex-shrink: 0; margin-right: 4px; }
.pbar-spacer { flex: 1; }
.pbar-vebnox { display: flex; align-items: center; gap: 4px; font-size: 0.62rem; font-weight: 600; color: var(--text-dim); transition: color 0.15s; }
.pbar-vebnox:hover { color: var(--primary); }

/* ── Premium CSS Logo ──────────────────────────────────────────── */
.rv-logo {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-right: 4px;
}
.rv-css-logo {
  position: relative;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #019cd4 0%, #004d70 100%);
  border-radius: 9px;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 3px; padding-bottom: 7px;
  box-shadow: 0 4px 14px rgba(1, 156, 212, 0.45), inset 0 2px rgba(255,255,255,0.25);
  overflow: hidden;
}
.rv-css-logo::before {
  content: ''; position: absolute; inset: -50%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 60%);
  animation: logoRotate 4s linear infinite;
  pointer-events: none;
}
@keyframes logoRotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.rv-logo-bar {
  width: 4px;
  background: #fff; border-radius: 2px;
  position: relative; z-index: 1;
  box-shadow: 0 0 6px rgba(255,255,255,0.7);
  animation: barPulse 1.8s ease-in-out infinite alternate;
  transform-origin: bottom;
}
.rv-logo-bar-1 { height: 7px; animation-delay: 0s; }
.rv-logo-bar-2 { height: 12px; animation-delay: 0.3s; }
.rv-logo-bar-3 { height: 17px; animation-delay: 0.6s; }
@keyframes barPulse {
  0% { transform: scaleY(0.75); opacity: 0.7; }
  100% { transform: scaleY(1); opacity: 1; }
}

.nav-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav-logo-name { font-size: 1rem; font-weight: 900; letter-spacing: -0.3px; color: var(--text); }
.nav-logo-tag  { font-size: 0.52rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: var(--primary); margin-top: 1px; }

/* ── Nav Link Base ─────────────────────────────────────────── */
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-md);
  border: none; background: transparent; cursor: pointer;
  transition: color 0.14s, background 0.14s;
  white-space: nowrap; text-decoration: none;
}
.nav-link svg { flex-shrink: 0; width: 13px; height: 13px; }
.nav-link:hover { color: var(--text); background: var(--bg-3); }
.nav-link.active { color: var(--text); background: var(--bg-3); }
.nav-link .chevron { width: 10px; height: 10px; transition: transform 0.2s; margin-left: 1px; }

/* Dropdown open state chevron */
.nav-dropdown-wrap.open .nav-link .chevron { transform: rotate(180deg); }

/* Advisor link */
.nav-advisor-link { color: var(--primary); }
.nav-advisor-link:hover { background: var(--primary-glass); }

/* ── Dropdown Wrap ─────────────────────────────────────────── */
.nav-dropdown-wrap { position: relative; }

/* ── Mega Menu Shared ──────────────────────────────────────── */
.nav-megamenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(1,156,212,0.05);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 300;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.nav-megamenu.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Wide 3-col menu */
.nav-megamenu-wide { min-width: min(860px, 96vw); }

/* Standard 2-col menu */
.mm-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.mm-grid-2col .mm-col + .mm-col { border-left: 1px solid var(--border); padding-left: 1.25rem; }

/* 3-col grid */
.mm-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 0 0.75rem; }
.mm-col { padding: 0.25rem 0; }
.mm-grid-3 .mm-col { padding-right: 0.5rem; }
.mm-grid-3 .mm-col + .mm-col { border-left: 1px solid var(--border); padding-left: 1rem; }

/* Column title */
.mm-col-title {
  font-size: 0.62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--primary); padding: 0.3rem 0.6rem 0.4rem;
  display: flex; align-items: center; gap: 5px;
}

/* Item */
.mm-item {
  display: flex; align-items: center; gap: 9px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--r-md);
  font-size: 0.8rem; color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
  text-decoration: none;
}
.mm-item:hover { background: var(--bg-3); color: var(--text); }
.mm-item-icon {
  width: 30px; height: 30px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mm-item-icon svg { width: 14px; height: 14px; }
.mm-item-text { min-width: 0; }
.mm-item-text strong { display: flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text); font-size: 0.76rem; white-space: nowrap; }
.mm-item-text span   { font-size: 0.64rem; color: var(--text-dim); display: block; }
.mm-divider { height: 1px; background: var(--border); margin: 0.3rem 0.5rem; }
.mm-coming  { opacity: 0.45; pointer-events: none; }
.mm-featured { background: var(--primary-glass); border: 1px solid var(--primary-border); }
.mm-badge-new {
  display: inline-flex; align-items: center;
  background: var(--primary); color: #fff;
  font-size: 0.5rem; font-weight: 800;
  padding: 1px 5px; border-radius: 99px;
  letter-spacing: 0.06em; text-transform: uppercase;
  flex-shrink: 0;
}

/* Search in mega menu */
.mm-search-wrap { position: relative; margin-bottom: 0.5rem; }
.mm-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; color: var(--text-dim); pointer-events: none; }
.mm-search-input {
  width: 100%;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); color: var(--text);
  font-size: 0.76rem; font-family: inherit;
  padding: 0.4rem 0.6rem 0.4rem 1.65rem;
  outline: none; transition: border-color 0.15s;
}
.mm-search-input:focus { border-color: var(--primary); }

.mm-inst-filters { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.mm-type-btn {
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-full);
  font-size: 0.62rem; font-weight: 700;
  border: 1px solid var(--border-2);
  background: var(--bg-4); color: var(--text-muted);
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.mm-type-btn:hover { border-color: var(--primary); color: var(--primary); }
.mm-type-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.mm-inst-results {
  max-height: 180px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-3); margin-bottom: 0.5rem;
  scrollbar-width: thin;
}
.mm-inst-results::-webkit-scrollbar { width: 4px; }
.mm-inst-results::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.mm-inst-placeholder { padding: 0.6rem 0.75rem; font-size: 0.7rem; color: var(--text-dim); text-align: center; }
.mm-loading::after { content: ''; display: inline-block; width: 8px; height: 8px; border: 1.5px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; margin-left: 5px; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.mm-inst-item {
  display: flex; align-items: center; gap: 7px;
  padding: 0.4rem 0.7rem; font-size: 0.72rem; color: var(--text-muted);
  transition: background 0.1s; cursor: pointer;
  border-bottom: 1px solid var(--border); text-decoration: none;
}
.mm-inst-item:last-child { border-bottom: none; }
.mm-inst-item:hover { background: var(--bg-4); color: var(--text); }
.mm-inst-badge {
  font-size: 0.54rem; font-weight: 800;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.mm-inst-badge.IIT  { background:rgba(1,156,212,0.15);  color:var(--primary); }
.mm-inst-badge.NIT  { background:rgba(129,140,248,0.18); color:#818cf8; }
.mm-inst-badge.IIIT { background:rgba(245,158,11,0.15);  color:#f59e0b; }
.mm-inst-badge.GFTI { background:rgba(107,114,128,0.15); color:#9ca3af; }
.mm-inst-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-inst-loc  { font-size: 0.58rem; color: var(--text-dim); flex-shrink: 0; }
.mm-view-all  { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 0.68rem; font-weight: 600; color: var(--primary); padding: 0.1rem 0; transition: gap 0.15s; text-decoration: none; }
.mm-view-all:hover { gap: 8px; }

/* ── Nav Actions ────────────────────────────────────────────── */
.theme-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; cursor: pointer; flex-shrink: 0;
}
.theme-btn:hover { background: var(--bg-4); color: var(--text); }
.theme-btn svg { width: 14px; height: 14px; }

.nav-predict-btn {
  background: var(--primary); color: #fff;
  padding: 0.38rem 0.85rem;
  border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 700;
  transition: all 0.18s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  text-decoration: none; flex-shrink: 0;
}
.nav-predict-btn:hover { background: #0289bc; box-shadow: 0 3px 12px var(--primary-glow); }
.nav-predict-btn svg { width: 13px; height: 13px; }

.hamburger {
  display: none; width: 30px; height: 30px;
  border-radius: var(--r-xs); background: var(--bg-3);
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; flex-shrink: 0;
}
.hamburger svg { width: 16px; height: 16px; }

/* ── Mobile Nav ────────────────────────────────────────────── */
.mobile-nav {
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg-1);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto; max-width: 300px;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-head {
  display: flex; align-items: center; gap: 9px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border); font-weight: 900;
}
.mobile-nav-close {
  margin-left: auto; width: 28px; height: 28px;
  border-radius: 50%; background: var(--bg-4);
  border: 1px solid var(--border-2); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mobile-nav-close:hover { background: var(--dream); color: #fff; }
.mobile-nav-close svg { width: 14px; height: 14px; }

.mobile-nav-links { flex: 1; padding: 0.6rem; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-links a {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; font-weight: 600;
  padding: 0.65rem 0.875rem;
  border-radius: var(--r-md); color: var(--text);
  transition: background 0.12s; text-decoration: none;
}
.mobile-nav-links a:hover { background: var(--bg-3); }
.mobile-nav-links a svg { width: 15px; height: 15px; stroke-width: 1.8; color: var(--primary); flex-shrink: 0; }
.mobile-nav-featured { background: var(--primary-glass) !important; border: 1px solid var(--primary-border); }

.mobile-nav-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

.mobile-nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 399;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
.mobile-nav-overlay.active { display: block; }

/* ── Mobile Nav Accordion ──────────────────────────────────── */
.mob-link {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; font-weight: 600;
  padding: 0.65rem 0.875rem;
  border-radius: var(--r-md); color: var(--text);
  transition: background 0.12s; text-decoration: none;
}
.mob-link:hover { background: var(--bg-3); }
.mob-link svg { width: 15px; height: 15px; stroke-width: 1.8; color: var(--primary); flex-shrink: 0; }

.mob-group + .mob-group,
.mob-link + .mob-group,
.mob-group + .mob-link { margin-top: 2px; }

.mob-group-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  font-size: 0.88rem; font-weight: 600;
  padding: 0.65rem 0.875rem;
  border-radius: var(--r-md); color: var(--text);
  background: transparent; border: none; cursor: pointer;
  transition: background 0.12s;
}
.mob-group-btn:hover { background: var(--bg-3); }
.mob-group-btn svg:first-child { width: 15px; height: 15px; stroke-width: 1.8; color: var(--primary); flex-shrink: 0; }
.mob-group-btn .mob-chevron { width: 12px; height: 12px; margin-left: auto; transition: transform 0.2s; color: var(--text-dim); flex-shrink: 0; }
.mob-group-btn.open .mob-chevron { transform: rotate(180deg); }

.mob-group-items {
  display: none;
  flex-direction: column;
  padding: 0 0 0.5rem 0;
  border-left: 2px solid var(--primary-border);
  margin: 2px 0.875rem 4px;
}
.mob-group-items.open { display: flex; }

.mob-sub-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm); color: var(--text-muted);
  transition: background 0.1s, color 0.1s; text-decoration: none;
}
.mob-sub-link:hover { background: var(--bg-3); color: var(--text); }
.mob-sub-link svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--primary); }
.mob-sub-featured { color: var(--primary); }
.mob-sub-featured:hover { background: var(--primary-glass); }

.mob-sub-label {
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-dim);
  padding: 0.5rem 0.75rem 0.25rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1050px) {
  .nav-links { gap: 0; }
  .nav-link { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
}
@media (max-width: 950px) {
  .nav-predict-btn { display: none !important; }
}
@media (max-width: 850px) {
  .nav-links { display: none !important; }
  .hamburger { display: flex !important; }
}
@media (max-width: 500px) {
  .nav-logo-tag { display: none; }
  .pbar-vebnox  { display: none; }
}
