/* DUDI Software - projects page */

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

button,
.page-number,
.chip,
.skill-chip,
.cmp-dot {
  overflow: hidden;
  background-clip: padding-box;
}

/* Page hero */
.projects-hero {
  padding: 80px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hero entrance animations */
.hero-anim {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s);
}

.hero-anim.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Khi reset: bỏ delay để hide ngay */
.hero-anim:not(.revealed) {
  transition-delay: 0s !important;
}

/* Robot image — absolute, pinned to bottom-left of hero */
.hero-side-img {
  position: absolute;
  left: 40px;
  bottom: 0;
  height: 85%;
  width: auto;
  object-fit: contain;
  mix-blend-mode: normal;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0;
  transform: translateX(-50px);
  will-change: opacity, transform;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}

.hero-side-img.revealed {
  opacity: 1;
  transform: translateX(0);
}

.hero-side-img:not(.revealed) {
  transition-delay: 0s !important;
}

[data-theme="light"] .hero-side-img {
  mix-blend-mode: multiply;
}

/* Robot right image — absolute, pinned to bottom-right of hero */
.hero-side-img-right {
  position: absolute;
  right: 160px;
  bottom: 0;
  height: 85%;
  width: auto;
  object-fit: contain;
  mix-blend-mode: normal;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0;
  transform: translateX(50px);
  will-change: opacity, transform;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.hero-side-img-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.hero-side-img-right:not(.revealed) {
  transition-delay: 0s !important;
}

[data-theme="light"] .hero-side-img-right {
  mix-blend-mode: normal;
  height: 55%;
  bottom: 0;
  top: auto;
  right: 160px;
  left: auto;
}

@media (max-width: 1680px) {
  .hero-side-img {
    height: 70% !important;
    left: 20px !important;
  }
  .hero-side-img-right {
    height: 70% !important;
    right: 60px !important;
  }
  [data-theme="light"] .hero-side-img-right {
    height: 45% !important;
    right: 60px !important;
  }
}

@media (max-width: 1300px) {
  .hero-side-img {
    height: 55% !important;
    left: 10px !important;
  }
  .hero-side-img-right {
    height: 55% !important;
    right: 30px !important;
  }
  [data-theme="light"] .hero-side-img-right {
    height: 35% !important;
    right: 30px !important;
  }
}

@media (max-width: 1024px) {
  .hero-side-img-right {
    height: 60%;
    right: 16px;
  }
}

@media (max-width: 977px) {
  .hero-side-img,
  .hero-side-img-right {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hero-side-img-right {
    display: none;
  }
}

/* Push all direct hero content above the bg image */
.projects-hero .status-pill,
.projects-hero .hero-title,
.projects-hero .hero-sub,
.projects-hero .hero-stats,
.projects-hero .tech-marquee-wrap {
  position: relative;
  z-index: 2;
}

@media (max-width: 1024px) {
  .hero-side-img {
    height: 60%;
    left: 16px;
  }
}

@media (max-width: 768px) {
  .hero-side-img {
    display: none;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}

[data-theme="light"] .status-pill {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.5);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

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

  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900;
  color: #fbfbfb;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

[data-theme="light"] .hero-title {
  color: #14141c;
}

.hero-title .gradient-word {
  background: linear-gradient(135deg, #ED1C24, #1E90FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.1em;
  display: inline-block;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  max-width: 420px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

[data-theme="light"] .hero-sub {
  color: rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) {
  .hero-sub {
    margin: 0 auto 36px;
  }
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .hero-stats {
    justify-content: center;
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 32px;
}

.stat-item:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .stat-item:not(:last-child) {
  border-right-color: rgba(0, 0, 0, 0.1);
}

/* Icon container — đều nhau */
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .stat-icon {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  stroke: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

[data-theme="light"] .stat-icon svg {
  stroke: rgba(0, 0, 0, 0.55);
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  line-height: 1;
  color: #fbfbfb;
  letter-spacing: -0.02em;
}

[data-theme="light"] .stat-num {
  color: #14141c;
}

/* Dấu + cùng màu số, lên góc trên phải */
.stat-num span {
  font-size: 1.3rem;
  font-weight: 700;
  color: inherit;
  opacity: 0.6;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 5px;
  letter-spacing: 0.04em;
  font-weight: 500;
}

[data-theme="light"] .stat-label {
  color: rgba(0, 0, 0, 0.45);
}

/* Sticky filter bar */
/* Filter Drawer Overlay & Panel styles */
#filterDrawerOverlay {
  transition: opacity 0.3s ease;
  will-change: opacity;
}

#filterDrawer {
  will-change: transform;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease-in-out;
}

html[data-theme="light"] #filterDrawer {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* filter-sort-wrap custom dropdown container styles */
.filter-sort-wrap {
  position: relative;
  width: 100%;
  flex-shrink: 0;
}

.filter-search-wrap {
  position: relative;
  width: 100%;
}

.filter-search-wrap input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  color: #fbfbfb;
  font-size: 0.82rem;
  font-family: 'Manrope', sans-serif;
  outline: none;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] .filter-search-wrap input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.12);
  color: #14141c;
}

.filter-search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .filter-search-wrap input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.filter-search-wrap input:focus {
  border-color: rgba(30, 144, 255, 0.5);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 12px rgba(30, 144, 255, 0.15);
}

[data-theme="light"] .filter-search-wrap input:focus {
  background: #ffffff;
  border-color: rgba(30, 144, 255, 0.6);
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.1);
}

.filter-search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.2s ease;
}

.filter-search-wrap input:focus+svg {
  color: #1E90FF;
}

[data-theme="light"] .filter-search-wrap svg {
  color: rgba(0, 0, 0, 0.4);
}

.chips-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.chip {
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
}

[data-theme="light"] .chip {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.65);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fbfbfb;
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .chip:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #14141c;
  border-color: rgba(0, 0, 0, 0.18);
}

.chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s ease, transform 0.2s ease;
}

[data-theme="light"] .chip svg {
  color: rgba(0, 0, 0, 0.45);
}

.chip:hover svg {
  color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

[data-theme="light"] .chip:hover svg {
  color: rgba(0, 0, 0, 0.7);
}

.chip.active {
  position: relative;
  background: rgba(30, 144, 255, 0.12) !important;
  border: 1px solid rgba(30, 144, 255, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.25), 0 0 2px rgba(106, 13, 173, 0.45) !important;
  overflow: hidden;
}

.chip.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 30px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.8), rgba(106, 13, 173, 0.8));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .chip.active {
  background: rgba(30, 144, 255, 0.08) !important;
  border: 1px solid rgba(30, 144, 255, 0.35) !important;
  color: #1E90FF !important;
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.15) !important;
}

[data-theme="light"] .chip.active::before {
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.5), rgba(106, 13, 173, 0.5));
}

.chip .chip-count {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 9999px;
  padding: 0 6px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 2px;
  transition: all 0.2s ease;
}

[data-theme="light"] .chip .chip-count {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}

.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

[data-theme="light"] .chip.active .chip-count {
  background: rgba(30, 144, 255, 0.15);
  color: #1E90FF;
}

/* Main content area */
.projects-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.section-bar-wrap {
  padding: 32px 24px 20px;
  background: rgba(20, 20, 28, 0.2);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  /* Đã bỏ mask-image để tránh lỗi cắt xén (clipping) popup panel tuyệt đối trồi ra ngoài */
}

[data-theme="light"] .section-bar-wrap {
  background: rgba(255, 255, 255, 0.45);
  border-top-color: rgba(0, 0, 0, 0.22);
  border-bottom-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.section-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fbfbfb;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.section-title svg {
  width: 20px;
  height: 20px;
  color: inherit;
  flex-shrink: 0;
}

[data-theme="light"] .section-title {
  color: #14141c;
}

.fallback-icon-wrap {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.fallback-icon-wrap svg {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.5);
}

.section-sub {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
  margin-top: 3px;
}

[data-theme="light"] .section-sub {
  color: rgba(0, 0, 0, 0.45);
}

.data-badge {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

[data-theme="light"] .data-badge {
  color: rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .project-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Project cards */
.work-card {
  will-change: transform, opacity;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  /* transition riêng cho hover — không dùng shorthand để tránh conflict với reveal */
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] .work-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.work-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(237, 28, 36, 0.28);
}

[data-theme="light"] .work-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(237, 28, 36, 0.2);
  border-color: rgba(237, 28, 36, 0.3);
}

.img-holder {
  width: 100%;
  height: 260px;
  position: relative;
}

@media (max-width: 640px) {
  .img-holder {
    height: 180px;
  }
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.img-holder:hover .card-img {
  transform: scale(1.04);
}

/* Line clamps */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination */
.pagination-nav {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-number {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-family: 'Manrope', sans-serif;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

[data-theme="light"] .page-number {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.65);
}

.page-number:hover,
.page-number.active-page {
  color: white;
  border-color: transparent;
  background: none !important;
}

.page-number:hover::before,
.page-number.active-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ED1C24, #1E90FF);
  z-index: -1;
  border-radius: inherit;
}

.page-number.active-page {
  box-shadow: 0 2px 12px rgba(237, 28, 36, 0.4);
}

.page-number.disabled-page {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* Tech marquee in hero */
.tech-marquee-wrap {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
}

[data-theme="light"] .tech-marquee-wrap {
  border-top-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.tech-slider-track {
  display: flex;
  gap: 10px;
  animation: slideTech 30s linear infinite;
  width: fit-content;
}

.tech-marquee-wrap:hover .tech-slider-track {
  animation-play-state: paused;
}

.skill-chip {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  padding: 5px 16px;
  border-radius: 40px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Manrope', sans-serif;
}

[data-theme="light"] .skill-chip {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.12);
}

@keyframes slideTech {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Loading spinner */
.modern-loader-custom {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: #ED1C24;
  border-radius: 50%;
  animation: spinLoader 0.7s linear infinite;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

/* Utilities */
img,
iframe {
  max-width: 100%;
}

.word-break-safe {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .projects-hero {
    padding: 120px 16px 28px;
  }

  .hero-stats {
    gap: 0;
  }

  .stat-item {
    padding: 0 20px;
  }

  .stat-num {
    font-size: 1.6rem;
  }

  .filter-bar {
    padding: 10px 16px;
  }

  .filter-bar-inner {
    gap: 8px;
  }

  .filter-search-wrap {
    max-width: 100%;
    min-width: 100%;
  }

  .projects-main {
    padding: 20px 16px 48px;
  }
}

/*  Light mode: card content  */

/* Card background + border đã xử lý ở trên */

/* Tên dự án trong card */
[data-theme="light"] .work-card h3 {
  color: #14141c !important;
}

/* Mô tả dự án */
[data-theme="light"] .work-card p {
  color: rgba(0, 0, 0, 0.55) !important;
}

/* Category chip trong card */
[data-theme="light"] .work-card span.text-xs {
  color: rgba(0, 0, 0, 0.5) !important;
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Đường kẻ footer card */
[data-theme="light"] .work-card .border-t {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* URL text dưới card */
[data-theme="light"] .work-card .text-white\/30 {
  color: rgba(0, 0, 0, 0.35) !important;
}

/* Mũi tên icon trong card */
[data-theme="light"] .work-card .text-white\/25 {
  color: rgba(0, 0, 0, 0.2) !important;
}

/* Skill chips marquee */
[data-theme="light"] .skill-chip {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Loading spinner light */
[data-theme="light"] .modern-loader-custom {
  border-color: rgba(0, 0, 0, 0.08);
  border-top-color: #ED1C24;
}

/*  Scroll reveal animations  */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger — chỉ áp khi có class revealed, reset về 0 khi không có */
.reveal[data-delay="1"] {
  transition-delay: 0.04s;
}

.reveal[data-delay="2"] {
  transition-delay: 0.08s;
}

.reveal[data-delay="3"] {
  transition-delay: 0.12s;
}

.reveal[data-delay="4"] {
  transition-delay: 0.16s;
}

.reveal[data-delay="5"] {
  transition-delay: 0.20s;
}

.reveal[data-delay="6"] {
  transition-delay: 0.24s;
}

/* Khi không revealed: reset delay về 0 để hide tức thì */
.reveal:not(.revealed) {
  transition-delay: 0s !important;
}

/* Card: scale nhẹ thêm */
.reveal.card-reveal {
  transform: translateY(20px) scale(0.98);
}

.reveal.card-reveal.revealed {
  transform: translateY(0) scale(1);
}

/* Khắc phục lỗi rò rỉ góc vuông của nút mở bộ lọc bằng pseudo-element ::before */
#openFilterDrawerBtn {
  background: none !important;
  overflow: hidden;
  isolation: isolate;
  display: none !important; /* Hide old drawer button */
}

#openFilterDrawerBtn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, #ED1C24, #1E90FF);
  z-index: -1;
  border-radius: inherit;
}

/* Hide old drawer elements globally */
#filterDrawer, #filterDrawerOverlay {
  display: none !important;
}

/* New Horizontal Filter and Popup Command Palette styles */
.category-popup-panel {
  width: 290px;
  background: rgba(20, 20, 28, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(30, 144, 255, 0.05);
  transform: scale(0.9) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  background-image: linear-gradient(rgba(20, 20, 28, 0.9), rgba(20, 20, 28, 0.9)), 
                    linear-gradient(135deg, rgba(237, 28, 36, 0.15), rgba(30, 144, 255, 0.15));
  background-origin: border-box;
  background-clip: content-box, border-box;
  border: 1px solid transparent;
  z-index: 1000;
}

.category-popup-panel.active {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .category-popup-panel {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 0 20px rgba(30, 144, 255, 0.02);
  background-image: linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)), 
                    linear-gradient(135deg, rgba(237, 28, 36, 0.1), rgba(30, 144, 255, 0.1));
}

/* Custom scrollbar for popup list */
#popupCategoriesList::-webkit-scrollbar {
  width: 5px;
}
#popupCategoriesList::-webkit-scrollbar-track {
  background: transparent;
}
#popupCategoriesList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}
[data-theme="light"] #popupCategoriesList::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

/* ── Light mode: popup panel nội dung ── */

/* Toàn bộ text trong popup */
[data-theme="light"] .category-popup-panel {
  color: #14141c;
}

/* Search input — dark default */
.popup-search-input {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}
.popup-search-input::placeholder { color: rgba(255, 255, 255, 0.25); }
.popup-search-input:focus { border-color: #1E90FF; box-shadow: 0 0 0 2px rgba(30,144,255,0.15); }

/* Border separator — dark default */
.popup-border { border-color: rgba(255, 255, 255, 0.1); }

/* Icon — dark default */
.popup-icon { color: rgba(255, 255, 255, 0.35); }
.popup-icon svg { stroke: rgba(255, 255, 255, 0.35); }

/* ── Light overrides ── */
[data-theme="light"] .popup-search-input {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #14141c !important;
}
[data-theme="light"] .popup-search-input::placeholder {
  color: rgba(0, 0, 0, 0.35) !important;
}
[data-theme="light"] .popup-search-input:focus {
  border-color: #1E90FF !important;
  box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.12) !important;
}
[data-theme="light"] .popup-border {
  border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .popup-icon,
[data-theme="light"] .popup-icon svg {
  color: rgba(0, 0, 0, 0.4) !important;
  stroke: rgba(0, 0, 0, 0.4) !important;
}

/* Group header chữ cái */
[data-theme="light"] #popupCategoriesList > div:not(button) {
  color: rgba(0, 0, 0, 0.3) !important;
}

/* Item buttons — đảm bảo override Tailwind text-white/60 */
[data-theme="light"] #popupCategoriesList button,
[data-theme="light"] #popupCategoriesList button span:first-child {
  color: rgba(0, 0, 0, 0.7) !important;
}
[data-theme="light"] #popupCategoriesList button:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #14141c !important;
}

/* Count badge trong item */
[data-theme="light"] #popupCategoriesList button span:last-child {
  background: rgba(0, 0, 0, 0.07) !important;
  color: rgba(0, 0, 0, 0.45) !important;
}

/* Active item */
[data-theme="light"] #popupCategoriesList button[class*="bg-blue"] {
  background: rgba(30, 144, 255, 0.1) !important;
  color: #1E90FF !important;
  border-color: rgba(30, 144, 255, 0.3) !important;
}

/* No results text */
[data-theme="light"] #popupCategoriesList > div {
  color: rgba(0, 0, 0, 0.35) !important;
}

/* Premium Bottom Sheet cho Mobile (Dưới 640px) */
@media (max-width: 640px) {
  .category-popup-panel {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(100%) !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    z-index: 10000 !important;
    margin-top: 0 !important;
    padding-bottom: 24px !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background-image: linear-gradient(rgba(20, 20, 28, 0.95), rgba(20, 20, 28, 0.95)), 
                      linear-gradient(135deg, rgba(237, 28, 36, 0.15), rgba(30, 144, 255, 0.15)) !important;
  }
  
  .category-popup-panel.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  [data-theme="light"] .category-popup-panel {
    background-image: linear-gradient(rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.98)), 
                      linear-gradient(135deg, rgba(237, 28, 36, 0.1), rgba(30, 144, 255, 0.1)) !important;
  }

  /* Handle thanh kéo giả lập Bottom Sheet */
  .category-popup-panel::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4.5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2) !important;
  }
  
  [data-theme="light"] .category-popup-panel::after {
    background: rgba(0, 0, 0, 0.15) !important;
  }

  /* Chừa chỗ padding trên cùng cho handle */
  .category-popup-panel .popup-border {
    padding-top: 20px !important;
  }

  /* Tăng chiều cao bottom sheet — chiếm 75% viewport */
  .category-popup-panel {
    max-height: 75vh !important;
    height: auto !important;
  }

  /* Tăng vùng list categories để fill bottom sheet */
  #popupCategoriesList {
    max-height: calc(75vh - 100px) !important;
  }
}