/* CSS Reset & Variable Definitions */
:root {
    --bg-dark: #070913;
    --card-bg: rgba(13, 17, 30, 0.65);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --primary-grad: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --primary-color: #00f2fe;
    --primary-color-end: #4facfe;
    --android-color: #A4C639;
    --apple-color: #ffffff;
    --font-ar: 'Tajawal', sans-serif;
    --font-en: 'Outfit', sans-serif;
    --shadow-glow: 0 8px 32px 0 rgba(0, 242, 254, 0.15);
    --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.4);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ar);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* Background Glowing Elements */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -2;
    pointer-events: none;
    opacity: 0.18;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--primary-color) 0%, rgba(79, 172, 254, 0) 70%);
    animation: pulse-glow-1 12s infinite alternate;
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #7f5af0 0%, rgba(127, 90, 240, 0) 70%);
    animation: pulse-glow-2 15s infinite alternate;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    z-index: -1;
    pointer-events: none;
}

/* Main Container */
.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    z-index: 10;
}

/* Brand Header */
.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.logo-container {
    width: 90px;
    height: 90px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.4));
    transition: var(--transition);
}

.logo-container:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-family: var(--font-en);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.brand-tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Glassmorphism Card Base */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(0, 242, 254, 0.15);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 242, 254, 0.03);
}

.card.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Redirection Card Specifics */
.redirect-status {
    text-align: center;
    margin-bottom: 30px;
}

.redirect-status h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.redirect-status p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Radial Progress Ring */
.progress-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.1s linear;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.5));
}

.countdown-number {
    position: absolute;
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

/* Store Selector Grid (Desktop Hub) */
.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 500px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.download-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    margin-bottom: 30px;
}

.store-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transition: var(--transition);
}

.store-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
}

.store-info {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: flex-start;
}

.store-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.android-glow {
    box-shadow: inset 0 0 12px rgba(164, 198, 57, 0.1);
}

.apple-glow {
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.store-meta h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: right;
}

.store-meta p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

/* QR Code Styling */
.qr-container {
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.store-card:hover .qr-container {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.qr-image {
    width: 130px;
    height: 130px;
    display: block;
}

.qr-hint {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Button & Action Styling */
.btn-group {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px;
    font-family: var(--font-ar);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--primary-grad);
    color: #070913;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 242, 254, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-store {
    width: 100%;
    color: #070913;
    font-weight: 700;
}

.google-play-btn {
    background: var(--android-color);
    box-shadow: 0 4px 15px rgba(164, 198, 57, 0.2);
}

.google-play-btn:hover {
    background: #b6db3f;
    box-shadow: 0 8px 25px rgba(164, 198, 57, 0.4);
    transform: translateY(-2px);
}

.apple-store-btn {
    background: var(--apple-color);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.apple-store-btn:hover {
    background: #f1f5f9;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hub Footer and Links */
.hub-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-top: 15px;
    position: relative;
}

.or-separator {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    width: 100%;
    text-align: center;
}

.or-separator::before,
.or-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.or-separator::before { left: 0; }
.or-separator::after { right: 0; }

.web-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(0, 242, 254, 0.03);
    border: 1px solid rgba(0, 242, 254, 0.05);
}

.web-link svg {
    transition: transform 0.3s ease;
    transform: scaleX(-1); /* Flips arrow to match RTL layout */
}

.web-link:hover {
    background: rgba(0, 242, 254, 0.08);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.08);
}

.web-link:hover svg {
    transform: scaleX(-1) translateX(-4px); /* Moves arrow outward in RTL */
}

.footer {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3);
    margin-top: 10px;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

@keyframes pulse-glow-1 {
    0% { transform: scale(1) translate(0, 0); opacity: 0.15; }
    100% { transform: scale(1.15) translate(30px, 20px); opacity: 0.25; }
}

@keyframes pulse-glow-2 {
    0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
    100% { transform: scale(1.2) translate(-40px, -30px); opacity: 0.22; }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2.2rem;
    }
    
    .brand-tagline {
        font-size: 0.95rem;
    }

    .card {
        padding: 30px 20px;
    }

    .download-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .store-card {
        padding: 24px 20px;
    }

    .qr-container {
        display: none; /* Hide QR codes on mobile to keep focus on buttons */
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}
