:root {
  --bg-color: #0b0f19;
  --header-bg: rgba(15, 23, 42, 0.92);
  --bottom-nav-bg: rgba(11, 15, 25, 0.94);
  --card-bg: rgba(20, 27, 45, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #ec4899;
  --accent-cyan: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --header-height: 58px;
  --bottom-nav-height: 62px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Background Ambient Glows */
.bg-glow-1 {
  position: fixed;
  width: 500px;
  height: 500px;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-2 {
  position: fixed;
  width: 400px;
  height: 400px;
  bottom: 60px;
  right: -40px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.10) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* ================= TOP STICKY APP HEADER ================= */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.header-inner {
  width: 100%;
  max-width: 960px;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.logo-text h1 span {
  color: var(--primary);
}

.badge-pro {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
}

/* Desktop Navigation Menu */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 6px;
  border-radius: 40px;
  border: 1px solid var(--card-border);
}

.nav-link {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.badge-count {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-apk-header {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.25));
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.btn-apk-header:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.apk-chip {
  background: rgba(0, 0, 0, 0.35);
  color: #a7f3d0;
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 0.58rem;
  font-weight: 800;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Android Promo Banner */
.apk-promo-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(99, 102, 241, 0.12));
  border: 1.5px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.banner-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.2);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.banner-text h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.banner-text p {
  font-size: 0.7rem;
  color: #a7f3d0;
  line-height: 1.2;
  margin-top: 1px;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-banner-download {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  outline: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-banner-download:hover {
  transform: scale(1.02);
}

.btn-banner-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-banner-close:hover {
  color: #fff;
}

/* APK Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 1.4rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
}

.modal-header-text h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.modal-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-features {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.m-feat {
  font-size: 0.74rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 7px;
}

.m-feat i {
  color: #34d399;
  font-size: 0.7rem;
}

.modal-install-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.step-item .num {
  background: rgba(99, 102, 241, 0.25);
  color: #818cf8;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-modal-download {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  text-decoration: none;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: all 0.2s;
}

.btn-modal-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-modal-download-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 6px;
}

.btn-modal-download-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

/* ================= MAIN CONTENT ================= */
.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  padding: calc(var(--header-height) + 1.25rem) 1.25rem calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 16px) + 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* View switching */
.app-view {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: viewFade 0.25s ease-out;
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.hero-title {
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.6px;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8, #f472b6, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.4;
}

/* Platform Pills */
.platform-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.pill.youtube i { color: #ff0000; }
.pill.tiktok i { color: #25f4ee; }
.pill.instagram i { color: #e1306c; }
.pill.facebook i { color: #1877f2; }
.pill.twitter i { color: #ffffff; }

/* Input Card */
.input-card {
  width: 100%;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(17, 24, 39, 0.92);
  border: 2px solid rgba(99, 102, 241, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.12);
  transition: all 0.25s ease;
  gap: 8px;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
}

.input-field-row {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-icon {
  font-size: 1rem;
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}

.input-wrapper input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
}

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

.btn-clear {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s;
  flex-shrink: 0;
}

.btn-clear:hover {
  color: #fff;
}

.btn-paste {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: none;
  outline: none;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  margin-right: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-fetch {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #fff;
  border: none;
  outline: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-fetch:active {
  transform: scale(0.97);
}

/* Alert Box */
.alert-box {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
}

.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-box.info {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

/* Loading Box */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#loadingText {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Result Card */
.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.video-preview-header {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.thumbnail-wrapper {
  position: relative;
  width: 200px;
  min-width: 170px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.platform-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.video-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.author-tag, .views-tag {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Format Selection Area */
.format-selection-area {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
}

.format-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.format-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.formats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}

.format-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.format-card:active {
  transform: scale(0.98);
}

.format-card.selected {
  background: rgba(99, 102, 241, 0.16);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.format-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.format-quality {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.format-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-hd {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sd {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.badge-audio {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.format-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Action Box */
.action-box {
  margin-top: 0.25rem;
}

.btn-download {
  width: 100%;
  min-height: 46px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  outline: none;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-download:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-download:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Progress Area */
.progress-area {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.25rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.progress-status {
  color: #cbd5e1;
}

.progress-percent {
  color: var(--primary);
  font-weight: 700;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 8px;
  transition: width 0.2s ease;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.completed-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.completed-icon {
  font-size: 1.3rem;
  color: var(--success);
}

.completed-text h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #34d399;
}

.completed-text p {
  font-size: 0.72rem;
  color: #a7f3d0;
}

/* ================= COMPACT 3-COLUMN FEATURE HIGHLIGHTS ================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
  width: 100%;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  transition: all 0.2s;
}

.feat-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.16);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.feature-card h3 {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}

.feature-card p {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* View Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 8px;
}

.view-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.08);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-secondary-sm:hover {
  background: rgba(248, 113, 113, 0.15);
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  gap: 10px;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.history-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.history-thumb {
  width: 60px;
  height: 38px;
  border-radius: 5px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.history-meta {
  min-width: 0;
}

.history-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.btn-history-load {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-history-load:hover {
  background: var(--primary);
  color: #fff;
}

.empty-history {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-history i {
  font-size: 2.2rem;
  color: #475569;
}

/* Platforms Showcase Grid */
.platforms-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.platform-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s;
}

.platform-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

.p-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.5rem;
}

.tiktok-card .p-card-top i { color: #25f4ee; }
.youtube-card .p-card-top i { color: #ff0000; }
.instagram-card .p-card-top i { color: #e1306c; }
.facebook-card .p-card-top i { color: #1877f2; }
.twitter-card .p-card-top i { color: #ffffff; }
.more-card .p-card-top i { color: var(--accent-cyan); }

.p-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.platform-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.platform-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Guide Steps Grid */
.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.guide-step-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.step-number {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.7rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.06);
}

.step-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.guide-step-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.guide-step-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ================= MOBILE BOTTOM STICKY NAVIGATION BAR ================= */
.mobile-bottom-nav {
  display: none; /* hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--bottom-nav-height);
  background: var(--bottom-nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
}

.mobile-nav-item {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  padding: 5px 0;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.nav-icon-wrap {
  position: relative;
  font-size: 1.15rem;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 3px;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item.active .nav-icon-wrap {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.7));
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
}

.hidden {
  display: none !important;
}

/* ================= MOBILE VIEW BREAKPOINTS (< 768px) ================= */
@media (max-width: 768px) {
  :root {
    --header-height: 54px;
    --bottom-nav-height: 58px;
  }

  .app-header {
    height: var(--header-height);
    background: rgba(11, 15, 25, 0.95);
  }

  .header-inner {
    padding: 0 0.85rem;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-content {
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 12px) + 16px);
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    gap: 1rem;
  }

  .hero-title {
    font-size: 1.45rem;
    letter-spacing: -0.4px;
  }

  .hero-subtitle {
    font-size: 0.8rem;
  }

  /* Compact Input on Mobile */
  .input-wrapper {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
    border-radius: var(--radius-md);
  }

  .input-field-row {
    width: 100%;
    padding: 2px 2px;
  }

  .input-wrapper input {
    font-size: 0.88rem;
  }

  .btn-fetch {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  /* Result Card on Mobile */
  .result-card {
    padding: 1rem;
    border-radius: var(--radius-lg);
    gap: 0.85rem;
  }

  .video-preview-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .thumbnail-wrapper {
    width: 100%;
    min-width: unset;
    border-radius: var(--radius-sm);
  }

  .video-title {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  /* 2-Column Formats on Mobile */
  .formats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .format-card {
    padding: 8px 8px;
  }

  .format-quality {
    font-size: 0.82rem;
  }

  .format-sub {
    font-size: 0.65rem;
  }

  /* Sleek 3-Column Compact Feature Cards on Mobile (NO BIG BOXES!) */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-top: 0.25rem;
  }

  .feature-card {
    padding: 6px 4px;
    border-radius: 10px;
    gap: 2px;
  }

  .feat-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    margin-bottom: 1px;
  }

  .feature-card h3 {
    font-size: 0.68rem;
  }

  .feature-card p {
    font-size: 0.58rem;
  }

  .platforms-showcase-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

    .guide-steps-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

/* ================= APK & WEBAPP MODAL STYLES ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 1.4rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.2);
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.modal-header-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.modal-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 3px;
}

.modal-features {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-feat {
  font-size: 0.76rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-feat i {
  color: #10b981;
  font-size: 0.75rem;
}

.modal-install-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #94a3b8;
}

.step-item .num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-modal-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
  width: 100%;
}

.btn-modal-download:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-modal-download-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-modal-download-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

