/* H-Donghua V2 Global Responsive Breakpoints */

/* --- Large Devices / Small Desktops (max-width: 1200px) --- */
@media (max-width: 1200px) {
  :root {
    --hd-spacing-xl: 1.5rem;
    --hd-spacing-xxl: 2rem;
  }
  
  .hd-single-layout-grid {
    grid-template-columns: 280px 1fr;
    gap: var(--hd-spacing-lg);
  }
}

/* --- Tablets (max-width: 992px) --- */
@media (max-width: 992px) {
  /* Homepage sidebar grid collapse */
  .hd-homepage-content-grid {
    grid-template-columns: 1fr;
    gap: var(--hd-spacing-xl);
  }
  
  .hd-sidebar-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hd-spacing-lg);
  }

  .hd-sidebar-widget {
    margin-bottom: 0;
  }

  /* Single Detail Page Layout Collapse */
  .hd-single-layout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hd-spacing-xl);
  }

  .hd-single-sidebar {
    position: relative !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .hd-sidebar-sticky-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hd-spacing-md);
    width: 100%;
  }

  .hd-single-poster-wrap {
    width: 160px;
    margin: -60px auto var(--hd-spacing-md) auto;
    box-shadow: var(--hd-shadow-xl);
    border-radius: var(--hd-radius-md);
    border: 2px solid rgba(255, 255, 255, 0.1);
  }

  .hd-rating-gauge-wrap,
  .hd-sidebar-actions,
  .hd-sidebar-meta-list {
    width: 100%;
    max-width: 340px;
    margin: 0 auto var(--hd-spacing-md) auto;
  }

  .hd-single-main-col {
    min-width: 0;
  }
}

/* --- Small Tablets & Large Mobiles (max-width: 768px) --- */
@media (max-width: 768px) {
  :root {
    --hd-text-3xl: 1.75rem;
    --hd-text-2xl: 1.5rem;
    --hd-text-xl: 1.25rem;
  }

  /* Sidebar column stacks vertically */
  .hd-sidebar-column {
    grid-template-columns: 1fr;
  }

  /* Slider heights */
  .hd-hero-slide {
    height: 480px;
  }

  .hd-hero-details-card {
    padding: var(--hd-spacing-lg);
  }

  .hd-hero-synopsis {
    display: none; /* Hide long synopses on mobile hero */
  }

  /* Tabs slider navigations */
  .hd-tabs-nav-capsule {
    display: flex !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
  }

  .hd-tabs-nav-capsule::-webkit-scrollbar {
    display: none !important;
  }
  
  .hd-tabs-nav-capsule .hd-tab-btn {
    flex-shrink: 0 !important;
    padding: 8px 16px !important;
    font-size: var(--hd-text-sm) !important;
  }

  /* Schedule page specific tab buttons */
  .hd-tabs-nav-capsule .hd-schedule-tab-btn {
    min-width: 76px !important;
    height: auto !important;
    padding: 8px 10px !important;
  }

  /* Single detail page sidebar stacks vertically */
  .hd-sidebar-sticky-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hd-single-poster-wrap {
    width: 200px;
  }

  .hd-rating-gauge-wrap {
    justify-content: center;
  }

  .hd-side-meta-item {
    justify-content: center;
    text-align: center;
  }
}

/* --- Mobiles (max-width: 480px) --- */
@media (max-width: 480px) {
  :root {
    --hd-spacing-md: 0.75rem;
    --hd-spacing-lg: 1rem;
    --hd-spacing-xl: 1.25rem;
  }

  .container {
    padding-left: var(--hd-spacing-sm);
    padding-right: var(--hd-spacing-sm);
  }

  /* Cards grids */
  .hd-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--hd-spacing-sm) !important;
  }

  .hd-cards-grid.grid-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Hero adjustments */
  .hd-hero-slide {
    height: 400px;
  }

  .hd-hero-title {
    font-size: 1.5rem;
  }

  .hd-hero-actions {
    flex-direction: column;
    gap: var(--hd-spacing-xs);
  }

  .hd-btn {
    width: 100%;
    justify-content: center;
  }

  /* Header action margins */
  .hd-header-inner {
    padding-left: var(--hd-spacing-sm);
    padding-right: var(--hd-spacing-sm);
  }

  .hd-logo-link {
    font-size: 16px;
  }
}

/* ==========================================================================
   🚨 PREMIUM MOBILE REDESIGN STYLING (Bottom App Bar & Slide Drawer)
   ========================================================================== */

/* 1. BOTTOM APP NAVIGATION BAR */
.hd-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(10, 11, 15, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: none; /* Hidden on desktop */
  justify-content: space-around;
  align-items: center;
  z-index: 990;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  transition: transform var(--hd-duration-normal) var(--hd-ease-out);
}

.hd-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--hd-text-muted);
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  padding: 4px 0;
  gap: 3px;
  cursor: pointer;
  transition: color var(--hd-duration-fast) var(--hd-ease-out);
  position: relative;
  width: 20%;
  height: 100%;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hd-bottom-nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: transform var(--hd-duration-normal) var(--hd-ease-elastic);
}

.hd-bottom-nav-item:hover,
.hd-bottom-nav-item.active {
  color: var(--hd-primary);
}

.hd-bottom-nav-item.active .hd-bottom-nav-icon {
  transform: translateY(-2px);
  color: var(--hd-primary);
}

/* Neon Active indicator dot */
.hd-bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--hd-primary);
  box-shadow: 0 0 6px var(--hd-primary-glow);
}

/* 2. MOBILE NAVIGATION DRAWER */
.hd-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  transition: visibility var(--hd-duration-normal) step-end;
}

.hd-mobile-drawer.active {
  visibility: visible;
  transition: visibility var(--hd-duration-normal) step-start;
}

.hd-mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity var(--hd-duration-normal) var(--hd-ease-out);
}

.hd-mobile-drawer.active .hd-mobile-drawer-overlay {
  opacity: 1;
}

.hd-mobile-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: rgba(12, 13, 18, 0.94);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translate3d(100%, 0, 0);
  transition: transform var(--hd-duration-cinematic) var(--hd-ease-out);
}

.hd-mobile-drawer.active .hd-mobile-drawer-content {
  transform: translate3d(0, 0, 0);
}

.hd-mobile-drawer-header {
  padding: var(--hd-spacing-lg) var(--hd-spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hd-mobile-drawer-logo {
  font-family: var(--hd-font-display);
  font-size: var(--hd-text-lg);
  font-weight: 800;
  color: var(--hd-text-main);
  letter-spacing: 0.05em;
}

.hd-mobile-drawer-close {
  font-size: 32px;
  color: var(--hd-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--hd-duration-fast) var(--hd-ease-out);
  line-height: 1;
}

.hd-mobile-drawer-close:hover {
  color: var(--hd-primary);
}

.hd-mobile-drawer-body {
  padding: var(--hd-spacing-md);
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--hd-spacing-lg);
}

/* Drawer Search Box */
.hd-mobile-drawer-search {
  width: 100%;
}

.hd-drawer-search-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hd-radius-md);
  display: flex;
  align-items: center;
  transition: border-color var(--hd-duration-normal) var(--hd-ease-out);
}

.hd-drawer-search-wrapper:focus-within {
  border-color: var(--hd-primary);
  box-shadow: var(--hd-glow-primary);
}

.hd-drawer-search-wrapper input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  font-size: 13px;
  color: #fff;
  outline: none;
}

.hd-drawer-search-wrapper button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hd-text-muted);
  cursor: pointer;
}

/* Drawer Menu Items */
.hd-mobile-drawer-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--hd-spacing-xs);
}

.hd-mobile-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--hd-radius-md);
  color: var(--hd-text-muted);
  font-weight: 600;
  font-size: var(--hd-text-sm);
  transition: all var(--hd-duration-fast) var(--hd-ease-out);
}

.hd-mobile-drawer-nav a svg {
  stroke: currentColor;
  stroke-width: 2;
  transition: transform var(--hd-duration-fast) var(--hd-ease-out), color var(--hd-duration-fast) var(--hd-ease-out), filter var(--hd-duration-fast) var(--hd-ease-out);
  flex-shrink: 0;
}

.hd-mobile-drawer-nav a:hover,
.hd-mobile-drawer-nav a.active,
.hd-mobile-drawer-nav li.current-menu-item a {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding-left: 20px; /* Subtle slide-in effect */
}

.hd-mobile-drawer-nav a:hover svg,
.hd-mobile-drawer-nav a.active svg,
.hd-mobile-drawer-nav li.current-menu-item a svg {
  color: var(--hd-primary);
  filter: drop-shadow(0 0 6px var(--hd-primary-glow));
  transform: scale(1.08);
}

/* Drawer Footer */
.hd-mobile-drawer-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--hd-spacing-md);
}

.hd-mobile-drawer-footer h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hd-text-dim);
  margin-bottom: 12px;
}

.hd-drawer-socials {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.hd-drawer-social-btn {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  border-radius: var(--hd-radius-sm);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--hd-duration-fast) var(--hd-ease-out);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hd-drawer-social-btn.discord {
  background: rgba(88, 101, 242, 0.1);
  color: #5865f2;
  border-color: rgba(88, 101, 242, 0.2);
}

.hd-drawer-social-btn.telegram {
  background: rgba(0, 136, 204, 0.1);
  color: #0088cc;
  border-color: rgba(0, 136, 204, 0.2);
}

.hd-drawer-social-btn:hover {
  filter: brightness(1.25);
  transform: translateY(-2px);
}

.hd-drawer-disclaimer {
  font-size: 10px;
  color: var(--hd-text-dim);
  line-height: 1.5;
}

/* 3. MEDIA QUERY OVERRIDES FOR SCREEN SIZES <= 768PX */
@media (max-width: 768px) {
  .hd-bottom-nav {
    display: flex; /* Activate Bottom App Nav */
  }

  .hd-main-content {
    padding-bottom: calc(var(--hd-spacing-xxl) + 64px) !important; /* Spacing for Bottom Nav */
  }

  .hd-header {
    height: 58px; /* Compact top header */
  }

  .hd-logo-link {
    font-size: 18px !important;
  }

  .hd-menu-toggle {
    display: none !important; /* Hide header hamburger toggle */
  }
}

