/*
 * 🕊️ 白木 开发 🔗gl.baimu.live
 * 🎨 漫画风格搜索框样式
 * 📝 功能说明：实现漫画风格边框布局效果，手绘风格线条、夸张比例和卡通化元素
 */

/* 🔗 基础变量定义 */
:root {
  /* ☀️ 亮色模式变量 */
  --search-comic-bg: #ffffff;
  --search-comic-bg-hover: #f8f9fa;
  --search-comic-bg-focus: #ffffff;
  --search-comic-border: var(--bs-dark, #212529);
  --search-comic-border-width: 1.5px;
  --search-comic-shadow: 2px 2px 0px 0px var(--bs-dark, #212529);
  --search-comic-shadow-hover: 3px 3px 0px 0px var(--bs-dark, #212529);
  --search-comic-shadow-focus: 3px 3px 0px 0px var(--bs-primary, #8b3dff);
  --search-comic-text: var(--bs-dark, #212529);
  --search-comic-placeholder: #6c757d;
  --search-comic-icon: var(--bs-dark, #212529);
  --search-comic-radius: 20px;
  --search-comic-skew: -1deg;
}

/* 🌆 暗色模式变量 */
[data-bs-theme="dark"] {
  --search-comic-bg: rgba(30, 30, 40, 0.9);
  --search-comic-bg-hover: rgba(40, 40, 55, 0.95);
  --search-comic-bg-focus: rgba(30, 30, 40, 1);
  --search-comic-border: rgba(255, 255, 255, 0.8);
  --search-comic-shadow: 2px 2px 0px 0px rgba(255, 255, 255, 0.4);
  --search-comic-shadow-hover: 3px 3px 0px 0px rgba(255, 255, 255, 0.5);
  --search-comic-shadow-focus: 3px 3px 0px 0px var(--bs-primary, #a855f7);
  --search-comic-text: #ffffff;
  --search-comic-placeholder: rgba(255, 255, 255, 0.6);
  --search-comic-icon: #ffffff;
}

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

/* 🎨 搜索表单基础样式 - 漫画风格 */
.boxmoe_header .search-form.search-style-comic {
  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.68, -0.55, 0.265, 1.55);
}

/* 🎨 搜索输入框 - 默认收起状态 */
.boxmoe_header .search-form.search-style-comic .search-input {
  position: absolute;
  right: 40px;
  width: 0;
  height: 40px;
  padding: 0;
  border: var(--search-comic-border-width) solid var(--search-comic-border);
  outline: none;
  border-radius: var(--search-comic-radius);
  background: var(--search-comic-bg);
  box-shadow: var(--search-comic-shadow);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
  visibility: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--search-comic-text);
  transform: skewX(var(--search-comic-skew));
}

/* 🎨 搜索输入框占位符 */
.boxmoe_header .search-form.search-style-comic .search-input::placeholder {
  color: var(--search-comic-placeholder);
  font-weight: 500;
}

/* 🎨 搜索按钮 - 纯图标样式 */
.boxmoe_header .search-form.search-style-comic .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.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* 🎨 搜索按钮悬停效果 - 漫画弹跳 */
.boxmoe_header .search-form.search-style-comic .search-btn:hover {
  background: transparent;
  transform: translate(-1px, -1px);
}

.boxmoe_header .search-form.search-style-comic .search-btn:active {
  transform: translate(2px, 2px);
}

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

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

.boxmoe_header .search-form.search-style-comic.active .search-input:focus {
  background: var(--search-comic-bg-focus);
  box-shadow: var(--search-comic-shadow-focus);
  transform: skewX(0deg);
}

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

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

.boxmoe_header .mobile-search-form.search-style-comic .mobile-search-input {
  width: 0;
  height: 40px;
  padding: 0;
  border: none;
  outline: none;
  border-radius: var(--search-comic-radius);
  background: transparent;
  box-shadow: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--search-comic-text);
  position: absolute;
  right: 40px;
  top: 0;
}

.boxmoe_header .mobile-search-form.search-style-comic .mobile-search-input::placeholder {
  color: var(--search-comic-placeholder);
  font-weight: 500;
}

/* 🎨 移动端搜索按钮 - 纯图标样式 */
.boxmoe_header .mobile-search-form.search-style-comic .mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-comic .search-submit.mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-comic .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.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* 🎨 移动端搜索按钮悬停效果 */
.boxmoe_header .mobile-search-form.search-style-comic .mobile-search-btn:hover,
.boxmoe_header .mobile-search-form.search-style-comic .search-submit.mobile-search-btn:hover,
.boxmoe_header .mobile-search-form.search-style-comic .search-wrap .search-submit.mobile-search-btn:hover {
  background: transparent !important;
  transform: translateY(-50%) translate(-1px, -1px);
}

.boxmoe_header .mobile-search-form.search-style-comic .mobile-search-btn:active,
.boxmoe_header .mobile-search-form.search-style-comic .search-submit.mobile-search-btn:active {
  transform: translateY(-50%) translate(2px, 2px);
}

/* 🎨 移动端激活状态 */
.boxmoe_header .mobile-search-form.search-style-comic.active .mobile-search-input {
  width: 200px;
  padding: 0 50px 0 18px;
  opacity: 1;
  background: var(--search-comic-bg);
  transform: none !important;
}

.boxmoe_header .mobile-search-form.search-style-comic.active .mobile-search-input:focus {
  background: var(--search-comic-bg-focus);
  box-shadow: var(--search-comic-shadow-focus);
  transform: skewX(0deg);
}

/* 🎨 移动端激活状态 - 搜索按钮 */
.boxmoe_header .mobile-search-form.search-style-comic.active .mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-comic.active .search-submit.mobile-search-btn,
.boxmoe_header .mobile-search-form.search-style-comic.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-comic {
  margin-bottom: 0;
}

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

.search-form.search-style-comic .search-input {
  width: 100%;
  height: 42px;
  padding: 0 45px 0 16px;
  border: 1px solid var(--search-comic-border);
  border-bottom-width: 3px;
  border-right-width: 3px;
  outline: none;
  border-radius: 21px;
  background: var(--search-comic-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--search-comic-text);
  transition: all 0.2s ease;
}

.search-form.search-style-comic .search-input::placeholder {
  color: var(--search-comic-placeholder);
  font-weight: 400;
  opacity: 0.6;
}

.search-form.search-style-comic .search-input:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: var(--bs-primary, #8b3dff);
  border-bottom-width: 2.5px;
  border-right-width: 2.5px;
}

.search-form.search-style-comic .search-input:focus {
  background: var(--search-comic-bg-focus);
  box-shadow: 0 4px 16px rgba(139, 61, 255, 0.15);
  border-color: var(--bs-primary, #8b3dff);
  border-width: 1.5px;
  border-bottom-width: 2.5px;
  border-right-width: 2.5px;
}

.search-form.search-style-comic .search-submit {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--search-comic-icon);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.search-form.search-style-comic .search-submit:hover {
  background: rgba(139, 61, 255, 0.1);
  color: var(--bs-primary, #8b3dff);
}

.search-form.search-style-comic .search-submit:active {
  background: rgba(139, 61, 255, 0.2);
  transform: translateY(-50%) scale(0.95);
}

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

/* 🎨 自定义表单验证提示框样式 */
.search-form.search-style-comic .search-input:invalid {
  box-shadow: none;
}

.search-form.search-style-comic .search-input:invalid:focus {
  box-shadow: 1px 1px 0px 0px var(--search-comic-border);
}

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

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

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

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

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