:root {
  --primary-color: #6366f1; /* AE Purple Accent */
  --primary-hover: #4f46e5;
  --secondary-color: #0f172a;
  --accent-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --max-width: 1200px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Navbar */
.header {
  background-color: var(--secondary-color);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.logo span {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: #94a3b8;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
}

/* Hero Section */
.hero {
  padding: 4.5rem 0;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: white;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #cbd5e1;
  max-width: 650px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-donate {
  background-color: var(--accent-color);
  color: white;
  padding: 0.9rem 2.2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 1rem;
}

/* Product Cards Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
}

.product-card-body {
  padding: 1.5rem;
}

.product-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.product-card-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* Product Detail & Sidebar Ads Layout */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin: 2.5rem 0;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.download-box {
  background: var(--card-bg);
  padding: 1.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  text-align: center;
  margin-top: 1.5rem;
}

/* Ad Banners Module */
.ad-module {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ad-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.hidden {
  display: none !important;
}

footer {
  margin-top: auto;
  background: var(--secondary-color);
  color: #94a3b8;
  text-align: center;
  padding: 1.8rem 0;
  font-size: 0.9rem;
}

/* Responsive Queries */
@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--secondary-color);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.2rem;
    display: none;
  }

  .nav-menu.active {
    display: flex;
  }
}
/* Styling Category Filter Buttons */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Category Badge bên trong Card */
.category-badge {
  display: inline-block;
  background-color: #e0e7ff;
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.download-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px dashed var(--border-color);
}

.download-stats b {
  color: var(--primary-color);
}
/* Layout cho Thanh Controls (Filter + Sort) */
.catalog-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.sort-select {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.sort-select:focus {
  border-color: var(--primary-color);
}

/* Metadata ngày cập nhật & lượt tải trên Card */
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 0.5rem 0 1rem 0;
}

/* Styling cho Thanh Phân Trang 1 - 2 - 3 */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.page-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Card sản phẩm có Background hình ảnh mờ 33% */
.product-card {
  position: relative;
  background-color: var(--card-bg, #1e1e24);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color, #6366f1);
}

/* Lớp phủ ảnh Background độ mờ 33% */
.product-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.33; /* ĐÚNG 33% OPACITY */
  z-index: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover .product-card-bg {
  opacity: 0.45; /* Tăng nhẹ độ mờ khi hover cho sinh động */
  transform: scale(1.03);
}

/* Nội dung bên trong nổi lên trên background */
.product-card-body {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, rgba(18,18,20,0.4) 0%, rgba(18,18,20,0.85) 100%);
}

.category-badge {
  align-self: flex-start;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.product-card-title {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #a1a1aa;
  margin-bottom: 1rem;
}

.product-card-desc {
  font-size: 0.9rem;
  color: #d4d4d8;
  flex-grow: 1;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}