/* ========== LIQUID GLASS / IPHONE STYLE OVERRIDES ========== */

/* Khung chính: bo góc lớn, glass + glow nhẹ */
#template-site-container {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 28px;
  /* max-width: 1440px !important; */
  /* width: 100%; */
  /* margin: 40px auto; */
  background: radial-gradient(circle at top left, rgba(94, 234, 212, .16), transparent 55%), radial-gradient(circle at bottom right, rgba(129, 140, 248, .22), transparent 60%), rgba(15, 23, 42, .85);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 32px 80px rgba(15, 23, 42, .7), 0 0 0 1px rgba(148, 163, 184, .12);
  backdrop-filter: blur(26px);
}

/* Lớp glow nền */
/* lớp “liquid” nhẹ */
#template-site-container::before,
#template-site-container::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}

#template-site-container::before {
  width: 260px;
  height: 260px;
  top: -60px;
  right: 10%;
  background: radial-gradient(circle, #22d3ee, transparent 60%);
}

#template-site-container::after {
  width: 260px;
  height: 260px;
  bottom: -80px;
  left: 5%;
  background: radial-gradient(circle, #a855f7, transparent 60%);
}

/* Layout 2 cột */
.template-layout {
  position: relative;
  z-index: 1;
  /* nằm trên lớp glow */
  display: flex;
  gap: 28px;
}

/* ========== SIDEBAR LIQUID ========== */

.template-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Mỗi box trong sidebar là một tấm glass nhỏ */
.sidebar-section {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  padding: 16px 18px 18px;
  backdrop-filter: blur(20px);
}

.sidebar-heading {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #e5e7eb;
}

/* Search input dạng pill */
.sidebar-search form#search-title-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

#search-title-keyword,
#search-keyword {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.96));
  color: #f9fafb;
  padding: 9px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .2s ease;
  margin-bottom: 0px !important;
}

#search-title-keyword::placeholder,
#search-keyword::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

#search-title-keyword:focus,
#search-keyword:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.96));
}

/* Nút search dạng icon pill */
#search-title-button,
#search-button {
  border-radius: 999px;
  border: none;
  padding: 3px 14px;
  background: radial-gradient(circle at top left, #22c55e, #16a34a);
  color: #f9fafb;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.45);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

#search-title-button:hover,
#search-button:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 16px 36px rgba(34, 197, 94, 0.55);
  filter: brightness(1.05);
}

/* Danh mục pill đứng dọc */
.sidebar-category-list {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-category-list li {
  margin: 0 !important;
}

.sidebar-category-list li a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.85);
  transition: background .18s ease, border-color .18s ease, transform .08s ease, box-shadow .18s ease;
}

.sidebar-category-list li a:hover {
  background: rgba(31, 41, 55, 0.95);
  border-color: rgba(148, 163, 184, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.7);
}

.sidebar-category-list li a.active {
  background: radial-gradient(circle at top left, #22c55e, #16a34a);
  border-color: rgba(187, 247, 208, 0.95);
  color: #0f172a;
  font-weight: 600;
}

/* Nút "Xem thêm" danh mục */
.category-toggle-more {
  margin-top: 0px;
  padding: 0px;
  border-radius: 999px;
  /* border: 1px solid rgba(148, 163, 184, 0.7); */
  /* background: rgba(15, 23, 42, 0.9); */
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s ease, transform .1s ease, box-shadow .18s ease;
  margin-left: 10px;
}

.category-toggle-more:hover {
  color: white;
  transform: translateY(-1px);
}

/* ========== MAIN & SUGGESTED TAGS ========== */

.template-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14.5px;
}

.template-main-top {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 14px 18px;
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85), 0 0 0 1px rgba(15, 23, 42, 0.8);
}

@media (min-width: 1025px) {
  .suggested-categories {
    display: flex;
    align-items: center;
  }
}

.suggested-categories__label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
}

.suggested-categories__list {
  margin-top: 8px;
  margin-bottom: 0px !important;
  display: flex;
  gap: 10px;
  list-style-type: none;
  justify-content: center;
}

@media (max-width: 678px) {
  .suggested-categories__list {
    padding: 0;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: start;
  }

  .suggested-categories__list li {
    margin-left: 0px !important;
  }
}



.suggested-categories__list a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: radial-gradient(circle at top left, rgba(22, 163, 74, 0.18), rgba(15, 23, 42, 0.96));
  color: #bbf7d0;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .08s ease, box-shadow .18s ease;
}

.suggested-categories__list a:hover {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.3), rgba(15, 23, 42, 0.96));
  border-color: rgba(190, 242, 100, 0.95);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.6);
  transform: translateY(-1px);
}

/* ========== TEMPLATE GRID & CARD ========== */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

/* GRID RIÊNG CHO CATEGORY */
.template-grid--category {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
}

@media (max-width: 1024px) {
  .template-grid--category {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .template-grid--category {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}


.template-item {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  display: flex !important;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .18s ease;
}

.template-item::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 10% -10%, rgba(96, 165, 250, 0.75), transparent 55%),
    radial-gradient(circle at 90% 110%, rgba(52, 211, 153, 0.6), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.template-item:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(209, 213, 219, 0.9);
  box-shadow:
    0 32px 80px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(148, 163, 184, 0.9);
}

.template-item:hover::before {
  opacity: 0.35;
}

/* Ảnh: bo tròn + ratio đồng nhất */
.template-image {
  position: relative;
  overflow: hidden;
}

.template-image img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  /*border-radius: 18px 18px 0 0;*/
}

.template-image::after {
  content: "Xem chi tiết giao diện";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f9fafb;
  font-size: 13px;
  letter-spacing: .04em;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.75));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}

.template-item:hover .template-image::after {
  opacity: 1;
  transform: translateY(0);
}

/* Nội dung */
.template-content {
  padding: 16px 18px 14px;
  text-align: left;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
}

.template-title a {
  color: #e5e7eb !important;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}

.template-title a:hover {
  color: #f9fafb;
}

/* Nút hành động dạng pill gradient */
#template-site-container .template-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#template-site-container .template-button-show,
#template-site-container .template-button-register,
#template-site-container .template-button-signup {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

/* Xem demo = xanh mint */
#template-site-container .template-button-show {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.55);
}

#template-site-container .template-button-show:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 18px 42px rgba(34, 197, 94, 0.7);
}

/* Chọn / Đăng ký = cam hồng */
#template-site-container .template-button-register,
#template-site-container .template-button-signup {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #111827;
  box-shadow: 0 12px 30px rgba(248, 150, 69, 0.6);
}

#template-site-container .template-button-register:hover,
#template-site-container .template-button-signup:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 18px 42px rgba(248, 150, 69, 0.8);
}

/* ========== LOAD MORE & LOADER ========== */

#load-more-wrapper {
  margin-top: 24px;
}

#load-more {
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #22c55e);
  border: none;
  color: #f9fafb;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.7);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

#load-more:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 22px 60px rgba(79, 70, 229, 0.9);
}

/* Loader màu xanh mint */
.loader,
.search-loader,
.loading-spinner {
  border-color: rgba(30, 64, 175, 0.22);
  border-top-color: #22c55e;
}


h3.sidebar-heading {
  color: #fff !important;
}

/* Ẩn hoàn toàn các phần tử khi đang search */
.hidden-by-search {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 992px) {
  #template-site-container {
    padding: 20px;
    border-radius: 24px;
  }

  .template-layout {
    flex-direction: column;
  }

  .template-sidebar {
    width: 100%;
  }

  .template-main-top {
    border-radius: 18px;
  }

  .template-image img {
    height: 190px;
  }
}

/* Hide select on desktop */
.category-select-mobile {
  display: none;
}

/* Show select on mobile */
@media (max-width: 768px) {

  #category-list,
  #category-toggle-more {
    display: none !important;
  }

  .category-select-mobile {
    display: block !important;
    width: 100%;
    padding: 6px;
    font-size: 13px;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 5px;
  }
}

/* --- MOBILE CATEGORY SELECT STYLE --- */
#category-select {
  width: 100%;
  padding: 0px 16px;
  background: #0a1b2e;
  color: #bfffd9;
  border: 1px solid rgba(0, 255, 150, 0.4);
  border-radius: 50px;
  font-size: 15px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  position: relative;
}

#category-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23BFFFD9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

#category-select:focus {
  outline: none;
  border-color: #00ff9a;
  box-shadow: 0 0 10px rgba(0, 255, 154, 0.6);
}

#category-select option {
  background: #0a1b2e;
  color: #ffffff;
  padding: 10px;
}