[x-cloak], [x-show="false"] { display: none !important; }

/* Base header styles */
#blur-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 1px 16px 0 rgba(30, 41, 59, 0.10);
  border-radius: 0;
  padding: 0.7rem 2vw;
  z-index: 20;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transform: scaleX(1);
  transition:
    background 0.4s cubic-bezier(.4, 0, .2, 1),
    box-shadow 0.4s cubic-bezier(.4, 0, .2, 1),
    padding 0.4s cubic-bezier(.4, 0, .2, 1),
    border-radius 0.4s cubic-bezier(.4, 0, .2, 1),
    backdrop-filter 0.4s cubic-bezier(.4, 0, .2, 1),
    top 0.4s cubic-bezier(.4, 0, .2, 1),
    transform 0.4s cubic-bezier(.4, 0, .2, 1);
}

/* Header when scrolled */
#blur-header.scrolled {
  top: 26px !important;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 24px 0 rgba(30, 41, 59, 0.15);
  border-radius: 2rem;
  padding: 0.5rem 3vw;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: scaleX(0.98);
}

/* Container and content alignment */
#blur-header .container,
#header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  transition: padding 0.3s cubic-bezier(.4, 0, .2, 1), max-width 0.4s;
  max-width: 100%;
  margin: 0 auto;
  gap: 0.5rem;
  min-width: 0;
}

/* Prevent wrapping for all children and allow shrinking */
#blur-header .container > *,
#header-content > * {
  min-width: 0;
  flex-shrink: 1;
}

#blur-header.scrolled .container,
#blur-header.scrolled #header-content {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  max-width: 1200px;
}

/* Modern nav link style for header */
#blur-header nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
  flex-shrink: 1;
}
#blur-header nav a {
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
  font-size: 0.98rem;
  white-space: nowrap;
  min-width: 0;
}

#blur-header nav a::after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #6366f1 0%, #a21caf 100%);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
}

#blur-header nav a:hover::after,
#blur-header nav a:focus::after {
  transform: scaleX(1);
}

#blur-header nav a:hover,
#blur-header nav a:focus {
  color: #6366f1;
}

/* Search box styles (force single line) */
.search-box-animated {
  position: relative;
  display: flex;
  align-items: center;
  width: 170px;
  min-width: 0;
  flex-shrink: 1;
  margin-right: 0.2rem;
}

.search-box-animated button {
  transition: box-shadow 0.15s, background 0.15s;
}

.search-box-animated form {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 1.2rem;
  box-shadow: 0 4px 16px 0 rgba(30,41,59,0.10);
  padding: 0.35rem 0.8rem;
  border: 1px solid #e5e7eb;
  min-width: 0;
  width: 100%;
  font-size: 0.98rem;
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
  opacity: 1;
  transform: translateY(0) scale(1);
  z-index: 51;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.98rem;
  flex: 1;
  padding: 0.35rem 0;
  color: #181b29;
  min-width: 0;
}

.search-submit {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 1.08rem;
  padding: 0 0.3rem;
  cursor: pointer;
  transition: color 0.2s;
}

.search-submit:hover {
  color: #a21caf;
}

.search-loading,
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  z-index: 50;
  padding: 0.55rem 0.8rem;
  border-radius: 1rem;
  box-shadow: 0 4px 24px 0 rgba(30,41,59,0.13);
  margin-top: 0.15rem;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.96rem;
}

/* User avatar dropdown section */
#blur-header .user-dropdown,
#blur-header .user-section {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.3rem;
  flex-shrink: 1;
  margin-left: 0.5rem;
}
#blur-header .user-dropdown-btn {
  display: flex;
  align-items: center;
  padding: 0.32rem 0.9rem;
  font-size: 0.95rem;
  background: #222;
  color: #fff;
  border-radius: 9999px;
  font-weight: 600;
  transition: background 0.2s;
  min-width: 0;
}
#blur-header .user-dropdown-btn:hover {
  background: #6366f1;
}
#blur-header .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  margin-right: 6px;
  border: 2px solid #fff;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(30,41,59,0.12);
}

/* Responsive styles */
@media (max-width: 1024px) {
  #blur-header .container,
  #header-content {
    flex-wrap: wrap;
    gap: 0.2rem;
  }
  .search-box-animated {
    width: 100%;
    min-width: 120px;
    margin-right: 0;
  }
  .search-box-animated form {
    min-width: 120px;
    width: 100%;
    font-size: 0.95rem;
    padding: 0.35rem 0.5rem;
  }
  #blur-header nav {
    gap: 0.6rem;
    font-size: 0.96rem;
  }
}

@media (max-width: 500px) {
  #blur-header {
    padding: 0.5rem 4vw;
    border-radius: 0;
  }
  #blur-header .container,
  #blur-header #header-content {
    max-width: 100vw;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    flex-wrap: wrap;
  }
  .search-box-animated {
    font-size: 0.92rem;
    width: 100%;
  }
  .search-box-animated form {
    min-width: 100px;
    width: 90vw;
    padding: 0.3rem 0.4rem;
    font-size: 0.92rem;
  }
  #blur-header nav a {
    font-size: 0.92rem;
    padding: 0.4rem 0.4rem;
  }
}