/* ── ChevLink shared nav & page-loader styles ── */

/* Page loader */
#cl-page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06070a;
  transition: opacity 0.45s cubic-bezier(0.4,0,0.2,1);
}
#cl-page-loader.cl-loader-done {
  opacity: 0;
  pointer-events: none;
}
.cl-loader-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.cl-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 260px;
}
.cl-loader-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  opacity: 0;
  animation: clLoaderIn 0.55s cubic-bezier(0.34,1.2,0.64,1) 0.05s forwards;
}
.cl-loader-logo img {
  height: 34px;
  width: auto;
}
.cl-loader-logo-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'DM Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f1f5f9;
}
.cl-loader-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(148,163,184,0.12);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  animation: clLoaderIn 0.5s cubic-bezier(0.34,1.2,0.64,1) 0.2s forwards;
}
.cl-loader-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #3b82f6, rgba(99,102,241,0.7));
  border-radius: 4px;
  animation: clLoaderBar 1.3s ease-in-out infinite;
}
.cl-loader-status {
  margin-top: 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: #64748b;
  opacity: 0;
  animation: clLoaderIn 0.5s cubic-bezier(0.34,1.2,0.64,1) 0.32s forwards;
}
.cl-loader-status::after {
  content: '';
  animation: clDots 1.4s steps(4,end) infinite;
}
@keyframes clLoaderIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes clLoaderBar {
  0%,100% { transform: translateX(-120%); }
  50%     { transform: translateX(280%); }
}
@keyframes clDots {
  0%,20%  { content: ''; }
  40%     { content: '.'; }
  60%     { content: '..'; }
  80%,100%{ content: '...'; }
}

/* ── Profile button & dropdown ── */
.cl-profile-wrap {
  position: relative;
  display: inline-flex;
}
.cl-profile-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 7px 12px 7px 8px;
  cursor: pointer;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.cl-profile-btn:hover {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.3);
}
.cl-profile-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.cl-profile-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.cl-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}
.cl-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #0f172a;
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  z-index: 1000;
  animation: clDropIn 0.14s ease;
}
.cl-profile-dropdown[hidden] { display: none; }
@keyframes clDropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cl-drop-user {
  padding: 10px 12px 10px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
  margin-bottom: 4px;
}
.cl-drop-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-drop-user-email {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.cl-drop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  text-align: left;
  box-sizing: border-box;
}
.cl-drop-item:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.cl-drop-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.cl-drop-item.cl-drop-signout:hover { background: rgba(239,68,68,0.1); color: #f87171; }
.cl-drop-sep {
  height: 1px;
  background: rgba(148,163,184,0.1);
  margin: 4px 6px;
}

/* ── Mobile: compact profile button so it doesn't overlap logo text ── */
@media (max-width: 768px) {
  .cl-profile-btn {
    /* Show avatar only — hide the display name and chevron */
    font-size: 0;
    padding: 5px 6px;
    gap: 0;
  }
  .cl-profile-btn svg { display: none; }
  .cl-avatar {
    /* Slightly larger tap target when it's the only visible element */
    width: 30px;
    height: 30px;
  }
}
