/* ============================================
   STYLES - Direct Link Redirect Page
   ============================================ */

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0a1628;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #e8ecf4;
  --color-text-secondary: #8899b4;
  --color-text-muted: #5a6d8a;
  --color-accent: #1e3a6e;
  --color-accent-light: #4a90d9;
  --color-green: #2ecc40;
  --color-green-light: #5dde6e;
  --color-ios: #007aff;
  --color-ios-glow: rgba(0, 122, 255, 0.3);
  --color-android: #2ecc40;
  --color-android-glow: rgba(46, 204, 64, 0.3);
  --gradient-primary: linear-gradient(135deg, #1e3a6e, #2a6bb5, #2ecc40);
  --gradient-ios: linear-gradient(135deg, #007aff, #5ac8fa);
  --gradient-android: linear-gradient(135deg, #2ecc40, #00c853);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow-glow: 0 0 60px rgba(30, 58, 110, 0.25);
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

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

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #1e3a6e 0%, transparent 70%);
  top: -150px;
  left: -100px;
  animation: floatGlow1 12s ease-in-out infinite;
}

.bg-glow-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #2ecc40 0%, transparent 70%);
  bottom: -100px;
  right: -80px;
  animation: floatGlow2 15s ease-in-out infinite;
}

.bg-glow-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #1a5276 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatGlow3 18s ease-in-out infinite;
}

@keyframes floatGlow1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.1); }
  66% { transform: translate(-30px, 80px) scale(0.9); }
}

@keyframes floatGlow2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, -30px) scale(1.15); }
  66% { transform: translate(40px, -60px) scale(0.95); }
}

@keyframes floatGlow3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ---- Container ---- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 24px;
}

/* ---- Card ---- */
.card {
  background: var(--color-surface);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow-glow);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 80px rgba(30, 58, 110, 0.3);
}

/* ---- Hidden Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Fade In Animation ---- */
.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ---- Loading State ---- */
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---- Redirect State ---- */
.redirect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
  animation: pulse-icon 2s ease-in-out infinite;
}

.icon-ios-theme {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.2);
  box-shadow: 0 0 40px var(--color-ios-glow);
}

.icon-android-theme {
  background: rgba(61, 220, 132, 0.1);
  border-color: rgba(61, 220, 132, 0.2);
  box-shadow: 0 0 40px var(--color-android-glow);
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.platform-icon {
  width: 36px;
  height: 36px;
}

#icon-ios {
  color: var(--color-ios);
}

#icon-android {
  color: var(--color-android);
}

#icon-desktop {
  color: var(--color-accent-light);
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 320px;
}

.progress-bar-wrapper {
  width: 100%;
  max-width: 280px;
  height: 4px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
}

.fallback-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.link {
  color: var(--color-accent-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---- Desktop / Fallback State ---- */
.desktop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo-wrapper {
  margin-bottom: 8px;
}

.logo-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(30, 58, 110, 0.35);
  animation: float-logo 4s ease-in-out infinite;
  overflow: hidden;
}

@keyframes float-logo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* ---- Store Buttons ---- */
.store-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin-top: 8px;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: #fff;
  font-family: var(--font-family);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.store-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.store-btn:hover {
  transform: translateY(-2px);
}

.store-btn:active {
  transform: translateY(0) scale(0.98);
}

.store-btn-ios {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(90, 200, 250, 0.1));
  border: 1px solid rgba(0, 122, 255, 0.25);
}

.store-btn-ios:hover {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.25), rgba(90, 200, 250, 0.18));
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.2);
}

.store-btn-android {
  background: linear-gradient(135deg, rgba(46, 204, 64, 0.12), rgba(0, 200, 83, 0.08));
  border: 1px solid rgba(46, 204, 64, 0.25);
}

.store-btn-android:hover {
  background: linear-gradient(135deg, rgba(46, 204, 64, 0.22), rgba(0, 200, 83, 0.15));
  border-color: rgba(46, 204, 64, 0.4);
  box-shadow: 0 8px 32px rgba(46, 204, 64, 0.2);
}

.store-btn-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.store-btn-ios .store-btn-icon {
  color: var(--color-ios);
}

.store-btn-android .store-btn-icon {
  color: var(--color-android);
}

.store-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.store-btn-small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.store-btn-large {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---- QR Section ---- */
.qr-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.qr-container {
  width: 140px;
  height: 140px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-container:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(30, 58, 110, 0.4);
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 20px;
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .container {
    padding: 16px;
  }

  .card {
    padding: 36px 24px;
    border-radius: var(--radius-md);
  }

  .title {
    font-size: 1.3rem;
  }

  .bg-glow-1 {
    width: 300px;
    height: 300px;
  }

  .bg-glow-2 {
    width: 250px;
    height: 250px;
  }

  .bg-glow-3 {
    width: 200px;
    height: 200px;
  }
}

@media (min-width: 768px) {
  .store-buttons {
    flex-direction: row;
    max-width: 100%;
  }

  .store-btn {
    flex: 1;
  }
}
