/* -------------------------------------------------------------
   KhaYin Download Portal • Mobile-Optimized Modern Dark CSS
-------------------------------------------------------------- */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-main: #09090b;
  --bg-card: rgba(18, 18, 22, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mm: 'Pyidaungsu', 'Myanmar Text', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Radial Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.bg-glow-top {
  width: 380px;
  height: 380px;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
}

.bg-glow-bottom {
  width: 450px;
  height: 450px;
  bottom: -150px;
  right: -50px;
  background: radial-gradient(circle, #4338ca 0%, rgba(67, 56, 202, 0) 70%);
  opacity: 0.2;
}

/* Main Layout Wrapper */
.wrapper {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Main Card Container */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2.25rem 1.75rem;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.12);
  transition: all 0.3s ease;
}

/* Notice / Action Required Badge */
.notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  user-select: none;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* App Logo */
.logo {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  height: 72px;
  width: auto;
  max-width: 140px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* Titles and Headers */
h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  line-height: 1.45;
}

.myanmar-sub {
  font-family: var(--font-mm);
  font-size: 0.85rem;
  color: #fbbf24;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Detected Device Banner */
.detected-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.4s ease;
}

.detected-banner.hidden {
  display: none;
}

.detected-banner strong {
  color: #ffffff;
}

/* Downloads List */
.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.download-item.recommended .btn-platform {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(30, 27, 75, 0.5) 100%);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.download-item.recommended .pill-badge {
  background: #4f46e5;
  color: #ffffff;
}

/* Platform Download Button */
.btn-platform {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 64px;
}

.btn-platform:hover {
  background: #232328;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.btn-platform:active {
  transform: scale(0.98);
  background: #27272a;
}

.platform-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #e4e4e7;
  flex-shrink: 0;
}

.icon-svg {
  width: 22px;
  height: 22px;
}

.platform-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.platform-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fafafa;
  line-height: 1.2;
}

.pill-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pill-green {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.detail {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.live-size {
  color: #a5b4fc;
  font-weight: 600;
  margin-left: 3px;
}

.platform-right {
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
}

.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.arrow-svg {
  width: 18px;
  height: 18px;
}

.btn-platform:hover .arrow {
  color: #ffffff;
  transform: translateY(2px);
}

/* Copy Link Button */
.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 44px;
  height: 64px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: #27272a;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-copy:active {
  transform: scale(0.95);
}

/* TV & Sideload Guide Accordion */
.guide-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  text-align: left;
  transition: all 0.25s ease;
}

.guide-header {
  width: 100%;
  background: none;
  border: none;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d4d4d8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.guide-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-chevron {
  transition: transform 0.25s ease;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.guide-box.open .guide-chevron {
  transform: rotate(180deg);
}

.guide-content {
  display: none;
  padding: 0 1rem 1rem 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
}

.guide-box.open .guide-content {
  display: block;
  animation: fadeIn 0.25s ease;
}

.guide-steps {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.guide-steps li {
  margin-bottom: 0.4rem;
}

.url-code {
  display: block;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.72rem;
  color: #a5b4fc;
  margin-top: 3px;
}

.btn-copy-code {
  width: 100%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-code:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

/* Footer Section */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1.1rem;
  flex-wrap: wrap;
}

.ver-tag {
  color: #a1a1aa;
  font-weight: 600;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #18181b;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------
   Mobile Optimizations (< 640px & < 380px)
-------------------------------------------------------------- */

@media (max-width: 640px) {
  body {
    padding: 0.75rem 0.5rem;
  }

  .card {
    padding: 1.75rem 1.1rem;
    border-radius: 20px;
  }

  h1 {
    font-size: 1.45rem;
  }

  .subtitle {
    font-size: 0.84rem;
  }

  .myanmar-sub {
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
  }

  .btn-platform {
    padding: 0.75rem 0.85rem;
    min-height: 58px;
  }

  .btn-copy {
    width: 40px;
    height: 58px;
  }

  .icon {
    width: 26px;
    height: 26px;
  }

  .icon-svg {
    width: 20px;
    height: 20px;
  }

  .name {
    font-size: 0.9rem;
  }

  .detail {
    font-size: 0.7rem;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 1.5rem 0.85rem;
  }

  .notice-badge {
    font-size: 0.68rem;
    padding: 0.35rem 0.75rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  .platform-left {
    gap: 0.6rem;
  }
}
