/* =========================================================================
   PHIMHEOVINA - MAIN STYLESHEET
   Giao diện chuẩn hiện đại PHIMHEOVINA, tông màu Cyan (#20c4cb) & Dark Charcoal
   Tối ưu tốc độ tải trang, tương thích 100% Mobile & Desktop
   ========================================================================= */

:root {
  --bg-body: #11161d;
  --bg-surface: #161c24;
  --bg-surface-elevated: #1e2632;
  --bg-glass: rgba(17, 22, 29, 0.96);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(32, 196, 203, 0.5);
  
  --primary: #20c4cb;
  --primary-hover: #1ab0b7;
  --primary-glow: rgba(32, 196, 203, 0.35);
  
  --accent-gold: #f59e0b;
  --accent-blue: #20c4cb;
  
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #718096;
  
  --font-main: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;
  
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  --container-max: 1360px;
  --header-height: 60px;
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  background-color: var(--bg-body);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

button, input {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* ================= TOP HEADER (Chuẩn phong cách PHIMHEOVINA) ================= */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 56px;
  background: #12161d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
}

.branding-logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.5px;
  color: #20c4cb !important;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}

.branding-logo:hover {
  opacity: 0.9;
  color: #2bd3d7 !important;
}

.branding-logo .logo-text,
.branding-logo #brand-main {
  color: #20c4cb !important;
  font-weight: 900;
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  font-size: 26px;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.branding-logo .logo-badge,
.branding-logo .logo-highlight,
.branding-logo .logo-domain {
  display: none !important;
}

/* Header Nav Menu (Nằm ngang 1 hàng duy nhất ngay cạnh logo) */
.header-nav-menu {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px;
  margin-left: 28px;
  margin-right: auto;
  flex-shrink: 0;
}

.header-nav-menu .nav-link,
.header-nav-menu .nav-dropdown-btn {
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: color 0.18s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 0;
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  line-height: 1;
}

.header-nav-menu .nav-link:hover,
.header-nav-menu .nav-link.active,
.header-nav-menu .nav-dropdown-btn:hover {
  color: #20c4cb;
}

/* Dropdown THỂ LOẠI */
.nav-dropdown-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-dropdown-btn i {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.nav-dropdown-item:hover .nav-dropdown-btn i {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: #161c24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  padding: 6px 0;
  z-index: 1001;
}

.nav-dropdown-item:hover .nav-dropdown-menu,
.nav-dropdown-item.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: rgba(32, 196, 203, 0.15);
  color: #20c4cb;
}

/* Header Search Box */
.header-search-wrap {
  width: 210px;
  flex-shrink: 0;
}

.search-box-form {
  position: relative;
  display: flex;
  align-items: center;
  background: #1a222d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 0 12px;
  height: 34px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-box-form:focus-within {
  border-color: #20c4cb;
  background: #1d2734;
}

.search-box-btn {
  background: none;
  border: none;
  color: #20c4cb;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.search-box-input {
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-size: 12.5px;
  width: 100%;
  font-family: inherit;
}

.search-box-input::placeholder {
  color: #64748b;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 960px) {
  .header-nav-menu {
    display: none;
  }
  .header-nav-menu.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #11161d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 16px;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    box-shadow: 0 10px 24px rgba(0,0,0,0.6);
  }
  .mobile-nav-toggle {
    display: block;
  }
  .header-search-wrap {
    width: 170px;
  }
}

/* ================= CATEGORY HORIZONTAL NAV (Optional / Fallback) ================= */
.category-nav-bar {
  display: none; /* Ẩn theo đúng giao diện ảnh mẫu */
}

/* ================= MAIN CONTENT WRAPPER ================= */
.main-wrapper {
  flex: 1;
  padding: 16px 0 40px;
}

/* Layout Columns */
.layout-cols {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

#home-view .layout-cols {
  display: block;
}

#home-view .sidebar-wrapper {
  display: none;
}

#home-view .content-left {
  width: 100%;
}

/* Section Header Bar: | PHIM SEX MỚI > */
.section-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 14px 0;
  gap: 12px;
}

.section-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.section-title-bar {
  color: #20c4cb;
  font-weight: 900;
  font-size: 18px;
  margin-right: 2px;
}

.section-title-arrow {
  color: #20c4cb;
  font-size: 13px;
  margin-left: 4px;
}

/* Sort tabs ẩn theo phong cách ảnh mẫu */
.sort-tabs-group {
  display: none;
}

/* ================= VIDEO GRID (4 Columns trên Desktop) ================= */
.video-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1120px) {
  .video-grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (max-width: 680px) {
  .video-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ================= VIDEO CARD ================= */
.video-card {
  background: transparent;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.5;
  background: #18202b;
  border-radius: 3px;
  overflow: hidden;
}

.video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.2s ease;
}

.video-card:hover .video-thumb-img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* Badge hiển thị lượt xem kèm icon con mắt ở góc dưới phải ảnh thumbnail */
.video-views-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.video-views-badge i {
  font-size: 10px;
}

.video-card-body {
  padding: 6px 0 2px 0;
}

.video-card-title {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.video-card-title a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.video-card:hover .video-card-title a,
.video-card-title a:hover {
  color: #20c4cb;
}

/* ================= PAGINATION ================= */
.pagination-wrapper {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 4px;
  background: #161c24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}

.page-btn:hover {
  border-color: #20c4cb;
  color: #20c4cb;
  background: rgba(32, 196, 203, 0.1);
}

.page-btn.active {
  background: #20c4cb;
  color: #11161d;
  border-color: #20c4cb;
  font-weight: 700;
}

.page-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ================= SIDEBAR (Cho Watch View) ================= */
.sidebar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trending-item {
  display: flex;
  gap: 12px;
  align-items: center;
  transition: transform 0.2s;
}

.trending-item:hover {
  transform: translateX(4px);
}

.trending-thumb-wrap {
  width: 90px;
  height: 54px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

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

.trending-info {
  flex: 1;
  min-width: 0;
}

.trending-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.trending-item:hover .trending-title {
  color: #20c4cb;
}

.trending-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= WATCH VIEW STYLES ================= */
.watch-breadcrumbs {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.watch-breadcrumbs a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.watch-breadcrumbs a:hover {
  color: #20c4cb;
}

.watch-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 14px;
}

.watch-info-section {
  margin-top: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.watch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.watch-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watch-cat-badge {
  padding: 4px 10px;
  background: rgba(32, 196, 203, 0.15);
  color: #20c4cb;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.watch-views-count {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.watch-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-pill {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-action-pill:hover, .btn-action-pill.active {
  background: rgba(32, 196, 203, 0.15);
  border-color: #20c4cb;
  color: #20c4cb;
}

.telegram-cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(32, 196, 203, 0.15));
  border: 1px solid rgba(32, 196, 203, 0.35);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.tg-cta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.tg-cta-left i {
  color: #38bdf8;
  font-size: 18px;
}

.btn-join-tg-pill {
  padding: 6px 16px;
  background: #0ea5e9;
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-join-tg-pill:hover {
  background: #0284c7;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
}

.watch-desc-box {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.watch-tags-wrap {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-tag-pill {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.watch-tag-pill:hover {
  background: rgba(32, 196, 203, 0.15);
  color: #20c4cb;
}

/* ================= FOOTER ================= */
#site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0e1218;
  padding: 32px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.footer-desc {
  max-width: 760px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #20c4cb;
}

.footer-copyright {
  font-size: 11.5px;
  color: #4b5563;
}

/* ================= TOAST NOTIFICATION ================= */
#global-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #1e2632;
  border: 1px solid rgba(32, 196, 203, 0.4);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

#global-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
