/**
 * android-ui.css — phanmem.com
 * Giao diện CH Play / Material You cho Android phone + tablet
 * Chỉ áp dụng khi html[data-ui="android-mobile"]
 */

/* ============================================================
   BASE — áp dụng cho tất cả màn hình Android
============================================================ */
html[data-ui="android-mobile"] {
  --m3-primary:       #00b14f;
  --m3-on-primary:    #ffffff;
  --m3-primary-container: #b8f5ce;
  --m3-on-primary-container: #002112;
  --m3-surface:       #f8fdf9;
  --m3-surface-variant: #dce5dc;
  --m3-on-surface:    #191d19;
  --m3-on-surface-var:#404943;
  --m3-outline:       #707973;
  --m3-outline-var:   #bfc9bf;
  --m3-radius-xs:     4px;
  --m3-radius-sm:     8px;
  --m3-radius-md:     12px;
  --m3-radius-lg:     16px;
  --m3-radius-xl:     28px;
  --m3-font:          'Be Vietnam Pro', 'Roboto', sans-serif;
}

[data-theme="dark"] html[data-ui="android-mobile"],
html[data-ui="android-mobile"][data-theme="dark"] {
  --m3-primary:       #00d460;
  --m3-on-primary:    #003920;
  --m3-primary-container: #005230;
  --m3-on-primary-container: #b8f5ce;
  --m3-surface:       #111411;
  --m3-surface-variant: #404943;
  --m3-on-surface:    #e1e3de;
  --m3-on-surface-var:#bfc9bf;
  --m3-outline:       #8a9389;
  --m3-outline-var:   #404943;
}

/* ============================================================
   BODY & LAYOUT
============================================================ */
html[data-ui="android-mobile"] body {
  background: var(--m3-surface);
  font-family: var(--m3-font);
}

/* ============================================================
   HEADER — Material You top app bar
============================================================ */
html[data-ui="android-mobile"] .header {
  background: var(--m3-surface);
  backdrop-filter: none;
  border-bottom: none;
  box-shadow: none;
}

html[data-ui="android-mobile"] .header-top {
  height: 64px;
  padding: 0 16px;
  gap: 8px;
}

html[data-ui="android-mobile"] .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--m3-on-surface);
  letter-spacing: 0;
}

html[data-ui="android-mobile"] .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--m3-primary);
  border-radius: 50%;
}

/* Search bar — Material You style */
html[data-ui="android-mobile"] .search-bar input {
  height: 46px;
  border-radius: var(--m3-radius-xl);
  background: var(--m3-surface-variant);
  border: none;
  padding: 0 48px 0 20px;
  font-size: 14px;
  color: var(--m3-on-surface);
}

html[data-ui="android-mobile"] .search-bar input::placeholder {
  color: var(--m3-on-surface-var);
}

html[data-ui="android-mobile"] .search-bar input:focus {
  background: var(--m3-surface-variant);
  border: none;
  box-shadow: 0 0 0 2px var(--m3-primary);
}

/* ============================================================
   CATEGORY CHIPS — Material You filter chips
============================================================ */
html[data-ui="android-mobile"] .nav-bar {
  display: flex !important;
  background: var(--m3-surface);
  border-top: 1px solid var(--m3-outline-var);
  padding: 0;
}

html[data-ui="android-mobile"] .nav-inner {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 16px;
  gap: 8px;
  display: flex;
}

html[data-ui="android-mobile"] .nav-inner::-webkit-scrollbar { display: none; }

html[data-ui="android-mobile"] .nav-item {
  height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--m3-on-surface-var);
  background: transparent;
  border: 1px solid var(--m3-outline-var);
  white-space: nowrap;
  border-bottom: 1px solid var(--m3-outline-var);
  display: flex;
  align-items: center;
  gap: 6px;
}

html[data-ui="android-mobile"] .nav-item:hover,
html[data-ui="android-mobile"] .nav-item.active {
  background: var(--m3-primary-container);
  border-color: transparent;
  color: var(--m3-on-primary-container);
}

html[data-ui="android-mobile"] .mega-menu { display: none !important; }

/* ============================================================
   PRODUCT CARDS — Material You app list style
============================================================ */
html[data-ui="android-mobile"] .product-grid {
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 8px;
}

html[data-ui="android-mobile"] .product-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 12px 16px;
  gap: 0;
  flex-direction: row;
  align-items: center;
  border-bottom: 1px solid var(--m3-outline-var);
  box-shadow: none;
}

html[data-ui="android-mobile"] .product-card:hover {
  background: rgba(0,177,79,0.06);
  transform: none;
  box-shadow: none;
}

html[data-ui="android-mobile"] .product-card-header {
  flex: 1;
  gap: 14px;
}

html[data-ui="android-mobile"] .product-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--m3-radius-md);
  border: none;
  flex-shrink: 0;
}

html[data-ui="android-mobile"] .product-info {
  flex: 1;
}

html[data-ui="android-mobile"] .product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--m3-on-surface);
  margin-bottom: 2px;
}

html[data-ui="android-mobile"] .product-date {
  font-size: 12px;
  color: var(--m3-on-surface-var);
}

html[data-ui="android-mobile"] .product-desc { display: none; }

html[data-ui="android-mobile"] .product-footer { display: none; }

/* Nút tải — hiện ở bên phải mỗi row */
html[data-ui="android-mobile"] .product-card::after {
  display: none;
}

/* Rating nhỏ dưới tên */
html[data-ui="android-mobile"] .product-card .product-date::before {
  content: '';
}

/* ============================================================
   DOWNLOAD BUTTON — Material You style
============================================================ */
html[data-ui="android-mobile"] .android-dl-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

html[data-ui="android-mobile"] .android-btn-primary {
  height: 36px;
  padding: 0 16px;
  background: var(--m3-primary);
  color: var(--m3-on-primary);
  border: none;
  border-radius: 100px;
  font-family: var(--m3-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, box-shadow 0.15s;
}

html[data-ui="android-mobile"] .android-btn-primary:active {
  background: var(--m3-on-primary-container);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

html[data-ui="android-mobile"] .android-btn-store {
  height: 30px;
  padding: 0 12px;
  background: transparent;
  color: var(--m3-primary);
  border: 1px solid var(--m3-primary);
  border-radius: 100px;
  font-family: var(--m3-font);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

html[data-ui="android-mobile"] .android-btn-unavailable {
  height: 30px;
  padding: 0 12px;
  background: transparent;
  color: var(--m3-outline);
  border: 1px solid var(--m3-outline-var);
  border-radius: 100px;
  font-size: 11px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

html[data-ui="android-mobile"] .android-not-supported {
  font-size: 11px;
  color: var(--m3-outline);
  padding: 4px 8px;
  background: var(--m3-surface-variant);
  border-radius: 6px;
}

/* ============================================================
   SECTION HEADERS
============================================================ */
html[data-ui="android-mobile"] .section-header {
  padding: 16px 16px 8px;
}

html[data-ui="android-mobile"] .section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--m3-on-surface);
}

html[data-ui="android-mobile"] .section-title::before {
  background: var(--m3-primary);
  border-radius: 2px;
}

html[data-ui="android-mobile"] .see-all {
  color: var(--m3-primary);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   FLAGSHIP CARD — Featured app banner
============================================================ */
html[data-ui="android-mobile"] .product-card.flagship {
  flex-direction: column;
  background: var(--m3-primary-container);
  border-radius: var(--m3-radius-lg);
  margin: 0 16px 4px;
  padding: 16px;
  border-bottom: none;
  gap: 12px;
}

html[data-ui="android-mobile"] .product-card.flagship .product-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--m3-on-primary-container);
}

html[data-ui="android-mobile"] .product-card.flagship .product-desc {
  display: block;
  font-size: 13px;
  color: var(--m3-on-primary-container);
  opacity: 0.8;
  margin-bottom: 8px;
}

html[data-ui="android-mobile"] .product-card.flagship .product-footer {
  display: flex;
}

/* ============================================================
   HERO — Ẩn trên Android UI (không cần thiết)
============================================================ */
html[data-ui="android-mobile"] .hero { display: none; }
html[data-ui="android-mobile"] .trust-strip { display: none; }
html[data-ui="android-mobile"] #update-ticker { display: none; }

/* ============================================================
   MAIN CONTAINER — Full width, no sidebar
============================================================ */
html[data-ui="android-mobile"] .main-container {
  grid-template-columns: 1fr;
  padding: 0;
  gap: 0;
  max-width: 100%;
}

html[data-ui="android-mobile"] .sidebar-col { display: none; }
html[data-ui="android-mobile"] .top-row { padding: 0; }

/* ============================================================
   BOTTOM NAVIGATION BAR — Android style
============================================================ */
html[data-ui="android-mobile"] .android-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--m3-surface);
  border-top: 1px solid var(--m3-outline-var);
  display: flex;
  z-index: 200;
  box-shadow: 0 -1px 8px rgba(0,0,0,0.08);
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  border: none;
  background: transparent;
  font-family: var(--m3-font);
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab .tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: background 0.2s, width 0.2s;
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab.active .tab-icon {
  background: var(--m3-primary-container);
  width: 64px;
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab .tab-icon svg {
  width: 20px;
  height: 20px;
  color: var(--m3-on-surface-var);
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab.active .tab-icon svg {
  color: var(--m3-on-primary-container);
}

html[data-ui="android-mobile"] .android-bottom-nav .tab-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--m3-on-surface-var);
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab.active .tab-label {
  color: var(--m3-on-surface);
}

/* Space cho bottom nav */
html[data-ui="android-mobile"] body {
  padding-bottom: 56px;
}

/* ============================================================
   MOBILE ONLY: max 767px overrides
============================================================ */
@media (max-width: 767px) {
  html[data-ui="android-mobile"] .main-container {
    padding: 0 0 8px;
  }
}

/* ============================================================
   ANDROID UI v2 — Cập nhật theo thiết kế đã chốt
============================================================ */

/* ── Header v2: Logo + tên + 4 icon, bỏ search ── */
html[data-ui="android-mobile"] .header-top {
  height: 56px;
  padding: 0 14px;
  gap: 6px;
  justify-content: flex-start;
}

html[data-ui="android-mobile"] .logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--m3-on-surface);
  gap: 8px;
  flex: 1;
}

/* Ẩn search bar hoàn toàn trên Android */
html[data-ui="android-mobile"] .search-bar {
  display: none !important;
}

/* Giữ lại 4 icon: tin tức, video, yêu thích, dark mode */
/* Ẩn hamburger vì bottom nav đã có */
html[data-ui="android-mobile"] #hamburgerBtn {
  display: none !important;
}

/* ── Filter chips — bo tròn hơn ── */
html[data-ui="android-mobile"] .os-filter-btn {
  height: 32px;
  padding: 0 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--m3-outline-var);
  background: transparent;
  color: var(--m3-on-surface-var);
  min-height: 32px;
}

html[data-ui="android-mobile"] .os-filter-btn.active {
  background: var(--m3-primary-container);
  border-color: transparent;
  color: var(--m3-on-primary-container);
}

/* ── Flagship card — bo góc ── */
html[data-ui="android-mobile"] .product-card.flagship {
  border-radius: var(--m3-radius-lg) !important;
  margin: 12px 16px 4px !important;
  overflow: hidden;
}

/* ── Pagination — bo tròn ── */
html[data-ui="android-mobile"] .page-btn {
  border-radius: 100px !important;
  min-width: 36px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--m3-outline-var);
  background: transparent;
  color: var(--m3-on-surface);
}

html[data-ui="android-mobile"] .page-btn.active {
  background: var(--m3-primary) !important;
  border-color: var(--m3-primary) !important;
  color: white !important;
}

html[data-ui="android-mobile"] .pagination-bar {
  padding: 16px;
  gap: 8px;
  justify-content: center;
}

/* ── Nút Cài đặt thay APK ── */
html[data-ui="android-mobile"] .android-btn-primary {
  height: 36px;
  padding: 0 16px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--m3-primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  min-height: 36px;
}

/* ── Game cards — bo góc + nút Chơi ngay ── */
html[data-ui="android-mobile"] .kham-pha-grid .product-card,
html[data-ui="android-mobile"] #game-grid-wrap .product-card {
  border-radius: var(--m3-radius-lg) !important;
  overflow: hidden;
  border: none;
  border-bottom: none;
}

html[data-ui="android-mobile"] .game-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--m3-primary);
  color: white;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  min-height: 36px;
  font-family: var(--m3-font);
}

/* Game badge bo góc */
html[data-ui="android-mobile"] [class*="game-badge"],
html[data-ui="android-mobile"] .game-label {
  border-radius: var(--m3-radius-sm) !important;
  font-size: 11px !important;
  padding: 4px 10px !important;
}

/* ── Section spacing thoáng hơn ── */
html[data-ui="android-mobile"] .section-header {
  padding: 16px 16px 8px;
  margin-bottom: 0;
}

html[data-ui="android-mobile"] .content-area > * + * {
  margin-top: 8px;
}

/* ── Bottom nav 4 tab ── */
html[data-ui="android-mobile"] .android-bottom-nav {
  height: 60px;
  padding: 6px 0 4px;
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab {
  flex: 1;
}

html[data-ui="android-mobile"] .android-bottom-nav .tab-icon {
  width: 26px;
  height: 26px;
  border-radius: 14px;
  transition: background 0.2s, width 0.2s;
}

html[data-ui="android-mobile"] .android-bottom-nav .nav-tab.active .tab-icon {
  width: 56px;
  background: var(--m3-primary-container);
}

html[data-ui="android-mobile"] .android-bottom-nav .tab-label {
  font-size: 10px;
  font-weight: 500;
}

/* Body padding cho bottom nav 60px */
html[data-ui="android-mobile"] body {
  padding-bottom: 60px !important;
}

/* Ẩn game section trên mobile — game có trang riêng */
html[data-ui="android-mobile"] #game-online-section {
  display: none !important;
}
