/* Trang "Sản phẩm dự thi" — nạp SAU style.css (dùng lại header/nav/logo/
   button đã có ở đó cho đồng bộ toàn site) rồi đè nền toàn trang sang màu
   sáng — yêu cầu riêng cho trang này, style.css/index.html giữ nguyên nền
   tối. Cùng font (Montserrat/Be Vietnam Pro) và biến màu navy/vàng đã dùng
   xuyên suốt dự án (xem judge-dashboard.css cho bảng màu sáng tương tự). */
:root {
  --spdt-bg: #fbf7ee;
  --spdt-surface: #ffffff;
  --spdt-border: #efe4cd;
  --spdt-ink: #1a1435;
  --spdt-ink-muted: #6b7280;
}

body {
  background: var(--spdt-bg);
  color: var(--spdt-ink);
}

.main-nav a.is-active {
  color: var(--gold-300);
  font-weight: 700;
}

/* ---------- Hero ---------- */
/* Ảnh thật (images/spdt-hero-banner.png, 2170×374) đã có sẵn đầy đủ chữ +
   số liệu — ép đúng tỉ lệ khung hình gốc bằng aspect-ratio để
   background-size:cover luôn vừa khít 100% ảnh ở MỌI độ rộng màn hình,
   không crop mất chữ 2 bên mép (cùng kỹ thuật .conquer/.conquer-bg ở
   index.html). Thay cho layout 2 cột chữ+ảnh cũ (2026-09-22). */
.spdt-hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2170 / 374;
  background: var(--navy-950);
}

.spdt-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("../images/spdt-hero-banner.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* ---------- Bộ lọc ---------- */
.spdt-filters {
  background: var(--spdt-surface);
  border-bottom: 1px solid var(--spdt-border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 40;
}

.spdt-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.spdt-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}

.spdt-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--spdt-ink-muted);
}

.spdt-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border-radius: 10px;
  border: 1px solid var(--spdt-border);
  background: var(--spdt-bg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--spdt-ink);
}

.spdt-search input:focus {
  outline: 2px solid var(--gold-500);
  outline-offset: 1px;
}

.spdt-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spdt-selects select {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--spdt-border);
  background: var(--spdt-bg);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--spdt-ink);
}

.spdt-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.spdt-sort-label {
  font-size: 0.8125rem;
  color: var(--spdt-ink-muted);
  white-space: nowrap;
}

.spdt-sort-tabs {
  display: flex;
  gap: 4px;
  background: var(--spdt-bg);
  border: 1px solid var(--spdt-border);
  border-radius: 999px;
  padding: 3px;
}

.spdt-sort-tabs button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--spdt-ink-muted);
  cursor: pointer;
  white-space: nowrap;
}

.spdt-sort-tabs button.is-active {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-700));
  color: #241a05;
}

.spdt-result-count {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--spdt-ink-muted);
}

.spdt-result-count strong {
  color: var(--spdt-ink);
}

/* ---------- Lưới video ---------- */
.spdt-grid-section {
  padding: 28px 0 8px;
}

.spdt-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

/* Đổi từ <a> sang <button> (2026-09-21, mở popup thay vì chuyển trang) —
   reset các thuộc tính mặc định của button (margin/padding/font/text-align)
   để giữ nguyên hình dáng cũ. */
.spdt-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--spdt-surface);
  border: 1px solid var(--spdt-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.spdt-card:hover {
  box-shadow: 0 14px 30px rgba(10, 14, 39, 0.1);
  transform: translateY(-2px);
}

.spdt-card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  text-decoration: none;
}

.spdt-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spdt-card-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
}

.spdt-card-thumb-fallback svg {
  width: 30px;
  height: 30px;
}

.spdt-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: var(--blue-500);
}

.spdt-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: rgba(10, 14, 39, 0.25);
}

.spdt-card:hover .spdt-card-play {
  opacity: 1;
}

.spdt-card-play svg {
  width: 42px;
  height: 42px;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.spdt-card-body {
  padding: 12px 14px 14px;
}

.spdt-card-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--spdt-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spdt-card-meta {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--spdt-ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spdt-card-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.spdt-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--spdt-ink-muted);
}

.spdt-card-stats svg {
  width: 13px;
  height: 13px;
}

.spdt-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--spdt-ink-muted);
}

/* ---------- Tiêu đề khu vực Bảng đơn/Bảng đôi ---------- */
.spdt-section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--spdt-ink);
}

.spdt-section-title-duo {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--spdt-border);
}

/* ---------- Phân trang ---------- */
.spdt-pagination-bar {
  display: flex;
  justify-content: center;
  margin: 28px 0 8px;
}

.spdt-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.spdt-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--spdt-border);
  background: #fff;
  color: var(--spdt-ink);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.spdt-page-btn.is-active {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-700));
  border-color: transparent;
  color: #241a05;
}

.spdt-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.spdt-page-ellipsis {
  padding: 0 4px;
  color: var(--spdt-ink-muted);
  font-size: 0.8125rem;
}

/* ---------- Video nổi bật ---------- */
.spdt-featured {
  background: linear-gradient(90deg, var(--navy-950), var(--navy-900));
  padding: 32px 0;
  margin-top: 40px;
}

.spdt-featured-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.spdt-featured-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  width: 220px;
}

.spdt-featured-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-700));
  color: #241a05;
  flex-shrink: 0;
}

.spdt-featured-icon svg {
  width: 22px;
  height: 22px;
}

.spdt-featured-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spdt-featured-text strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  color: #fff;
}

.spdt-featured-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.spdt-featured-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

/* Đổi từ <a> sang <button> (2026-09-21, cùng lý do với .spdt-card) — reset
   thuộc tính mặc định của button. */
.spdt-featured-card {
  flex: 0 0 auto;
  width: 200px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.spdt-featured-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--navy-800);
}

.spdt-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spdt-featured-name {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spdt-featured-stats {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spdt-featured-stats svg {
  width: 12px;
  height: 12px;
}

/* ---------- Footer ---------- */
.spdt-footer {
  background: var(--spdt-surface);
  border-top: 1px solid var(--spdt-border);
  padding: 40px 0 0;
  margin-top: 0;
}

.spdt-footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
}

.spdt-footer-brand .logo {
  margin-bottom: 10px;
}

/* Logo header phóng to hết cỡ (64px) theo yêu cầu, nhưng ở footer giữ cỡ
   vừa phải hơn — 64px sẽ lấn át cả khối text mô tả bên dưới. */
.spdt-footer-brand .logo-icon {
  height: 40px;
}

.spdt-footer-brand p {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  color: var(--gold-700);
  font-weight: 600;
}

.spdt-footer-desc {
  color: var(--spdt-ink-muted) !important;
  font-weight: 400 !important;
  line-height: 1.6;
}

.spdt-footer-contact,
.spdt-footer-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spdt-footer-contact strong,
.spdt-footer-social strong,
.spdt-footer-legal-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  color: var(--spdt-ink);
  margin-bottom: 2px;
}

.spdt-footer-contact a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--spdt-ink-muted);
  text-decoration: none;
}

.spdt-footer-contact a:hover {
  color: var(--gold-700);
}

.spdt-footer-contact svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.spdt-footer-social-icons {
  display: flex;
  gap: 8px;
}

.spdt-footer-social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--spdt-bg);
  color: var(--spdt-ink);
}

.spdt-footer-social-icons svg {
  width: 16px;
  height: 16px;
}

.spdt-footer-legal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spdt-footer-legal a {
  font-size: 0.8125rem;
  color: var(--spdt-ink-muted);
  text-decoration: none;
}

.spdt-footer-legal a:hover {
  color: var(--gold-700);
}

.spdt-footer-bottom {
  border-top: 1px solid var(--spdt-border);
  padding: 16px 0;
}

.spdt-footer-bottom p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--spdt-ink-muted);
  text-align: center;
}

/* ---------- Toast ---------- */
.spdt-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-950);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}

.spdt-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Popup xem nhanh ---------- */
.spdt-popup-overlay[hidden] {
  display: none;
}

.spdt-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 14, 39, 0.72);
}

.spdt-popup {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: var(--spdt-surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.spdt-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(10, 14, 39, 0.55);
  color: #fff;
  cursor: pointer;
}

.spdt-popup-close svg {
  width: 16px;
  height: 16px;
}

.spdt-popup-close:hover {
  background: rgba(10, 14, 39, 0.8);
}

.spdt-popup-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--navy-950);
}

.spdt-popup-media iframe,
.spdt-popup-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

.spdt-popup-media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(10, 14, 39, 0.55);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 20px;
}

.spdt-popup-media-fallback a {
  color: var(--gold-300);
  font-weight: 700;
  text-decoration: underline;
}

.spdt-popup-body {
  padding: 20px 24px 24px;
}

.spdt-popup-name {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--spdt-ink);
}

.spdt-popup-meta {
  margin: 0 0 18px;
  font-size: 0.8125rem;
  color: var(--spdt-ink-muted);
}

.spdt-popup-actions {
  display: flex;
  gap: 10px;
}

.spdt-popup-like,
.spdt-popup-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--spdt-border);
  background: var(--spdt-bg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--spdt-ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.spdt-popup-like svg {
  width: 18px;
  height: 18px;
}

.spdt-popup-like:hover {
  border-color: #f4436c;
}

.spdt-popup-like.is-liked {
  background: #fdeaef;
  border-color: #f4436c;
  color: #c2185b;
}

.spdt-popup-like.is-liked svg {
  fill: #f4436c;
  stroke: #f4436c;
}

.spdt-popup-share svg {
  width: 16px;
  height: 16px;
}

.spdt-popup-share:hover {
  border-color: var(--gold-500);
  color: var(--gold-700);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .spdt-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .spdt-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .spdt-sort {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .spdt-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .spdt-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .spdt-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .spdt-selects {
    flex-wrap: wrap;
  }

  .spdt-selects select {
    flex: 1 1 45%;
  }

  .spdt-featured-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .spdt-footer-inner {
    grid-template-columns: 1fr;
  }
}
