/* ============================================================================
   navbars/breadcrumbs.css
   Breadcrumb trail — data-navbar version + legacy #breadcrumb-container
   ============================================================================ */


/* ===== 1. BREADCRUMBS NAVBAR (data-navbar) ===== */
[data-navbar="breadcrumbs"] {
  position: sticky;
  top: 3.5rem;
  left: 0;
  right: 0;
  z-index: 90;
  pointer-events: none;

  .trail {
    pointer-events: auto;
    background: rgba(var(--bgBreadcrumbs, 24 24 24) / 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(var(--borderNavs, 255 255 255) / 0.85);
    height: 2.5rem;
    overflow: hidden;
    transition:
      height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease,
      border-color 0.3s ease;
    opacity: 1;
  }

  .wrap {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
  }

  .items {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;

    .item,
    .sep {
      display: inline-flex;
      align-items: center;
      white-space: nowrap;
      overflow: hidden;
      /* Staggered entrance — delay from --i */
      opacity: 0;
      filter: blur(4px);
      animation: breadcrumbFocusIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i) * 0.07s) forwards;
      transition:
        max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.3s ease,
        margin 0.3s ease;
    }

    .item {
      color: rgba(var(--text-secondary, 150 150 150) / 0.85);
      text-decoration: none;
      cursor: pointer;
      padding: 0.2rem 0.4rem;
      border-radius: 0.25rem;
      max-width: 200px;
      /* Refined text rendering for crispness alongside blur */
      -webkit-font-smoothing: antialiased;

      &:hover {
        color: rgba(var(--text-primary, 255 255 255) / 1);
        background: rgba(255 255 255 / 0.05);
      }

      &.active {
        color: rgba(var(--text-primary, 255 255 255) / 1);
        font-weight: 600;
        cursor: default;
        pointer-events: none;
        /* The focus glow — subtle, professional luminance */
        text-shadow: 0 0 8px rgba(255 255 255 / 0.25),
                     0 0 16px rgba(255 255 255 / 0.1);
      }

      /* ---------- Removal: blur out + fade ---------- */
      &.removing {
        animation: breadcrumbFocusOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        max-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        pointer-events: none;
      }
    }

    .sep {
      color: rgba(var(--text-tertiary, 100 100 100) / 0.6);
      font-size: 0.75rem;
      user-select: none;
      margin: 0 0.25rem;
      max-width: 15px;
      /* Override the default item animation for a horizontal wipe */
      animation: breadcrumbSepWipeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i) * 0.07s) forwards;

      &.removing {
        animation: breadcrumbSepWipeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        max-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
      }
    }
  }

  /* Toggle & collapsed state */
  .toggle {
    pointer-events: auto;
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    
/**    
    background: rgba(var(--bg-surface, 24 24 24) / 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(var(--border, 255 255 255) / 0.06);
    border-top: none;
**/
    
    color: rgba(var(--text-secondary, 150 150 150) / 0.8);
    width: 2.5rem;
    height: 1rem;
    
/*    border-radius: 0 0 0.5rem 0.5rem; */
    
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    
/*    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); */

    .chevron {
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    &:hover {
      color: rgba(var(--text-primary, 255 255 255) / 1);
      height: 1.15rem;
      bottom: -1.15rem;
    }
  }

  &.hide {
    .trail {
      height: 0;
      opacity: 0;
      border-bottom-color: transparent;
    }

    .toggle {
      bottom: -1rem;

  /**
      background: rgba(var(--bgBody, 18 18 18) / 0.85);
      border-top: 1px solid rgba(var(--borderPrimary, 255 255 255) / 0.08);
  **/

      .chevron {
        transform: rotate(180deg);
      }

      &:hover {
        height: 1.15rem;
        bottom: -1.15rem;
      }
    }
  }
}


/* ===== 2. BLUR & FOCUS KEYFRAMES ===== */
/* Items — clarity emerging from soft blur */
@keyframes breadcrumbFocusIn {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

/* Items — gracefully recede into blur */
@keyframes breadcrumbFocusOut {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  100% {
    opacity: 0;
    filter: blur(5px);
    transform: scale(0.98);
  }
}

/* Separators — wipe from left to right (entry) */
@keyframes breadcrumbSepWipeIn {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* Separators — wipe out to the right (exit) */
@keyframes breadcrumbSepWipeOut {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
}


/* ===== 3. LEGACY BREADCRUMB CONTAINER (#breadcrumb-container) ===== */
#breadcrumb-container {
  position: relative;
  background: transparent;
  margin-top: 3.5rem;
  min-height: 55px;
  height: auto;
  z-index: 60;
}

#breadcrumb-container .breadcrumb-trail {
  position: sticky;
  top: 3.5rem;
  z-index: 60;
  background: rgba(var(--bgCard) / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--borderPrimary) / 0.3);
  padding: 0.2rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, max-height 0.4s ease, padding 0.3s ease;
  max-height: 40px;
  overflow: hidden;
  transform: translateY(0);
  opacity: 1;
}

#breadcrumb-container .breadcrumb-trail.hide {
  transform: translateY(-100%);
  opacity: 0;
  max-height: 0;
  padding: 0 2rem;
  pointer-events: none;
}

#breadcrumb-container .breadcrumb-wrapper {
  max-width: 1280px;
  margin: auto 0;
  display: flex;
  align-items: center;
}

#breadcrumb-container .breadcrumb-items {
  display: flex;
  align-items: left;
  gap: 0.55rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: -0.15px;
}

#breadcrumb-container .breadcrumb-item {
  cursor: default;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.8s ease;
  color: rgba(var(--textSecondary));
  opacity: 0.25;
}

#breadcrumb-container .breadcrumb-item:hover {
  color: rgba(var(--textPrimary));
}

#breadcrumb-container:hover .breadcrumb-items {
  opacity: 0.95;
  transition: opacity 0.55s ease;
}

#breadcrumb-container .breadcrumb-sep {
  color: rgba(var(--textOthers));
  margin: 0.125rem;
  font-size: 10px;
}

#breadcrumb-container .breadcrumb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#breadcrumb-container .icon-btn {
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: transparent;
  border: none;
  color: rgba(var(--textSecondary));
  cursor: pointer;
  transition: background 0.2s;
}

#breadcrumb-container .icon-btn:hover {
  background: rgba(var(--bgButtons));
}

#breadcrumb-toggle {
  position: absolute;
  bottom: -1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 41;
  padding: 0.25rem;
  border-radius: 9999px;
  background: transparent;
  border: none;
  color: rgba(var(--textSecondary));
  cursor: pointer;
  transition: transform 0.3s ease, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
}

.breadcrumb-trail.hide + #breadcrumb-toggle {
  bottom: -3rem;
}

#breadcrumb-toggle:hover {
  color: rgba(var(--textPrimary));
}

#breadcrumb-toggle .chevron-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

#breadcrumb-toggle .chevron-icon.flipped {
  transform: rotate(180deg);
}

.breadcrumb-toggle-bar {
  background: transparent;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  animation: breadcrumbIn 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.55s ease-in, translate 0.55s ease-in;
}

.breadcrumb-item.removing {
  animation: breadcrumbOut 0.75s ease forwards;
}

@keyframes breadcrumbIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes breadcrumbOut {
  to {
    opacity: 0;
    transform: translateX(8px) scale(0.95);
  }
}