/* ============================================
   Top Bar – Enhanced Shadows & Hover Borders
   ============================================ */

/* 1. Root variables – you may already have these,
   but we keep them for completeness */
:root {
  --eg-topbar-shadow: 0 18px 42px rgba(15, 23, 42, 0.10),
                      0 8px 18px rgba(15, 23, 42, 0.05),
                      0 1px 0 rgba(255, 255, 255, 0.72) inset;
  --eg-topbar-shadow-hover: 0 24px 52px rgba(15, 23, 42, 0.12),
                            0 12px 24px rgba(15, 23, 42, 0.06),
                            0 1px 0 rgba(255, 255, 255, 0.80) inset;
  --eg-topbar-border: rgba(255, 255, 255, 0.88);
  --eg-topbar-accent-soft: rgba(247, 93, 30, 0.14);
  --eg-topbar-accent-strong: rgba(247, 93, 30, 0.52);
}

/* 2. Top bar container */
.cc-topbar {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--eg-topbar-border);
  box-shadow: var(--eg-topbar-shadow) !important;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}

.cc-topbar:hover {
  transform: translateY(-2px);
  box-shadow: var(--eg-topbar-shadow-hover) !important;
  border-color: var(--eg-topbar-accent-strong);  /* orange border on hover */
}

/* 3. Decorative elements (keep existing animations) */
.cc-topbar::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    transparent 0%,
    transparent 12%,
    var(--eg-topbar-accent-soft) 28%,
    var(--eg-topbar-accent-strong) 50%,
    var(--eg-topbar-accent-soft) 72%,
    transparent 88%,
    transparent 100%);
  background-size: 220% 100%;
  opacity: 0.95;
  pointer-events: none;
  animation: egTopbarLineSweep 5.6s linear infinite;
}

.cc-topbar::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: -10px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center,
    rgba(15, 23, 42, 0.10) 0%,
    rgba(15, 23, 42, 0.04) 48%,
    rgba(15, 23, 42, 0.00) 78%);
  filter: blur(10px);
  opacity: 0.72;
  z-index: -1;
  pointer-events: none;
}

/* 4. Interactive elements inside the top bar */
.cc-mode-tabs,
.cc-logout-btn,
.cc-quick-pill,
.cc-search-capsule {
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

/* Tabs container shadow */
.cc-mode-tabs {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05),
              0 10px 20px rgba(15, 23, 42, 0.04);
}

/* Individual tab, logout, pill – common base */
.cc-mode-tab,
.cc-logout-btn,
.cc-quick-pill {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06),
              0 4px 10px rgba(15, 23, 42, 0.04),
              inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

/* Hover effects for these interactive elements */
.cc-mode-tab:hover,
.cc-logout-btn:hover,
.cc-quick-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.09),
              0 8px 18px rgba(15, 23, 42, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.78);
  border-color: rgba(247, 93, 30, 0.34);   /* orange border on hover */
}

/* Active tab styling */
.cc-mode-tab.is-active {
  border-color: rgba(247, 93, 30, 0.52) !important;
  box-shadow: 0 14px 28px rgba(223, 82, 21, 0.20),
              0 8px 16px rgba(223, 82, 21, 0.14),
              inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
}

/* Underline animation on hover/active */
.cc-mode-tab::after,
.cc-logout-btn::after,
.cc-quick-pill::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(247, 93, 30, 0.34), transparent);
  transform: scaleX(0.18);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.cc-mode-tab:hover::after,
.cc-mode-tab.is-active::after,
.cc-logout-btn:hover::after,
.cc-quick-pill:hover::after,
.cc-quick-pill[aria-current="page"]::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Search capsule */
.cc-search-capsule {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.cc-search-capsule:hover,
.cc-search-capsule:focus-within {
  transform: translateY(-2px);
  border-color: rgba(247, 93, 30, 0.34);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.cc-search-capsule__button {
  border: 0;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 15px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(145deg, var(--cc-orange, #f75d1e), #ff7a45);
  box-shadow: 0 10px 20px -14px rgba(223, 82, 21, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cc-search-capsule__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -14px rgba(223, 82, 21, 0.62);
  filter: saturate(1.02);
}

/* 5. Keyframes for the animated line (keep existing) */
@keyframes egTopbarLineSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

/* 6. Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cc-topbar,
  .cc-mode-tab,
  .cc-logout-btn,
  .cc-quick-pill,
  .cc-search-capsule,
  .cc-search-capsule__button {
    transition: none !important;
    transform: none !important;
  }

  .cc-topbar::before {
    animation: none !important;
  }
}