/*
 * 🕊️ 白木 开发 🔗gl.baimu.live
 * 💎 无边框玻璃质感搜索框样式
 * 📝 功能说明：实现无边框布局效果，半透明玻璃质感的圆角框设计
 */

/* 🔗 基础变量定义 */
:root {
  /* ☀️ 亮色模式变量 */
  --search-glass-bg: rgba(255, 255, 255, 0.25);
  --search-glass-bg-hover: rgba(255, 255, 255, 0.35);
  --search-glass-bg-focus: rgba(255, 255, 255, 0.45);
  --search-glass-border: rgba(255, 255, 255, 0.3);
  --search-glass-border-focus: rgba(255, 255, 255, 0.5);
  --search-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --search-glass-shadow-focus: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
  --search-glass-text: #333333;
  --search-glass-placeholder: rgba(51, 51, 51, 0.6);
  --search-glass-icon: var(--bs-dark, #212529);
  --search-glass-backdrop: blur(20px);
}

/* 🌆 暗色模式变量 */
[data-bs-theme="dark"] {
  --search-glass-bg: rgba(30, 30, 40, 0.4);
  --search-glass-bg-hover: rgba(30, 30, 40, 0.5);
  --search-glass-bg-focus: rgba(30, 30, 40, 0.6);
  --search-glass-border: rgba(255, 255, 255, 0.1);
  --search-glass-border-focus: rgba(255, 255, 255, 0.2);
  --search-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --search-glass-shadow-focus: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
  --search-glass-text: #ffffff;
  --search-glass-placeholder: rgba(255, 255, 255, 0.6);
  --search-glass-icon: #ffffff;
}

/* 💎 导航栏搜索框容器 */
.boxmoe_header .search-box.search-style-glass {
  position: relative;
  height: 40px;
  margin-right: 5px;
  display: block;
}

/* 💎 搜索表单基础样式 */
.boxmoe_header .search-form.search-style-glass {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 1000;
  width: 40px;
  height: 40px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 💎 搜索输入框 - 默认收起状态 */
.boxmoe_header .search-form.search-style-glass .search-input {
  position: absolute;
  right: 40px;
  width: 0;
  height: 40px;
  padding: 0;
  border: none;
  outline: none;
  border-radius: 20px;
  background: var(--search-glass-bg);
  backdrop-filter: var(--search-glass-backdrop);
  -webkit-backdrop-filter: var(--search-glass-backdrop);
  box-shadow: var(--search-glass-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  font-size: 0.9rem;
  color: var(--search-glass-text);
}

/* 💎 搜索输入框占位符 */
.boxmoe_header .search-form.search-style-glass .search-input::placeholder {
  color: var(--search-glass-placeholder);
}

/* 💎 搜索按钮 - 纯图标样式 */
.boxmoe_header .search-form.search-style-glass .search-btn {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 💎 搜索按钮图标 - 保持默认样式 */
.boxmoe_header .search-form.search-style-glass .search-btn i.fa-search {
  color: inherit;
}

/* 💎 搜索按钮悬停效果 */
.boxmoe_header .search-form.search-style-glass .search-btn:hover {
  background: transparent;
  transform: scale(1.1);
}

/* 💎 激活状态 - 搜索框展开 */
.boxmoe_header .search-form.search-style-glass.active {
  width: auto;
}

.boxmoe_header .search-form.search-style-glass.active .search-input {
  width: 240px;
  padding: 0 45px 0 18px;
  opacity: 1;
  visibility: visible;
  right: 0;
}

.boxmoe_header .search-form.search-style-glass.active .search-input:focus {
  background: var(--search-glass-bg-focus);
  box-shadow: var(--search-glass-shadow-focus);
}

/* 💎 激活状态 - 搜索按钮定位 */
.boxmoe_header .search-form.search-style-glass.active .search-btn {
  background: transparent;
  position: absolute;
  right: 0;
}

/* 💎 移动端搜索表单 */
.boxmoe_header .mobile-search-form.search-style-glass {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  display: flex;
  align-items: center;
}

.boxmoe_header .mobile-search-form.search-style-glass .mobile-search-input {
  width: 0;
  height: 40px;
  padding: 0;
  border: none;
  outline: none;
  border-radius: 20px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  font-size: 0.9rem;
  color: var(--search-glass-text);
  position: absolute;
  right: 40px;
  top: 0;
}

.boxmoe_header .mobile-search-form.search-style-glass .mobile-search-input::placeholder {
  color: var(--search-glass-placeholder);
}

/* 💎 移动端搜索按钮 - 纯图标样式 */
.boxmoe_header .mobile-search-form.search-style-glass .mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-glass .search-submit.mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-glass .search-wrap .search-submit.mobile-search-btn {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* 💎 移动端搜索按钮图标 */
.boxmoe_header .mobile-search-form.search-style-glass .mobile-search-btn i,
.boxmoe_header .mobile-search-form.search-style-glass .search-submit.mobile-search-btn i {
  background: transparent !important;
  color: inherit;
}

/* 💎 移动端搜索按钮悬停效果 */
.boxmoe_header .mobile-search-form.search-style-glass .mobile-search-btn:hover,
.boxmoe_header .mobile-search-form.search-style-glass .search-submit.mobile-search-btn:hover,
.boxmoe_header .mobile-search-form.search-style-glass .search-wrap .search-submit.mobile-search-btn:hover {
  background: transparent !important;
}

/* 💎 移动端激活状态 */
.boxmoe_header .mobile-search-form.search-style-glass.active .mobile-search-input {
  width: 200px;
  padding: 0 45px 0 18px;
  opacity: 1;
  background: var(--search-glass-bg);
  backdrop-filter: var(--search-glass-backdrop);
  -webkit-backdrop-filter: var(--search-glass-backdrop);
  box-shadow: var(--search-glass-shadow);
  right: 0;
}

.boxmoe_header .mobile-search-form.search-style-glass.active .mobile-search-input:focus {
  background: var(--search-glass-bg-focus);
  box-shadow: var(--search-glass-shadow-focus);
}

/* 💎 移动端激活状态 - 搜索按钮 */
.boxmoe_header .mobile-search-form.search-style-glass.active .mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-glass.active .search-submit.mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-glass.active .search-wrap .search-submit.mobile-search-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* 💎 通用搜索表单样式（侧边栏等） */
.search-form.search-style-glass {
  margin-bottom: 0;
}

.search-form.search-style-glass .search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.search-form.search-style-glass .search-input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  outline: none;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 4px 16px rgba(31, 38, 135, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  color: var(--search-glass-text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-form.search-style-glass .search-input::placeholder {
  color: var(--search-glass-placeholder);
  opacity: 0.8;
}

.search-form.search-style-glass .search-input:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 6px 20px rgba(31, 38, 135, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

.search-form.search-style-glass .search-input:focus {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 
    0 8px 24px rgba(31, 38, 135, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.8);
}

.search-form.search-style-glass .search-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  color: var(--search-glass-icon);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-form.search-style-glass .search-submit:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-form.search-style-glass .search-submit:active {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 💎 通用搜索按钮图标 - 保持默认样式 */
.search-form.search-style-glass .search-submit i {
  color: inherit;
}

/* 💎 自定义表单验证提示框样式 */
.search-form.search-style-glass .search-input:invalid {
  box-shadow: 
    0 4px 16px rgba(31, 38, 135, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.search-form.search-style-glass .search-input:invalid:focus {
  box-shadow: 
    0 8px 24px rgba(31, 38, 135, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* 隐藏默认的验证提示框 */
.search-form.search-style-glass .search-input::-webkit-validation-bubble,
.search-form.search-style-glass .search-input::-webkit-validation-bubble-arrow,
.search-form.search-style-glass .search-input::-webkit-validation-bubble-message {
  display: none;
}

/* 📱 响应式设计 */
@media (max-width: 991px) {
  .boxmoe_header .search-form.search-style-glass.active .search-input {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .boxmoe_header .search-form.search-style-glass.active .search-input {
    width: 180px;
  }
  
  .boxmoe_header .mobile-search-form.search-style-glass.active .mobile-search-input {
    width: 160px;
  }
  
  .search-form.search-style-glass .search-input {
    height: 42px;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .boxmoe_header .search-form.search-style-glass.active .search-input {
    width: 150px;
    padding: 0 40px 0 15px;
  }
  
  .boxmoe_header .mobile-search-form.search-style-glass.active .mobile-search-input {
    width: 140px;
    padding: 0 40px 0 15px;
  }
}

/* 🎨 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
  .boxmoe_header .search-form.search-style-glass,
  .boxmoe_header .search-form.search-style-glass .search-input,
  .boxmoe_header .search-form.search-style-glass .search-btn,
  .boxmoe_header .mobile-search-form.search-style-glass .mobile-search-input,
  .boxmoe_header .mobile-search-form.search-style-glass .mobile-search-btn,
  .search-form.search-style-glass .search-input,
  .search-form.search-style-glass .search-submit {
    transition: none;
  }
  
  .search-form.search-style-glass .search-input:focus {
    transform: none;
  }
}
