* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  touch-action: manipulation;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  color: #fff;
  background: #020202;
  overflow-x: hidden;
  user-select: none;
}

input,
textarea,
button {
  font-size: 16px;
}

.app-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.14), transparent 25%),
    radial-gradient(circle at 84% 12%, rgba(255,255,255,0.08), transparent 26%),
    radial-gradient(circle at 50% 92%, rgba(255,255,255,0.06), transparent 32%),
    linear-gradient(145deg, #000000, #111111 58%, #030303);
  z-index: -1;
}

.glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.14);
}

.glass-soft {
  background: linear-gradient(145deg, rgba(255,255,255,0.17), rgba(255,255,255,0.06));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.icon-3d {
  transform-style: preserve-3d;
  box-shadow:
    0 8px 16px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -5px 12px rgba(0,0,0,0.32);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.icon-3d:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.icon-3d:active {
  transform: translateY(1px);
}

.topbar {
  position: sticky;
  top: 10px;
  margin: 10px;
  padding: 10px 12px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
  letter-spacing: 0.2px;
}

.logo {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffffff, #9e9e9e);
  color: #000;
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.main-search-btn,
.circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  border: 0;
  color: #000;
  cursor: pointer;
  font-size: 15px;
  background: linear-gradient(145deg, #ffffff, #9e9e9e);
}

.search-panel {
  width: 0;
  height: 38px;
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: width 0.22s ease, opacity 0.22s ease, padding 0.22s ease;
}

.search-panel.open {
  width: min(285px, 58vw);
  opacity: 1;
  pointer-events: auto;
  padding-left: 11px;
  padding-right: 4px;
}

.search-panel input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 16px;
  user-select: text;
}

.search-panel input::placeholder {
  color: rgba(255,255,255,0.55);
}

.mini-search-btn {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #9d9d9d);
  color: #000;
  cursor: pointer;
  font-size: 12px;
}

main {
  padding: 8px 12px 104px;
  max-width: 1180px;
  margin: auto;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.page.active {
  display: block;
  animation: smoothPage 0.22s ease forwards;
}

@keyframes smoothPage {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  min-height: 196px;
  border-radius: 28px;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(0,0,0,0.76), rgba(255,255,255,0.06)),
    url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
}

.tag {
  color: rgba(255,255,255,0.78);
  margin-bottom: 7px;
}

.hero h1 {
  font-size: clamp(25px, 5vw, 46px);
}

.play-btn,
.save-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(145deg, #fff, #9e9e9e);
  color: #000;
  font-weight: 850;
  cursor: pointer;
  font-size: 14px;
}

.ad-box {
  margin: 14px 0;
  border-radius: 20px;
  min-height: 62px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.56);
}

.section-title {
  margin: 18px 4px 12px;
  font-size: 22px;
}

.search-status {
  display: none;
  width: fit-content;
  margin: 12px auto 16px;
  padding: 12px 18px;
  border-radius: 999px;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.search-status.show {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.14);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.not-found {
  display: none;
  margin: 18px auto;
  width: fit-content;
  padding: 14px 24px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
}

.not-found.show {
  display: block;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

.movie-card {
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.movie-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.12);
}

.poster-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #111;
}

.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04);
}

.movie-content {
  padding: 11px 13px 13px;
}

.movie-content h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.movie-content p {
  color: rgba(255,255,255,0.58);
  font-size: 12px;
}

.video-card {
  border-radius: 26px;
  overflow: hidden;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  background: #000;
  display: block;
}

.video-info {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.video-info p {
  color: rgba(255,255,255,0.58);
  margin-top: 4px;
}

.video-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  color: #000;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  background: linear-gradient(145deg, #fff, #9e9e9e);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.progress-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border: 2px solid rgba(255,255,255,0.75);
}

.progress-badge.show {
  display: grid;
}

.history-list {
  display: grid;
  gap: 10px;
}

.download-row-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  align-items: stretch;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 1;
}

.download-row-wrap.revealed .swipe-actions {
  transform: translateX(0);
}

.swipe-actions button {
  border: 0;
  min-width: 78px;
  padding: 0 10px;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.delete-action {
  background: #b00020;
}

.cancel-action {
  background: #555;
}

.restart-action {
  background: #0f7b42;
}

.history-item {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.download-row-wrap.revealed .history-item {
  transform: translateX(-234px);
}

.history-item img {
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 13px;
  object-fit: cover;
}

.download-meta {
  flex: 1;
  min-width: 0;
}

.download-progress-line {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  margin-top: 8px;
  overflow: hidden;
}

.download-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 999px;
  transition: width 0.22s ease;
}

.small-note {
  color: rgba(255,255,255,0.58);
  margin: -3px 4px 13px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(540px, calc(100% - 24px));
  height: 68px;
  border-radius: 27px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 20;
}

.nav-item {
  margin: 7px;
  background: linear-gradient(145deg, rgba(255,255,255,0.17), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 20px;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 6px;
}

.nav-item span {
  font-size: 18px;
  line-height: 1;
}

.nav-item small {
  font-size: 10px;
  margin-top: 2px;
}

.nav-item.active {
  color: #000;
  background: linear-gradient(145deg, #ffffff, #9f9f9f);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.66);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.show {
  display: flex;
}

.user-modal {
  width: min(420px, 100%);
  border-radius: 28px;
  padding: 22px;
  position: relative;
}

.close-btn {
  position: absolute;
  right: 15px;
  top: 13px;
  border: 0;
  width: 31px;
  height: 31px;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #9e9e9e);
  color: #000;
  font-size: 22px;
  cursor: pointer;
}

.user-id-box {
  margin: 15px 0;
  padding: 13px;
  border-radius: 17px;
  display: flex;
  justify-content: space-between;
}

.name-input {
  width: 100%;
  margin: 9px 0 13px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 17px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  outline: 0;
  user-select: text;
}

.saved-name {
  margin-top: 11px;
  color: rgba(255,255,255,0.68);
}

@media (max-width: 620px) {
  .brand span {
    display: none;
  }

  .search-panel.open {
    width: min(230px, 55vw);
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .movie-grid {
    grid-template-columns: 1fr;
  }

  .video-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-item img {
    width: 100px;
  }

  .download-row-wrap.revealed .history-item {
    transform: translateX(-228px);
  }

  .swipe-actions button {
    min-width: 76px;
  }
}


/* ===== V5 FINAL FIXES ===== */
body {
  background: #000 !important;
  color: #fff !important;
}

.app-bg {
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.10), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(255,255,255,0.06), transparent 25%),
    linear-gradient(145deg, #000000, #090909 58%, #000000) !important;
}

.topbar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(255,255,255,0.10) !important;
}

.top-left-spacer {
  min-width: 48px;
}

.brand {
  display: none !important;
}

.site-title {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 950;
  letter-spacing: 0.8px;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 4px 12px rgba(0,0,0,0.85);
}

.site-logo {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffffff, #bdbdbd 52%, #5d5d5d);
  color: #000;
  font-weight: 950;
  font-size: 18px;
}

.top-actions {
  grid-column: 3;
  justify-self: end;
}

.main-search-btn,
.circle-btn,
.mini-search-btn,
.play-btn,
.save-btn,
.action-btn,
.nav-item.active,
.close-btn {
  background: linear-gradient(145deg, #ffffff 0%, #d9d9d9 48%, #8f8f8f 100%) !important;
  color: #000 !important;
  border: 1px solid rgba(255,255,255,0.95) !important;
}

.main-search-btn,
.circle-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 16px !important;
  font-size: 16px !important;
}

.icon-3d {
  box-shadow:
    0 10px 20px rgba(0,0,0,0.62),
    inset 0 2px 0 rgba(255,255,255,0.75),
    inset 0 -7px 14px rgba(0,0,0,0.30) !important;
  transform: perspective(500px) translateZ(0);
}

.icon-3d:hover {
  transform: perspective(500px) translateY(-2px) rotateX(5deg);
}

.glass {
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
}

.bottom-nav,
.topbar,
.ad-box,
.video-card,
.movie-card,
.user-modal {
  background: rgba(255,255,255,0.10) !important;
}

.nav-item {
  background: linear-gradient(145deg, #ffffff 0%, #cfcfcf 55%, #7e7e7e 100%) !important;
  color: #000 !important;
  border: 1px solid rgba(255,255,255,0.95) !important;
}

.nav-item span {
  font-size: 18px !important;
}

.nav-item small {
  color: #000 !important;
  font-weight: 800;
}

.search-panel {
  background: rgba(255,255,255,0.12) !important;
}

.search-panel input {
  color: #fff !important;
}

.search-panel input::placeholder {
  color: rgba(255,255,255,0.62) !important;
}

.progress-badge {
  display: none;
  background: #000 !important;
  color: #fff !important;
}

.progress-badge.show {
  display: grid !important;
}

@media (max-width: 620px) {
  .site-title {
    font-size: 20px;
  }
  .site-logo {
    width: 31px;
    height: 31px;
    font-size: 16px;
  }
  .top-left-spacer {
    min-width: 30px;
  }
}


/* ===== V6 SEARCH BAR + VIDEO SOCIAL FIXES ===== */
.topbar {
  grid-template-columns: 1fr auto 1fr !important;
  overflow: visible !important;
}

.top-actions {
  position: relative !important;
  display: flex !important;
  justify-content: flex-end !important;
  min-width: 96px;
}

.search-panel {
  position: absolute !important;
  right: 88px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 30;
  max-width: calc(100vw - 160px) !important;
}

.search-panel.open {
  width: min(250px, calc(100vw - 160px)) !important;
}

.site-title {
  pointer-events: none;
  white-space: nowrap;
}

.video-title-box {
  min-width: 0;
}

.watch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
}

#likeBtn.liked {
  background: linear-gradient(145deg, #ffffff 0%, #f4c8d4 48%, #d64b73 100%) !important;
  color: #000 !important;
}

@media (max-width: 620px) {
  .search-panel {
    right: 86px !important;
    max-width: calc(100vw - 138px) !important;
  }

  .search-panel.open {
    width: min(205px, calc(100vw - 138px)) !important;
  }

  .site-title span {
    font-size: 18px;
  }

  .top-actions {
    min-width: 86px;
  }

  .video-actions {
    width: 100%;
  }

  .action-btn {
    flex: 1;
    justify-content: center;
  }
}


/* ===== V7 SEARCH BAR CLEAN FIX ===== */
/* Search input ကို Silverx title ပေါ်မဖုံးအောင် top bar အောက်မှာ dropdown ပုံစံပြောင်းထားသည် */
.topbar {
  position: sticky !important;
  overflow: visible !important;
}

.top-actions {
  position: relative !important;
  z-index: 50 !important;
}

.search-panel {
  position: absolute !important;
  top: 52px !important;
  right: 0 !important;
  transform: none !important;
  width: 0 !important;
  height: 42px !important;
  max-width: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  padding: 0 !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,0.13) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  box-shadow:
    0 14px 28px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.18) !important;
}

.search-panel.open {
  width: 260px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  padding-left: 12px !important;
  padding-right: 6px !important;
}

.search-panel input {
  font-size: 15px !important;
  height: 100% !important;
  color: #fff !important;
}

.search-panel input::placeholder {
  color: rgba(255,255,255,0.60) !important;
}

.mini-search-btn {
  min-width: 31px !important;
  width: 31px !important;
  height: 31px !important;
  font-size: 12px !important;
}

.site-title {
  z-index: 1 !important;
}

@media (max-width: 620px) {
  .search-panel {
    top: 50px !important;
    right: -2px !important;
  }

  .search-panel.open {
    width: min(250px, calc(100vw - 34px)) !important;
  }
}


/* ===== V8 HEADER ALIGNMENT ===== */
.topbar{
  grid-template-columns:auto 1fr auto !important;
}

.top-left-spacer{
  display:none !important;
}

.site-title{
  grid-column:1 !important;
  justify-self:start !important;
  margin-left:8px !important;
  pointer-events:auto;
}

.site-logo{
  margin-right:4px;
}

.top-actions{
  grid-column:3 !important;
  justify-self:end !important;
}

.search-panel{
  right:0 !important;
}

@media (max-width:620px){
  .site-title{
    margin-left:4px !important;
  }

  .site-title span{
    display:block !important;
    font-size:18px !important;
  }

  .search-panel.open{
    width:min(270px,calc(100vw - 90px)) !important;
  }
}


/* ===== V11: V8 SAME STYLE, ONLY SEARCH ICON REMOVED ===== */
.top-actions {
  min-width: auto !important;
}

.main-search-btn,
.search-panel {
  display: none !important;
}


/* ===== V13: ONLY Featured Movie card removed, Movie list remains ===== */
.hero {
  display: none !important;
}
