/* Giao diện riêng cho trang Đa phương tiện.
   Không tác động header, footer và các trang nội dung khác. */
body.media-view-active {
  font-family: "Inter", "Be Vietnam Pro", sans-serif;
  background: #f6f7f9;
}

body:not(.media-view-active) #mediaView {
  display: none !important;
}

body.media-view-active .main-content {
  width: 100%;
  max-width: 1480px;
  margin: 24px auto 38px;
  padding: 0 22px;
}

body.media-view-active .content-left {
  width: 100%;
  min-width: 0;
}

body.media-view-active .sidebar {
  display: none !important;
}

#mediaView,
#mediaView * {
  box-sizing: border-box;
}

#mediaView {
  width: 100%;
  color: #172033;
  font-family: "Inter", "Be Vietnam Pro", sans-serif;
}

/* Hero */
#mediaView .media-page-hero {
  min-height: 315px;
  padding: 42px 54px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(360px,.75fr);
  align-items: center;
  gap: 30px;
  border-radius: 10px;
  color: #fff;
  background:
    radial-gradient(circle at 76% 45%, rgba(255,70,70,.24), transparent 23%),
    linear-gradient(112deg,#410000 0%,#970009 53%,#430000 100%);
  box-shadow: 0 15px 35px rgba(77,0,5,.2);
}

#mediaView .media-page-hero::before,
#mediaView .media-page-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

#mediaView .media-page-hero::before {
  width: 520px;
  height: 520px;
  right: -150px;
  top: -220px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018);
}

#mediaView .media-page-hero::after {
  width: 280px;
  height: 2px;
  right: 80px;
  bottom: 60px;
  border-radius: 0;
  background: repeating-linear-gradient(90deg,rgba(255,196,0,.65) 0 3px,transparent 3px 8px);
  opacity: .55;
}

#mediaView .media-hero-copy,
#mediaView .media-hero-visual {
  position: relative;
  z-index: 1;
}

#mediaView .media-eyebrow {
  width: max-content;
  margin-bottom: 14px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 16px;
  background: rgba(255,255,255,.09);
  font-size: .66rem;
  font-weight: 750;
  text-transform: uppercase;
}

#mediaView .media-eyebrow i {
  color: #ffd342;
}

#mediaView .media-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-family: "Be Vietnam Pro", "Inter", sans-serif;
  font-size: 2rem;
  font-weight: 850;
  line-height: 1.3;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

#mediaView .media-hero-copy p {
  max-width: 690px;
  margin: 16px 0 22px;
  color: rgba(255,255,255,.78);
  font-size: .82rem;
  line-height: 1.7;
}

#mediaView .media-hero-copy button {
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 5px;
  color: #5c3100;
  background: linear-gradient(135deg,#ffd64d,#f3a900);
  box-shadow: 0 7px 18px rgba(0,0,0,.18);
  font-family: "Be Vietnam Pro", "Inter", sans-serif;
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

#mediaView .media-hero-visual {
  height: 220px;
}

#mediaView .media-play-disc {
  width: 118px;
  height: 118px;
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%,-50%);
  border: 4px solid rgba(255,255,255,.65);
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 38% 30%,#ff5b4c,#d00011 63%,#770006);
  box-shadow: 0 0 0 13px rgba(255,255,255,.06),0 18px 36px rgba(0,0,0,.3);
  font-size: 2rem;
}

#mediaView .media-play-disc i {
  margin-left: 7px;
}

#mediaView .media-visual-icon {
  width: 68px;
  height: 68px;
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  color: #ffd342;
  background: rgba(255,255,255,.08);
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
  backdrop-filter: blur(6px);
  font-size: 1.45rem;
}

#mediaView .media-visual-icon.video { left: 4%; top: 9%; transform:rotate(-8deg); }
#mediaView .media-visual-icon.image { right: 4%; top: 4%; transform:rotate(7deg); }
#mediaView .media-visual-icon.chart { left: 8%; bottom: 3%; transform:rotate(5deg); }
#mediaView .media-visual-icon.magazine { right: 7%; bottom: 0; transform:rotate(-6deg); }

/* Filter */
#mediaView .media-library {
  margin-top: 16px;
}

#mediaView .media-library-toolbar {
  min-height: 70px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid #e1e6ec;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15,23,42,.04);
}

#mediaView .media-filter-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

#mediaView .media-filter-tabs button {
  min-height: 38px;
  padding: 0 13px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e2e6ec;
  border-radius: 5px;
  color: #515d70;
  background: #fafbfc;
  font-family: "Be Vietnam Pro", "Inter", sans-serif;
  font-size: .62rem;
  font-weight: 700;
  cursor: pointer;
}

#mediaView .media-filter-tabs button:hover,
#mediaView .media-filter-tabs button.active {
  color: #fff;
  border-color: #c40010;
  background: #c40010;
}

#mediaView .media-library-search {
  width: min(340px,31%);
  min-width: 245px;
  min-height: 40px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #dce2e9;
  border-radius: 6px;
  background: #fafbfc;
}

#mediaView .media-library-search i {
  color: #c40010;
}

#mediaView .media-library-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #263146;
  background: transparent;
  font: 500 .67rem "Inter", sans-serif;
}

/* Sections */
#mediaView #mediaSectionsContainer {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

#mediaView .media-category-section {
  padding: 18px;
  border: 1px solid #e2e6ec;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15,23,42,.035);
}

#mediaView .media-section-heading {
  margin-bottom: 14px;
  padding-bottom: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e9edf2;
}

#mediaView .media-section-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

#mediaView .media-section-heading > div > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #c40010;
  background: #fff0f1;
}

#mediaView .media-section-heading h2 {
  margin: 0;
  color: #192235;
  font-family: "Be Vietnam Pro", "Inter", sans-serif;
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
}

#mediaView .media-section-heading small {
  color: #808997;
  font-size: .6rem;
}

#mediaView .media-content-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 13px;
}

#mediaView .media-content-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4e8ee;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: transform .22s ease,border-color .22s ease,box-shadow .22s ease;
}

#mediaView .media-content-card:hover {
  border-color: rgba(196,0,16,.25);
  box-shadow: 0 9px 22px rgba(15,23,42,.07);
  transform: translateY(-3px);
}

#mediaView .media-card-image {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #f0f2f5;
}

#mediaView .media-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease;
}

#mediaView .media-content-card:hover .media-card-image img {
  transform: scale(1.045);
}

#mediaView .media-type-chip {
  padding: 4px 7px;
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  color: #fff;
  background: rgba(169,0,12,.9);
  font-size: .52rem;
  font-weight: 750;
  backdrop-filter: blur(5px);
}

#mediaView .media-card-action {
  width: 34px;
  height: 34px;
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 50%;
  color: #c40010;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
  font-size: .65rem;
}

#mediaView .media-card-body {
  padding: 11px 12px 13px;
}

#mediaView .media-card-body time {
  display: block;
  margin-bottom: 5px;
  color: #848d9b;
  font-size: .56rem;
}

#mediaView .media-card-body h3 {
  min-height: 2.9em;
  margin: 0 0 6px;
  display: -webkit-box;
  overflow: hidden;
  color: #1b2537;
  font-family: "Be Vietnam Pro", "Inter", sans-serif;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

#mediaView .media-card-body p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #6c7686;
  font-size: .61rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

#mediaView .media-empty-state {
  min-height: 150px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: #87909d;
  border: 1px dashed #dce2e9;
  border-radius: 6px;
  background: #fafbfc;
  font-size: .7rem;
}

#mediaView .media-empty-state i {
  color: #c3c9d1;
  font-size: 1.5rem;
}

@media (max-width: 1100px) {
  #mediaView .media-page-hero {
    grid-template-columns: minmax(0,1fr) 300px;
  }
  #mediaView .media-content-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  #mediaView .media-library-toolbar {
    align-items:stretch;
    flex-direction:column;
  }
  #mediaView .media-library-search {
    width:100%;
    min-width:0;
  }
}

@media (max-width: 768px) {
  body.media-view-active .main-content {
    margin: 12px auto 26px !important;
    padding: 0 10px !important;
  }
  #mediaView .media-page-hero {
    min-height:0;
    padding: 24px 20px;
    grid-template-columns: 1fr;
    border-radius: 8px;
  }
  #mediaView .media-hero-copy h1 {
    font-size: 1.35rem;
  }
  #mediaView .media-hero-copy p {
    margin: 12px 0 18px;
    font-size: .72rem;
  }
  #mediaView .media-hero-visual {
    height: 150px;
  }
  #mediaView .media-play-disc {
    width: 86px;
    height: 86px;
    font-size:1.45rem;
  }
  #mediaView .media-visual-icon {
    width:50px;
    height:50px;
    font-size:1rem;
  }
  #mediaView .media-library-toolbar,
  #mediaView .media-category-section {
    padding: 11px;
  }
  #mediaView .media-content-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap:9px;
  }
  #mediaView .media-section-heading h2 {
    font-size:.75rem;
  }
  #mediaView .media-card-body {
    padding:9px;
  }
  #mediaView .media-card-body h3 {
    font-size:.64rem;
  }
  #mediaView .media-card-body p {
    display:none;
  }
}

@media (max-width: 430px) {
  #mediaView .media-page-hero {
    padding:21px 16px;
  }
  #mediaView .media-hero-visual {
    height:130px;
  }
  #mediaView .media-content-grid {
    grid-template-columns:1fr;
  }
  #mediaView .media-content-card {
    display:grid;
    grid-template-columns:124px minmax(0,1fr);
  }
  #mediaView .media-card-image {
    height:100%;
    min-height:95px;
    aspect-ratio:auto;
  }
  #mediaView .media-type-chip {
    display:none;
  }
  #mediaView .media-card-action {
    width:28px;
    height:28px;
    right:6px;
    bottom:6px;
  }
  #mediaView .media-card-body h3 {
    min-height:0;
  }
}
