/* --- 1. GLOBAL VARIABLES & FONTS --- */
:root {
    --primary: #00d4ff;      /* Neon Blue */
    --secondary: #0055ff;    /* Deep Blue */
    --accent: #00ff88;       /* Success Green */
    --gold: #f3ba2f;         /* Premium Gold */
    --danger: #ff4b5c;       /* Error Red */
    --bg-dark: #0a0f1d;      /* Solid Deep Navy */
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    color: #e2e8f0;
    font-family: var(--font-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* WebView management */
}

/* --- 2. GLOBAL LOADER --- */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 212, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--primary);
}

/* --- 3. PAGE NAVIGATION SYSTEM (FIX FOR FLASH) --- */
.page {
    width: 100%;
    height: 100vh;
    position: fixed; /* Freezes layout to prevent flickering */
    top: 0;
    left: 0;
    padding: 20px 20px 40px 20px;
    background: #0a0f1d !important; /* Solid background is critical */
    display: none;
    opacity: 0;
    z-index: 5;
    overflow-y: auto;
    transition: opacity 0.3s ease-in;
}

.active-page {
    display: block !important;
    opacity: 1 !important;
    z-index: 10 !important;
}

.container-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    width: 100%;
    padding-bottom: 50px;
}

/* --- 4. PROFESSIONAL CARDS --- */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass);
    padding: 30px 20px;
    border-radius: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.logo-icon {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px var(--primary));
}

/* --- 5. INPUTS & WRAPPERS --- */
.input-group {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--primary);
    opacity: 0.7;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 15px 16px 45px;
    border-radius: 16px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

/* --- 6. BUTTONS UI KIT --- */
button {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 85, 255, 0.2);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active { transform: scale(0.96); }

.btn-alt { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-glass); margin-top: 10px; }

.btn-back { background: transparent; color: #64748b; font-size: 12px; margin-top: 20px; text-decoration: underline; box-shadow: none; }

/* --- 7. DASHBOARD ELEMENTS --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.user-badge, .pts-box {
    background: var(--card-bg);
    padding: 12px 18px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-badge i { color: var(--gold); }
.pts-box i { color: var(--primary); }

.balance-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01));
    border: 1px solid var(--border-glass);
    padding: 35px 20px;
    border-radius: 30px;
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

.balance-card h1 { font-size: 34px; font-weight: 800; letter-spacing: 1px; color: #fff; }

.live-indicator { font-size: 11px; color: var(--accent); display: flex; align-items: center; justify-content: center; gap: 10px; text-transform: uppercase; font-weight: 700; }

.dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.pulse { animation: pulse-green 2s infinite; }

/* --- 8. MINING RING ENGINE --- */
.mining-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    width: 100%;
}

.ring-container {
    position: relative;
    width: 210px;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.mining-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.03); 
    border-top: 8px solid var(--primary); 
    border-right: 8px solid transparent;
    animation: spin 3s linear infinite;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.2);
}

#timer-text { font-size: 36px; font-weight: 900; color: var(--primary); text-shadow: 0 0 15px rgba(0, 212, 255, 0.5); z-index: 10; }

.active-status { color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: 1.5px; display: flex; align-items: center; gap: 10px; }

/* --- 9. NAVIGATION GRID --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.act-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    padding: 25px 15px;
    border-radius: 26px;
    text-align: center;
    transition: 0.3s;
}

.act-btn:active { background: rgba(0, 212, 255, 0.1); border-color: var(--primary); }

.act-btn i { font-size: 26px; color: var(--primary); margin-bottom: 12px; display: block; filter: drop-shadow(0 0 5px var(--primary)); }

.act-btn p { font-size: 12px; color: #94a3b8; font-weight: 700; text-transform: uppercase; }

/* --- 10. WITHDRAWAL & WALLET --- */
.fee-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 24px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fee-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 12px; }

.progress-container { background: rgba(255,255,255,0.05); height: 10px; border-radius: 10px; margin-bottom: 20px; overflow: hidden; }

.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.6s ease-in-out; }

.wallet-balance-box {
    padding: 40px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 28px;
    margin: 25px 0;
    border: 1px dashed rgba(0, 212, 255, 0.3);
}

.wallet-balance-box h1 { font-size: 38px; color: #fff; text-shadow: 0 0 20px var(--primary); }

.ref-box {
    background: rgba(0, 0, 0, 0.5);
    padding: 22px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px dashed var(--primary);
    margin: 25px 0;
}

.ref-box span { font-weight: 800; color: var(--primary); font-size: 20px; letter-spacing: 1px; }

.copy-btn { background: var(--primary); width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #000; font-size: 18px; box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3); }

/* --- 11. MODAL (POPUP) --- */
/* --- MODAL (POPUP) FIX --- */
.modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Dark overlay */
    display: none; /* JS will change this to flex */
    align-items: center;
    justify-content: center;
    /* --- SABSE ZAROORI LINE --- */
    z-index: 99999 !important; 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background: #161c2e;
    border: 1px solid var(--primary);
    padding: 25px;
    border-radius: 25px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
    /* Modal ke andar ka content bhi upar rahe */
    position: relative;
    z-index: 100000;
}

/* Withdrawal page ka z-index modal se hamesha kam hona chahiye */
.active-page {
    z-index: 100 !important;
}

/* --- 12. ANIMATIONS --- */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); } 70% { box-shadow: 0 0 0 12px rgba(0, 255, 136, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); } }

/* Hide scrollbars but allow scrolling */
::-webkit-scrollbar { width: 0px; background: transparent; }
/* --- PREMIUM REDESIGN --- */
.premium-mainframe {
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: linear-gradient(180deg, rgba(10, 15, 29, 0.95), rgba(1, 4, 15, 1));
}

.plan-card-v2 {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.05);
}

.basic-border { border-left: 4px solid var(--primary); }
.pro-border { border-left: 4px solid var(--gold); }

.plan-card-v2 .badge {
    position: absolute;
    top: -10px; right: 15px;
    background: var(--primary);
    color: #000; font-size: 9px; font-weight: 900;
    padding: 4px 10px; border-radius: 20px;
}

.gold-badge { background: var(--gold) !important; }

.multi-val { font-size: 22px; font-weight: 800; margin: 5px 0; color: #fff; }

.benefits { list-style: none; margin: 15px 0; }
.benefits li { font-size: 11px; color: #94a3b8; margin-bottom: 5px; }
.benefits li i { color: var(--accent); margin-right: 8px; }

.buy-btn-v2 {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 12px; font-size: 13px;
    padding: 12px; margin-top: 10px; width: 100%;
}

.gold-btn-v2 {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(243, 186, 47, 0.05);
}

.gold-glow { filter: drop-shadow(0 0 10px var(--gold)); font-size: 30px; margin-bottom: 10px; }

.btn-back-v2 {
    background: transparent; color: #64748b; font-size: 11px; margin-top: 15px;
    border: none; text-decoration: underline; cursor: pointer;
}
.history-container {
    margin-top: 25px;
    width: 100%;
    text-align: left;
}

.history-title {
    font-size: 11px;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info p { margin: 0; font-size: 13px; font-weight: 700; }
.history-info small { font-size: 9px; color: #64748b; }

.status-badge {
    font-size: 9px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Status Colors */
.status-pending { background: rgba(243, 186, 47, 0.1); color: var(--gold); border: 1px solid var(--gold); }
.status-approved { background: rgba(0, 255, 136, 0.1); color: var(--accent); border: 1px solid var(--accent); }
.status-rejected { background: rgba(255, 75, 92, 0.1); color: #ff4b5c; border: 1px solid #ff4b5c; }

.multi-node-box {
    background: linear-gradient(135deg, #00d4ff 0%, #0055ff 100%);
    margin: 20px;
    padding: 20px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.7); }
    100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.4); }
}

.multi-node-box i { font-size: 24px; color: #fff; margin-bottom: 5px; display: block; }
.multi-node-box span { font-weight: 800; font-size: 14px; color: #fff; display: block; }
.multi-node-box small { font-size: 10px; color: rgba(255,255,255,0.8); text-transform: uppercase; }

.coin-card-node {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    padding: 15px;
    border-radius: 18px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Mission Hub special styling */
.act-btn[onclick="handleTaskHubEntry()"] {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
}

.act-btn[onclick="handleTaskHubEntry()"]:active {
    background: rgba(0, 255, 136, 0.1) !important;
    transform: scale(0.98);
}

/* Telegram Button Style */
.telegram-hint { margin-top: 25px; border-top: 1px solid var(--border-glass); padding-top: 20px; }
.telegram-hint p { font-size: 11px; color: #94a3b8; margin-bottom: 10px; }

.btn-telegram {
    background: #229ED9 !important; /* Telegram Blue */
    color: #fff !important;
    border-radius: 12px;
    font-size: 12px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(34, 158, 217, 0.3);
}

.btn-telegram:active { transform: scale(0.95); }

/* --- EXTRA REWARDS FULL WIDTH UI --- */
.full-width-btn {
    grid-column: span 2; /* Yeh button ko Mission Hub jaisa bada banayega */
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 22px !important;
    position: relative;
    background: linear-gradient(135deg, rgba(243, 186, 47, 0.05), rgba(10, 15, 29, 1)) !important;
}

.gold-border {
    border: 1px solid var(--gold) !important;
}

.gold-text {
    color: var(--gold) !important;
}

.promo-tag {
    position: absolute;
    top: 0;
    right: 20px;
    background: var(--gold);
    color: #000;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 8px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    letter-spacing: 1px;
}

/* Input Placeholder Centering Fix */
#gift-input-user::placeholder {
    text-align: center;
    opacity: 0.5;
}

.full-width-btn i {
    font-size: 20px !important;
    margin-bottom: 0 !important; /* Center mein alignment ke liye */
}

.full-width-btn p {
    font-size: 13px !important;
    letter-spacing: 1px;
}

/* Vault Card Highlight */
.gold-glow-border {
    border: 2px solid var(--gold) !important;
    box-shadow: 0 0 30px rgba(243, 186, 47, 0.15) !important;
    background: linear-gradient(180deg, rgba(20, 15, 5, 0.9), #0a0f1d) !important;
}

.vault-icon {
    font-size: 50px;
    color: var(--gold);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px var(--gold));
}

/* Input Centering & Styling */
#gift-input-user {
    text-align: center !important; /* Force center */
    text-transform: uppercase;
}

#gift-input-user::placeholder {
    letter-spacing: 1px;
    font-size: 12px;
    color: rgba(243, 186, 47, 0.4);
}

.redeem-btn-pro {
    background: linear-gradient(135deg, var(--gold), #b38600) !important;
    color: #000 !important;
    font-weight: 900 !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 15px rgba(179, 134, 0, 0.3) !important;
}

.tg-btn-v2 {
    background: rgba(34, 158, 217, 0.1) !important;
    border: 1px solid #229ED9 !important;
    color: #229ED9 !important;
    font-size: 12px !important;
    padding: 10px !important;
}

.telegram-redirect-box {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.bell-container { position: relative; cursor: pointer; font-size: 20px; color: var(--primary); }
.notification-dot {
    position: absolute; top: -2px; right: -2px;
    width: 10px; height: 10px; background: #ff4b5c;
    border-radius: 50%; border: 2px solid #0a0f1d;
    box-shadow: 0 0 10px #ff4b5c;
}


@keyframes shake {
    0% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-15deg); }
    100% { transform: rotate(0); }
}
@keyframes bell-glow {
    0% { filter: drop-shadow(0 0 2px var(--gold)); }
    50% { filter: drop-shadow(0 0 15px var(--gold)); transform: rotate(10deg); }
    100% { filter: drop-shadow(0 0 2px var(--gold)); }
}

.bell-shake {
    animation: bell-glow 1s infinite ease-in-out;
    color: var(--gold) !important;
}
.asset-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.asset-card:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary);
}

.asset-card.active {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.05);
}

.asset-info b { font-size: 14px; color: #fff; display: block; }
.asset-info small { font-size: 10px; color: #64748b; }

.asset-balance { text-align: right; }
.asset-balance p { font-size: 13px; color: var(--primary); font-weight: 800; font-family: monospace; }
.asset-balance small { font-size: 9px; color: var(--accent); }