/* --- Custom CSS Custom Properties (Theme Variables) --- */
:root {
    --bg-primary: #080b11;
    --card-bg: rgba(17, 25, 40, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-android: linear-gradient(135deg, #2e7d32, #4caf50);
    --accent-ios: linear-gradient(135deg, #1e293b, #475569);
    --accent-glow: rgba(99, 102, 241, 0.15);
    --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    
    /* Ambient Glow Colors */
    --glow-color-1: rgba(79, 70, 229, 0.4);
    --glow-color-2: rgba(6, 182, 212, 0.4);
}

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

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

/* --- Background Ambient Glows --- */
.bg-glow {
    position: absolute;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 1;
    opacity: 0.7;
    pointer-events: none;
    animation: floatGlow 15s infinite alternate ease-in-out;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    background-color: var(--glow-color-1);
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    background-color: var(--glow-color-2);
    animation-delay: -5s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(10%, 10%) scale(1.15);
    }
}

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

/* --- Glassmorphic Card --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}

/* --- App Icon and Pulse Ring --- */
.app-icon-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1), 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 22px;
    border: 2px solid rgba(99, 102, 241, 0.4);
    animation: pulseRing 2.5s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
    z-index: 1;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* --- Typography --- */
.header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to left, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- Loader Section --- */
.status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.loader-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}

.circular-loader {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circular-chart {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke: #6366f1;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.1s linear;
}

.countdown-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 2;
}

.status-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    animation: pulseText 1.5s infinite alternate ease-in-out;
}

@keyframes pulseText {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* --- Buttons / Fallback UI --- */
.actions-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.5s ease forwards;
}

.fallback-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: -4px;
}

.buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-android {
    background: var(--accent-android);
}

.btn-ios {
    background: var(--accent-ios);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

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

.btn-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
}

.btn-label {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

.btn-store {
    font-size: 1.05rem;
    font-weight: 700;
}

/* --- Footer --- */
.card-footer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 10px;
}

/* --- Helper Classes --- */
.hidden {
    display: none !important;
}

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

/* --- Responsive Adjustments --- */
@media (max-width: 480px) {
    .card {
        padding: 32px 20px;
    }
    .title {
        font-size: 1.6rem;
    }
}
