﻿/* ==========================================================================
   مسار - IPS | Stylesheet (Luxury Obsidian & Egyptian Gold)
   ========================================================================== */

:root {
  --bg-main: #08090C;
  --bg-card: rgba(18, 22, 31, 0.75);
  --bg-card-border: rgba(212, 175, 55, 0.22);
  --bg-card-glow: rgba(212, 175, 55, 0.08);

  --gold-primary: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-dark: #996515;
  --gold-gradient: linear-gradient(135deg, #FFE89E 0%, #D4AF37 50%, #996515 100%);
  --gold-glow: 0 0 25px rgba(212, 175, 55, 0.28);

  --text-primary: #FFFFFF;
  --text-secondary: #C8D0DC;
  --text-muted: #8E99A8;

  --btn-bg: rgba(255, 255, 255, 0.05);
  --btn-hover-bg: rgba(212, 175, 55, 0.12);
  --btn-border: rgba(255, 255, 255, 0.12);

  --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-en: 'Outfit', system-ui, -apple-system, sans-serif;
  --radius-card: 28px;
  --radius-btn: 16px;
  --radius-icon: 24px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-ar);
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Background Atmosphere */
.bg-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hall-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 70%),
                    linear-gradient(to bottom, rgba(8, 9, 12, 0.85) 0%, rgba(8, 9, 12, 0.98) 100%),
                    url('assets/images/background_dark.jpg');
  background-size: cover;
  background-position: center top;
  opacity: 0.35;
  filter: blur(2px);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.glow-top {
  width: 380px;
  height: 380px;
  top: -100px;
  right: 50%;
  transform: translateX(50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
}

.glow-bottom {
  width: 320px;
  height: 320px;
  bottom: -60px;
  left: 20%;
  background: radial-gradient(circle, rgba(153, 101, 21, 0.15) 0%, transparent 70%);
}

/* Single-Screen Centered Container */
.page-container {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.card-wrapper {
  width: 100%;
  max-width: 440px;
  margin: auto;
}

/* The Download Card */
.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--bg-card-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6),
              0 0 40px var(--bg-card-glow);
  border-radius: var(--radius-card);
  padding: 2.2rem 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* App Icon & Glowing Halo */
.icon-container {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-halo {
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--radius-icon) + 6px);
  background: var(--gold-gradient);
  opacity: 0.45;
  filter: blur(14px);
  z-index: 0;
  animation: pulseHalo 4s ease-in-out infinite alternate;
}

@keyframes pulseHalo {
  from { opacity: 0.3; transform: scale(0.98); }
  to { opacity: 0.6; transform: scale(1.04); }
}

.app-logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-icon);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5),
              inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  background-color: #121419;
}

/* Header & Typography */
.app-header {
  margin-bottom: 1.6rem;
}

.app-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

.badge-ips {
  font-family: var(--font-en);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.app-venue {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-top: 0.35rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.app-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  max-width: 290px;
  line-height: 1.4;
}

/* Download Actions Container */
.download-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

/* Store Download Buttons */
.store-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-btn);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.store-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.store-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), var(--gold-glow);
  background: var(--btn-hover-bg);
}

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

.btn-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.btn-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  flex-grow: 1;
}

.btn-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.1;
  font-weight: 500;
}

.btn-maintext {
  font-family: var(--font-en);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Highlighted Store Button (Target OS) */
.store-btn.is-recommended {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
}

.store-btn.is-recommended .btn-maintext {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Recommended OS Badge */
.os-badge {
  position: relative;
  z-index: 1;
  display: none;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
  white-space: nowrap;
}

.store-btn.is-recommended .os-badge {
  display: inline-block;
  animation: pulseBadge 2.5s infinite;
}

@keyframes pulseBadge {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Quick Tools (Share & QR Code) */
.card-tools {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
}

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

/* QR Code Modal Dialog */
.qr-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qr-modal.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.qr-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: #121620;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 175, 55, 0.15);
  border-radius: 26px;
  padding: 2.2rem 1.8rem 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.qr-modal.show .qr-dialog {
  transform: scale(1) translateY(0);
}

.qr-close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qr-close-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
  transform: rotate(90deg);
}

.qr-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.qr-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.qr-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.4;
  margin-bottom: 1.2rem;
}

.qr-image-wrapper {
  padding: 1rem;
  border-radius: 20px;
  background: #FFFFFF;
  border: 2px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.qr-code-img {
  width: 200px;
  height: 200px;
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

.qr-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  font-family: var(--font-en);
  font-size: 0.8rem;
  color: var(--gold-light);
  letter-spacing: 0.3px;
}

.qr-link-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-primary);
}

/* Tranex Signature (Subtle Indicator) */
.app-footer {
  margin-top: 1.1rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.tranex-signature {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.signature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: blinkDot 3s ease-in-out infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.signature-text {
  font-family: var(--font-en);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.signature-text strong {
  color: var(--gold-light);
  font-weight: 600;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #191E28;
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 0.7rem 1.4rem;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), var(--gold-glow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

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

/* Responsive Breakpoints */
@media (max-width: 380px) {
  .app-card {
    padding: 1.6rem 1.2rem 1.2rem;
  }
  .icon-container {
    width: 96px;
    height: 96px;
  }
  .app-title {
    font-size: 1.7rem;
  }
  .app-venue {
    font-size: 1rem;
  }
  .store-btn {
    padding: 0.8rem 1rem;
  }
  .btn-maintext {
    font-size: 1.05rem;
  }
}

@media (min-height: 800px) {
  .app-card {
    padding: 2.6rem 2.2rem 1.8rem;
  }
  .icon-container {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
  }
  .download-actions {
    gap: 1rem;
    margin-bottom: 1.6rem;
  }
}

