@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

.layout-shell {
  position: fixed;
  background-color: var(--surface-dark);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.layout-shell.vertical-mode {
  width: var(--sidebar-width);
  height: 100vh;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1.5rem 0;
  border-bottom: none;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.brand-logo i {
  color: #fff;
  margin-right: 10px;
  font-size: 1.5rem;
  transition: color 0.3s ease, margin 0.3s ease;
}

.brand-logo:hover i {
  color: var(--primary-blue);
}

.layout-shell.vertical-mode .brand-logo {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  width: 60%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.layout-shell.vertical-mode .brand-logo span {
  display: none;
}

.layout-shell.vertical-mode .brand-logo i {
  margin-right: 0;
}

.nav-tabs {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: all var(--transition-speed) ease;
}

.layout-shell.vertical-mode .nav-tabs {
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
  align-items: center;
}

.nav-item {
  position: relative;
  color: rgba(255, 255, 240, 0.886);
  display: flex;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-link i {
  font-size: 1.1rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-link:hover {
  color: var(--primary-blue);
  background-color: rgba(0, 123, 255, 0.1);
}

.nav-link:hover i {
  transform: translateY(-2px);
  text-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.nav-link.active {
  color: var(--primary-blue);
}

.layout-shell.vertical-mode .nav-text {
  display: none;
}

.layout-shell.vertical-mode .nav-link {
  justify-content: center;
  padding: 12px;
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: var(--primary-blue);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  transition: 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.layout-shell.vertical-mode .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(15px);
}

/* Keep nav visually identical to index style even when pages toggle light theme */
body.light-theme .layout-shell {
  background-color: var(--surface-dark);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .layout-shell.vertical-mode {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .nav-link {
  color: var(--text-muted);
}

body.light-theme .nav-link:hover {
  color: var(--primary-blue);
  background-color: rgba(0, 123, 255, 0.1);
}

body.light-theme .nav-link.active {
  color: var(--primary-blue);
}

body.sidebar-active {
  padding-left: var(--sidebar-width);
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 56px;
  }

  .layout-shell.vertical-mode {
    padding: 1rem 0;
  }

  .layout-shell.vertical-mode .brand-logo {
    width: 72%;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .layout-shell.vertical-mode .nav-link {
    width: 38px;
    height: 38px;
    padding: 8px;
  }

  .layout-shell {
    padding: 0 0.9rem;
  }

  .nav-tabs {
    gap: 0.45rem;
  }

  .nav-text {
    display: none;
  }

  .nav-link {
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 8px;
    border-radius: 10px;
  }
}

/* Page-specific nav emphasis (e.g. Account when logged out, Create nudges) */
.nav-link.create-nav-highlight {
  position: relative;
  color: #d8ebff;
  background: rgba(0, 123, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(132, 197, 255, 0.26), 0 0 18px rgba(0, 123, 255, 0.18);
  animation: createCtaPulse 2.15s ease-in-out infinite;
}

.nav-link.create-nav-highlight i {
  color: #8dc6ff;
  animation: createPlusNudge 1.55s ease-in-out infinite;
}

.nav-link.create-nav-highlight::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(141, 198, 255, 0.22);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  animation: createRingPing 2.15s ease-out infinite;
}

@keyframes createCtaPulse {
  0%,
  100% {
    background: rgba(0, 123, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(132, 197, 255, 0.2), 0 0 14px rgba(0, 123, 255, 0.12);
  }

  50% {
    background: rgba(0, 123, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(132, 197, 255, 0.35), 0 0 24px rgba(0, 123, 255, 0.28);
  }
}

@keyframes createPlusNudge {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-1px) scale(1.06);
  }
}

@keyframes createRingPing {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  35% {
    opacity: 0.38;
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}
