/* ==========================================================================
   WgetCloud Download Modal & Mobile Responsive Enhancements
   Style: Isometric Lego 3D Theme (Black border, extruded shadow, yellow/cyan)
   Platforms: Android & iOS ONLY
   ========================================================================== */

/* Modal Overlay */
.download-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.download-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Modal Card with Lego Extruded 3D Style */
.download-modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #101726;
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 8px 8px 0px #000, 0 0 25px rgba(0, 229, 255, 0.2);
  padding: 32px 26px 28px;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.2s ease;
}

.download-modal-overlay.active .download-modal-card {
  transform: scale(1) translateY(0);
}

/* Close Button */
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: #1a2336;
  border: 2px solid #000;
  border-radius: 6px;
  box-shadow: 2px 2px 0px #000;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background: var(--lego-red);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #000;
  outline: none;
}

/* Modal Header */
.modal-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 0 20px;
}

.modal-header .modal-badge {
  display: inline-block;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}

.modal-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Selected Plan Pill inside Modal */
.modal-selected-plan-box {
  background: rgba(255, 209, 0, 0.08);
  border: 2px dashed var(--lego-yellow);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.modal-selected-plan-title {
  color: #fff;
  font-weight: 700;
}

.modal-selected-plan-price {
  color: var(--lego-yellow);
  font-weight: 800;
  font-family: var(--font-mono);
}

/* Platform Options Grid: Android & iOS ONLY */
.modal-platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.modal-platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: #182236;
  border: 2px solid #000;
  border-radius: 8px;
  box-shadow: 4px 4px 0px #000;
  text-decoration: none;
  color: #fff;
  transition: all 0.15s ease;
  min-height: 44px;
  cursor: pointer;
}

.modal-platform-btn:hover,
.modal-platform-btn:focus-visible {
  border-color: var(--lego-cyan);
  background: #1f2d48;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000, 0 0 15px rgba(0, 229, 255, 0.3);
  outline: none;
}

.modal-platform-btn .platform-icon {
  font-size: 2rem;
  margin-bottom: 6px;
  line-height: 1;
}

.modal-platform-btn .platform-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
}

.modal-platform-btn .platform-tag {
  font-size: 0.72rem;
  color: var(--lego-cyan);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Guidance Steps */
.modal-guide-steps {
  background: #0a0e17;
  border: 2px solid var(--border-dark);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.modal-guide-title {
  font-size: 0.82rem;
  color: var(--lego-yellow);
  margin-bottom: 8px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.modal-guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-guide-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.modal-guide-list .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--lego-yellow);
  color: #000;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 900;
  flex-shrink: 0;
  border: 1px solid #000;
}

/* Fallback Footer Link */
.modal-footer-nav {
  text-align: center;
  border-top: 1px solid var(--border-dark);
  padding-top: 14px;
  font-size: 0.85rem;
}

.modal-footer-nav a {
  color: var(--lego-cyan);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 4px;
}

.modal-footer-nav a:hover {
  color: var(--lego-yellow);
}

/* Lock Body Scroll */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 480px) {
  .download-modal-card {
    padding: 22px 16px 20px;
  }
  .modal-platform-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .modal-platform-btn {
    flex-direction: row;
    gap: 12px;
    padding: 12px 16px;
    justify-content: flex-start;
  }
  .modal-platform-btn .platform-icon {
    font-size: 1.8rem;
    margin-bottom: 0;
  }
  .modal-title {
    font-size: 1.22rem;
  }
  .modal-header {
    padding: 0 8px;
  }
}
