/* ==========================================
   CSS CUSTOM VARIABLES & RESET
   ========================================== */
:root {
    --bg-color: #0d0c15;
    --card-bg: rgba(25, 22, 40, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #9ea4c3;
    --text-muted: #646a8a;
    --link-color: #00f0ff;
    --link-hover: #ff007f;
    
    --grad-pink: #ff007f;
    --grad-purple: #7f00ff;
    --grad-cyan: #00f0ff;
    
    --glow-color: rgba(127, 0, 255, 0.3);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   AMBIENT BACKGROUND BLOBS (ANIMATED)
   ========================================== */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.4;
    animation: floatBlob 12s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--grad-pink) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--grad-purple) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -4s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--grad-cyan) 0%, transparent 70%);
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -8s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, -60px) scale(1.1);
    }
    100% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

/* ==========================================
   CONTAINER & LAYOUT
   ========================================== */
.container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    z-index: 10;
}

/* ==========================================
   GLASSMORPHISM CARD
   ========================================== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 40px 32px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--grad-pink), var(--grad-purple), var(--grad-cyan));
    opacity: 0.8;
}

.card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
                0 0 40px var(--glow-color);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   APP BRANDING SECTION
   ========================================== */
.app-branding {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-logo {
    width: 84px;
    height: 84px;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 16px rgba(255, 255, 255, 0.1));
    transition: var(--transition-smooth);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.app-logo:hover {
    transform: scale(1.08) rotate(5deg);
}

.logo-svg {
    width: 100%;
    height: 100%;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}

/* ==========================================
   REDIRECT STATE / LOADER
   ========================================== */
.redirect-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    transition: var(--transition-smooth);
}

.spinner-container {
    position: relative;
    width: 70px;
    height: 70px;
    margin-bottom: 24px;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border-top-color: var(--grad-cyan);
    border-right-color: var(--grad-purple);
    border-bottom-color: var(--grad-pink);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

.progress-bar-container {
    width: 180px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--grad-pink), var(--grad-purple), var(--grad-cyan));
    border-radius: 10px;
    transition: width 0.1s linear;
}

.redirect-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.manual-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--link-color);
    padding-bottom: 1px;
    transition: var(--transition-smooth);
}

.manual-link:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* ==========================================
   LANDING / STORE BUTTONS STATE
   ========================================== */
.landing-state {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-state.hidden-anim {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.landing-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.landing-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.store-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.store-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.store-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
}

.store-btn:hover::after {
    opacity: 1;
}

.store-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Play store button brand-specific details */
.store-btn.play-store:hover {
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.15);
}

/* App store button brand-specific details */
.store-btn.app-store:hover {
    background: rgba(255, 0, 127, 0.08);
    box-shadow: 0 8px 24px rgba(255, 0, 127, 0.15);
}

.store-icon {
    width: 32px;
    height: 32px;
    margin-right: 18px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.store-btn.play-store:hover .store-icon {
    color: var(--grad-cyan);
}

.store-btn.app-store:hover .store-icon {
    color: var(--grad-pink);
}

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

.btn-sub {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.btn-main {
    font-size: 1.15rem;
    font-weight: 800;
    margin-top: 1px;
}

/* ==========================================
   QR CODE FOR DESKTOP VIEW
   ========================================== */
.desktop-qr-container {
    transition: var(--transition-smooth);
}

.qr-divider {
    display: flex;
    align-items: center;
    margin: 28px 0 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.qr-divider::before,
.qr-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.qr-divider span {
    padding: 0 16px;
}

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

.qr-wrapper {
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    transition: var(--transition-smooth);
}

.qr-wrapper:hover {
    transform: scale(1.03);
}

#qr-code-img {
    width: 140px;
    height: 140px;
    display: block;
}

.qr-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 240px;
}

/* ==========================================
   FOOTER SECTION
   ========================================== */
footer {
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================
   UTILITIES
   ========================================== */
.hidden {
    display: none !important;
}

/* Responsive adjustment for extra-small devices */
@media (max-width: 400px) {
    .card {
        padding: 32px 20px;
    }
    h1 {
        font-size: 1.8rem;
    }
}
