/*
 * Meetalent — Layout CSS: navbar, sidebar, footer
 * Step 3 redesign — 2026-07-11
 * Dipende da design-system.css (deve essere incluso prima)
 */

/* ============================================================
   UTILITÀ BASE
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   BOTTONI GLOBALI (usati in navbar e sidebar)
   ============================================================ */
.ml-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--ds-font-ui);
  font-weight: var(--ds-font-semibold);
  border-radius: var(--ds-radius-lg);
  transition: all var(--ds-transition-fast);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1;
}
.ml-btn--sm   { padding: 0.5rem 1rem;    font-size: var(--ds-text-sm); }
.ml-btn--md   { padding: 0.625rem 1.25rem; font-size: var(--ds-text-base); }

.ml-btn--primary {
  background: var(--ds-brand-600);
  color: #fff;
  border-color: var(--ds-brand-600);
}
.ml-btn--primary:hover {
  background: var(--ds-brand-700);
  border-color: var(--ds-brand-700);
  color: #fff;
}

.ml-btn--outline {
  background: transparent;
  color: var(--ds-brand-600);
  border-color: var(--ds-brand-600);
}
.ml-btn--outline:hover {
  background: var(--ds-brand-50);
  color: var(--ds-brand-700);
}

/* ============================================================
   NAVBAR FRONTEND
   ============================================================ */
.ml-navbar {
  position: sticky;
  top: 0;
  z-index: var(--ds-z-sticky);
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--ds-transition-fast), border-color var(--ds-transition-fast);
}
.ml-navbar.is-scrolled {
  box-shadow: var(--ds-shadow-md);
  border-bottom-color: var(--ds-neutral-100);
}

.ml-navbar__inner {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 68px;
  gap: 2rem;
}

.ml-navbar__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ml-navbar__logo img {
  display: block;
  height: 36px;
  width: auto;
}

/* Desktop links */
.ml-navbar__links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
@media (min-width: 768px) {
  .ml-navbar__links { display: flex; }
}

.ml-nav-link {
  font-family: var(--ds-font-ui);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-700);
  padding: 0.375rem 0.625rem;
  border-radius: var(--ds-radius-md);
  text-decoration: none;
  position: relative;
  transition: color var(--ds-transition-fast), background var(--ds-transition-fast);
}
.ml-nav-link:hover {
  color: var(--ds-brand-600);
  background: var(--ds-brand-50);
}
.ml-nav-link.is-active {
  color: var(--ds-brand-600);
  font-weight: var(--ds-font-semibold);
}
.ml-nav-link.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.625rem;
  right: 0.625rem;
  height: 2px;
  background: var(--ds-brand-500);
  border-radius: 999px;
}

/* Right actions */
.ml-navbar__actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
@media (min-width: 768px) {
  .ml-navbar__actions { display: flex; }
}

.ml-navbar__social {
  display: inline-flex;
  align-items: center;
  color: var(--ds-neutral-500);
  transition: color var(--ds-transition-fast);
}
.ml-navbar__social:hover { color: var(--ds-brand-600); }

/* Hamburger button */
.ml-navbar__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  border-radius: var(--ds-radius-md);
  transition: background var(--ds-transition-fast);
}
.ml-navbar__hamburger:hover { background: var(--ds-brand-50); }

@media (min-width: 768px) {
  .ml-navbar__hamburger { display: none; }
}

.ml-navbar__hamburger span {
  display: block;
  height: 2px;
  background: var(--ds-neutral-700);
  border-radius: 999px;
  transition: transform var(--ds-transition-base), opacity var(--ds-transition-fast);
}
.ml-navbar__hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ml-navbar__hamburger.is-open span:nth-child(2) { opacity: 0; }
.ml-navbar__hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.ml-mobile-menu {
  position: fixed;
  inset: 0;
  top: 68px;
  z-index: calc(var(--ds-z-sticky) - 1);
  background: #fff;
  padding: 1.5rem;
  overflow-y: auto;
}
.ml-mobile-menu[hidden] { display: none; }

.ml-mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ml-mobile-link {
  display: block;
  padding: 0.875rem 1rem;
  font-family: var(--ds-font-ui);
  font-size: var(--ds-text-base);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-700);
  border-radius: var(--ds-radius-lg);
  text-decoration: none;
  transition: color var(--ds-transition-fast), background var(--ds-transition-fast);
}
.ml-mobile-link:hover,
.ml-mobile-link.is-active {
  color: var(--ds-brand-600);
  background: var(--ds-brand-50);
}
.ml-mobile-link--cta {
  margin-top: 1rem;
  text-align: center;
  background: var(--ds-brand-600);
  color: #fff !important;
  font-weight: var(--ds-font-semibold);
}
.ml-mobile-link--cta:hover { background: var(--ds-brand-700); }


/* ============================================================
   FOOTER FRONTEND
   ============================================================ */
.ml-footer {
  background: var(--ds-surface-sidebar);   /* #0f172a */
  color: var(--ds-neutral-300);
  font-family: var(--ds-font-body);
  margin-top: 5rem;
}

.ml-footer__body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

.ml-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 640px) {
  .ml-footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .ml-footer__grid { grid-template-columns: 2fr 1fr 1fr; gap: 4rem; }
}

/* Brand col */
.ml-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ml-footer__brand img { height: 32px; width: auto; }

.ml-footer__tagline {
  font-size: var(--ds-text-sm);
  color: var(--ds-neutral-400);
  line-height: var(--ds-leading-relaxed);
  margin: 0;
  max-width: 260px;
}

.ml-footer__social-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-400);
  text-decoration: none;
  transition: color var(--ds-transition-fast);
}
.ml-footer__social-icon:hover { color: var(--ds-brand-400); }

/* Nav / contact columns */
.ml-footer__col { display: flex; flex-direction: column; gap: 0.75rem; }

.ml-footer__col-title {
  font-family: var(--ds-font-ui);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-font-extrabold);
  color: var(--ds-neutral-500);
  text-transform: uppercase;
  letter-spacing: var(--ds-tracking-widest);
  margin: 0 0 0.25rem;
}

.ml-footer__link {
  font-size: var(--ds-text-sm);
  color: var(--ds-neutral-400);
  text-decoration: none;
  display: block;
  transition: color var(--ds-transition-fast);
  padding: 0.125rem 0;
}
.ml-footer__link:hover { color: var(--ds-brand-400); }

.ml-footer__contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ml-footer__contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: var(--ds-text-sm);
  color: var(--ds-neutral-400);
}
.ml-footer__contact-list svg { flex-shrink: 0; margin-top: 2px; }

/* Bottom bar */
.ml-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ml-footer__bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .ml-footer__bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.ml-footer__legal {
  font-size: var(--ds-text-xs);
  color: var(--ds-neutral-500);
  margin: 0;
  line-height: var(--ds-leading-relaxed);
}
.ml-footer__legal-links {
  display: flex;
  gap: 1.5rem;
}
.ml-footer__legal-links .ml-footer__link {
  font-size: var(--ds-text-xs);
  color: var(--ds-neutral-500);
}


/* ============================================================
   ADMIN HEADER
   ============================================================ */
.ml-admin-header {
  position: sticky;
  top: 0;
  z-index: var(--ds-z-sticky);
  background: #fff;
  border-bottom: 1px solid var(--ds-neutral-100);
  box-shadow: var(--ds-shadow-sm);
  font-family: var(--ds-font-ui);
}

.ml-admin-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 60px;
}

.ml-admin-header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ds-radius-md);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ds-neutral-600);
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast);
}
.ml-admin-header__toggle:hover { background: var(--ds-brand-50); color: var(--ds-brand-600); }

.ml-admin-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ml-admin-header__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ds-radius-md);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ds-neutral-600);
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast);
}
.ml-admin-header__icon-btn:hover { background: var(--ds-neutral-100); color: var(--ds-neutral-900); }
.ml-admin-header__icon-btn::after { display: none !important; } /* override BS5 dropdown arrow */

.ml-admin-header__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--ds-semantic-error);
  color: #fff;
  font-size: 10px;
  font-weight: var(--ds-font-bold);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Search dropdown */
.ml-admin-header__search-dropdown {
  min-width: 320px;
  padding: 0.75rem;
  border-radius: var(--ds-radius-xl);
  box-shadow: var(--ds-shadow-xl);
  border: 1px solid var(--ds-neutral-100);
}

/* General dropdown */
.ml-admin-header__dropdown {
  min-width: 240px;
  padding: 0.5rem 0;
  border-radius: var(--ds-radius-xl);
  box-shadow: var(--ds-shadow-xl);
  border: 1px solid var(--ds-neutral-100);
}

.ml-admin-dropdown__header {
  padding: 0.5rem 1rem 0.375rem;
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-font-extrabold);
  color: var(--ds-neutral-500);
  text-transform: uppercase;
  letter-spacing: var(--ds-tracking-widest);
}
.ml-admin-dropdown__body { padding: 0.25rem 0; }
.ml-admin-dropdown__empty {
  padding: 0.5rem 1rem;
  font-size: var(--ds-text-sm);
  color: var(--ds-neutral-400);
  margin: 0;
}
.ml-admin-dropdown__footer {
  padding: 0.5rem 1rem 0.25rem;
  border-top: 1px solid var(--ds-neutral-100);
  margin-top: 0.25rem;
  font-size: var(--ds-text-sm);
}
.ml-admin-dropdown__footer a { color: var(--ds-brand-600); text-decoration: none; }
.ml-admin-dropdown__footer a:hover { color: var(--ds-brand-700); }

.ml-admin-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: var(--ds-text-sm);
  color: var(--ds-neutral-700);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast);
}
.ml-admin-dropdown__item:hover { background: var(--ds-neutral-50); color: var(--ds-neutral-900); }
.ml-admin-dropdown__item--danger { color: var(--ds-semantic-error); }
.ml-admin-dropdown__item--danger:hover { background: #fef2f2; color: var(--ds-semantic-error); }

.ml-admin-dropdown__divider { height: 1px; background: var(--ds-neutral-100); margin: 0.25rem 0; }
.ml-admin-dropdown__logout-form { margin: 0; }

/* User pill */
.ml-admin-header__user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: none;
  border: 1px solid var(--ds-neutral-150, #e5e7eb);
  cursor: pointer;
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-700);
  transition: background var(--ds-transition-fast);
}
.ml-admin-header__user:hover { background: var(--ds-neutral-50); }
.ml-admin-header__user::after { display: none !important; }

.ml-admin-header__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--ds-brand-100);
}
.ml-admin-header__user-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   ADMIN SIDEBAR
   ============================================================ */
.ml-admin-sidebar {
  background: var(--ds-surface-sidebar);   /* #0f172a */
  color: var(--ds-neutral-300);
  width: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: width var(--ds-transition-base);
  font-family: var(--ds-font-ui);
}

/* Logo area */
.ml-admin-sidebar__logo {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 60px;
}
.ml-admin-sidebar__logo img { height: 32px; width: auto; }

/* Nav */
.ml-admin-sidebar__nav { flex: 1; overflow-y: auto; padding: 1rem 0; }
.ml-admin-sidebar__nav ul { list-style: none; padding: 0; margin: 0; }

.ml-admin-sidebar__nav li > a,
.ml-admin-sidebar__nav li > button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-400);
  text-decoration: none;
  border-radius: 0;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast);
  border-left: 3px solid transparent;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  width: 100%;
}
.ml-admin-sidebar__nav li > a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--ds-neutral-100);
  border-left-color: var(--ds-brand-500);
}

.ml-admin-sidebar__nav li.ml-sidebar-active > a {
  background: rgba(5,150,105,0.15);
  color: var(--ds-brand-400);
  border-left-color: var(--ds-brand-500);
  font-weight: var(--ds-font-semibold);
}

.ml-admin-sidebar__nav li > a svg { flex-shrink: 0; opacity: 0.7; }
.ml-admin-sidebar__nav li.ml-sidebar-active > a svg,
.ml-admin-sidebar__nav li > a:hover svg { opacity: 1; }

/* Sub-menu */
.ml-admin-sidebar__nav .sub-menu {
  list-style: none;
  padding: 0.25rem 0 0.25rem 3rem;
  margin: 0;
  background: rgba(0,0,0,0.15);
}
.ml-admin-sidebar__nav .sub-menu li > a {
  padding: 0.375rem 1rem;
  font-size: var(--ds-text-xs);
  color: var(--ds-neutral-500);
  border-left: none;
}
.ml-admin-sidebar__nav .sub-menu li > a:hover { color: var(--ds-neutral-200); background: none; }


/* ============================================================
   CANDIDATE SIDEBAR
   ============================================================ */
.ml-candidate-sidebar {
  background: #fff;
  border: 1px solid var(--ds-neutral-100);
  border-radius: var(--ds-radius-2xl);
  box-shadow: var(--ds-shadow-sm);
  overflow: hidden;
  font-family: var(--ds-font-ui);
  display: flex;
  flex-direction: column;
}

/* Profile block */
.ml-candidate-sidebar__profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(160deg, var(--ds-brand-50) 0%, #fff 80%);
  border-bottom: 1px solid var(--ds-neutral-100);
  gap: 0.75rem;
}

.ml-candidate-sidebar__avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
}
.ml-candidate-sidebar__avatar {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--ds-shadow-md);
  display: block;
}
.ml-candidate-sidebar__avatar-upload {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ds-brand-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ds-transition-fast);
  border: 2px solid #fff;
}
.ml-candidate-sidebar__avatar-upload:hover { background: var(--ds-brand-700); }

.ml-candidate-sidebar__info { text-align: center; }
.ml-candidate-sidebar__name {
  font-size: var(--ds-text-base);
  font-weight: var(--ds-font-semibold);
  color: var(--ds-neutral-900);
  margin: 0;
}
.ml-candidate-sidebar__role {
  font-size: var(--ds-text-sm);
  color: var(--ds-neutral-500);
  margin: 0.125rem 0 0;
}

/* Nav items */
.ml-candidate-sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  flex: 1;
}

.ml-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-600);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast), border-color var(--ds-transition-fast);
}
.ml-sidebar-item:hover {
  background: var(--ds-brand-50);
  color: var(--ds-brand-700);
  border-left-color: var(--ds-brand-300);
}
.ml-sidebar-item.is-active {
  background: var(--ds-brand-50);
  color: var(--ds-brand-600);
  font-weight: var(--ds-font-semibold);
  border-left-color: var(--ds-brand-500);
}
.ml-sidebar-item svg { flex-shrink: 0; opacity: 0.65; }
.ml-sidebar-item:hover svg,
.ml-sidebar-item.is-active svg { opacity: 1; }

/* Footer / logout */
.ml-candidate-sidebar__footer {
  border-top: 1px solid var(--ds-neutral-100);
  padding: 1rem 1.25rem;
}
.ml-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0;
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-font-medium);
  color: var(--ds-neutral-500);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--ds-transition-fast);
}
.ml-sidebar-logout:hover { color: var(--ds-semantic-error); }
