/* App top bar (templates/includes/app_nav.html) and the students' phone tab bar (includes/app_tabbar.html).
   Loaded after styles_landing.css so these rules win over its generic .navbar ones.
   One light bar for every profile; the active profile only tints the avatar, the role chip, the active link
   and the 3 px line under the bar. */

.app-nav {
  --role: #0d6efd;
  --role-soft: rgba(13, 110, 253, 0.1);
  background: #fff;
  border-bottom: 3px solid var(--role);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
  padding: 0.45rem 0;
}

.app-nav[data-role="student"] {
  --role: #198754;
  --role-soft: rgba(25, 135, 84, 0.12);
}

.app-nav[data-role="coordinator"] {
  --role: #4a2f8f;
  --role-soft: rgba(74, 47, 143, 0.12);
}

.app-nav[data-role="administrator"] {
  --role: #212529;
  --role-soft: rgba(33, 37, 41, 0.1);
}

/* project.css gives every .btn-sm a 140 px minimum width; the bar's small buttons size to their content. */
.app-nav .btn-sm {
  min-width: 0;
}

/* Brand */
.app-nav .app-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.app-nav-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #005ab4, #2c73d2);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

/* Links */
.app-nav .app-nav-links .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #475569;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 0.6rem;
  transition: background-color 0.15s, color 0.15s;
}

.app-nav .app-nav-links .nav-link:hover,
.app-nav .app-nav-links .nav-link:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
}

.app-nav .app-nav-links .nav-link.active {
  background: var(--role-soft);
  color: var(--role);
  font-weight: 600;
}

/* Menus */
.app-nav .dropdown-menu {
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  padding: 0.5rem;
}

.app-nav .dropdown-item {
  border-radius: 0.55rem;
  padding: 0.45rem 0.75rem;
}

.app-nav .dropdown-item.active,
.app-nav .dropdown-item:active {
  background: var(--role-soft);
  color: var(--role);
}

/* Reports: analyses | downloads, each item with a one-line hint */
.app-nav-mega-col {
  min-width: 0;
}

.app-nav .app-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  white-space: normal;
}

.app-nav-item-icon {
  flex: 0 0 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 1rem;
}

.app-nav-item-icon .rac360-icon {
  width: 20px;
  height: 20px;
}

.app-nav-item-icon.is-rac { background: #ede9fe; color: #6d28d9; }
.app-nav-item-icon.is-trends { background: #d1fae5; color: #047857; }
.app-nav-item-icon.is-xray { background: #ffedd5; color: #c2410c; }
.app-nav-item-icon.is-stats { background: #e0f2fe; color: #0369a1; }
.app-nav-item-icon.is-dims { background: #dbeafe; color: #1d4ed8; }

.app-nav-item-title {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.app-nav-item-hint {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
}

/* Right side: new project, bell, avatar */
.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.app-nav .app-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
}

.app-nav .nav-link {
  color: #475569;
}

.app-nav .app-nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.35rem;
}

.app-nav .app-nav-user::after {
  display: none;
}

.app-nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--role);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.app-nav-role {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--role-soft);
  color: var(--role);
}

.app-nav-user-menu {
  min-width: 250px;
}

.app-nav-user-head {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.75rem 0.5rem;
}

.app-nav-user-head small {
  color: #64748b;
}

.app-nav-langs {
  display: flex;
  gap: 0.35rem;
  padding: 0.15rem 0.75rem 0.4rem;
}

.app-nav-langs form {
  margin: 0;
}

.app-nav .navbar-toggler {
  border: 0;
  padding: 0.25rem 0.4rem;
  font-size: 1.5rem;
  color: #0f172a;
  box-shadow: none;
}

@media (min-width: 992px) {
  .app-nav .navbar-collapse {
    margin-left: 1.25rem;
  }

  .app-nav-mega {
    display: none;
    width: 560px;
  }

  .app-nav-mega.show {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 991.98px) {
  .app-nav .navbar-collapse {
    order: 9;
    padding-top: 0.5rem;
  }

  .app-nav .app-nav-links .nav-link {
    width: 100%;
  }

  .app-nav .dropdown-menu {
    box-shadow: none;
    background: #f8fafc;
  }
}

@media (max-width: 575.98px) {
  .app-nav-cta-label,
  .app-nav-role {
    display: none;
  }
}

/* Students' phone tab bar */
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0 0.5rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
}

.app-tab i {
  font-size: 1.3rem;
}

.app-tab.active {
  color: #198754;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  body.has-tabbar {
    padding-bottom: 76px;
  }
}

#my-badges {
  scroll-margin-top: 90px;
}
