/* ==========================================================================
   GLOBAL BASE, HEADER, NAVBAR & SPLASH SCREEN MODULE
   Premium UI & Core App Layout
   ========================================================================== */

/* ==========================================
   1. ROOT VARIABLES & THEME COLORS
   ========================================== */
:root {
    --primary: #ff006e;
    --primary-neon: #ff006e;
    --secondary-neon: #8338ec;
    --primary-grad: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    --bg-grad: #05050a; /* Deep pitch black base, overridden by views */
    --text-main: #1a1a1a;
    --text-muted: #64748b;
    --success: #00b894;
    --danger: #ff4757;
    --warning: #ff9f43;
    
    /* Layout Dimensions */
    --nav-height: 70px;
    --header-height: 60px;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   2. UNIVERSAL RESETS & PERFORMANCE
   ========================================== */
* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Outfit', sans-serif; 
    -webkit-tap-highlight-color: transparent; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body { 
    background: var(--bg-grad); 
    color: var(--text-main); 
    overflow: hidden; 
    height: 100vh; 
    overscroll-behavior-y: contain; /* Prevents pull-to-refresh glitch */
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* Global Utilities */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Hardware Acceleration */
.view-section, .modal-content {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ==========================================
   3. APP CONTAINER & VIEWS
   ========================================== */
#app-container { 
    height: 100vh; display: flex; flex-direction: column; 
    max-width: 600px; margin: 0 auto; position: relative; 
    box-shadow: 0 0 50px rgba(0,0,0,0.5); background: #ffffff;
}

main { 
    flex: 1; position: relative; overflow: hidden; padding-bottom: 0px; 
}

.view-section {
    opacity: 0; transform: scale(0.98);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; overflow-y: hidden; background: #ffffff;
    padding-top: var(--header-height); z-index: 10;
}
.view-section.active-view { 
    opacity: 1; transform: scale(1); pointer-events: all; 
    position: relative; overflow-y: auto; z-index: 20; 
}

/* ==========================================
   4. TOP HEADER
   ========================================== */
header { 
    height: var(--header-height); display: flex; justify-content: space-between; 
    align-items: center; padding: 0 20px; 
    background: rgba(16, 0, 43, 0.95); /* Dark Premium Contrast Header */
    backdrop-filter: blur(15px); border-bottom: 1px solid var(--glass-border); 
    position: fixed; top: 0; width: 100%; max-width: 600px; z-index: 100; 
}

.header-logo { 
    font-weight: 900; font-size: 1.5rem; letter-spacing: -0.5px; 
    background: linear-gradient(45deg, #fff, #ff006e); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}

.header-actions { display: flex; gap: 20px; align-items: center; }
.icon-btn { font-size: 1.3rem; color: #ffffff; cursor: pointer; position: relative; transition: 0.2s; }
.icon-btn:active { transform: scale(0.9); color: var(--primary); }

.notif-badge { 
    position: absolute; top: -5px; right: -5px; background: var(--accent); 
    color: white; font-size: 0.6rem; width: 16px; height: 16px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; font-weight: bold; display: none; 
}

/* =================================================== */
/* --- BOTTOM NAVIGATION BAR (UPDATED INTEGRATED) --- */
/* =================================================== */
.bottom-nav { 
    height: var(--nav-height); 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    position: fixed; 
    bottom: 0px; 
    left: 50%;
    transform: translateX(-50%); 
    width: 100%; 
    max-width: 500px; 
    border-radius: 5px; 
    z-index: 90; 
    transition: transform 0.3s; 
    
    /* 🏠 Clean Solid Look */
    background-color: #ffffff !important; 
    border-top: 1.5px solid #cbd5e1 !important; /* सिंपल लाइट-ग्रे सॉलिड टॉप बॉर्डर */
    background-image: none !important; /* रंगीन ग्रेडिएंट को पूरी तरह से हटा दिया गया है */

    /* 💎 Soft Depth Shadows */
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04) !important;
    backdrop-filter: blur(20px); 
}

.nav-item { 
    color: #64748b; 
    font-size: 1.4rem; 
    cursor: pointer; 
    padding: 12px; 
    transition: 0.3s; 
    position: relative; 
    background: transparent !important; /* काला रंग रोकने के लिए */
}

.nav-item.active { 
    color: #ff006e; 
    transform: translateY(-5px); 
    text-shadow: 0 4px 10px rgba(255, 0, 110, 0.2); 
}

.msg-badge {
    position: absolute; top: 0px; right: 0px; background: var(--primary);
    color: white; font-size: 0.65rem; padding: 2px 6px; border-radius: 10px;
    font-weight: 900; display: none; border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(255,0,110,0.4);
}

/* ==========================================
   6. SPLASH SCREEN (Studio Quality)
   ========================================== */
#splash-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

#splash-screen.splash-hide { opacity: 0; transform: scale(1.1); filter: blur(10px); pointer-events: none; }

.quality-wrapper { text-align: center; width: 85%; max-width: 400px; }

.logo-viewport { position: relative; width: 120px; height: 120px; margin: 0 auto 30px; display: flex; align-items: center; justify-content: center; }
.premium-heart { font-size: 5rem; color: #ff006e; filter: drop-shadow(0 15px 30px rgba(255, 0, 110, 0.25)); position: relative; z-index: 5; }
.glass-bg { position: absolute; width: 100%; height: 100%; background: rgba(255, 0, 110, 0.03); border-radius: 40%; transform: rotate(-15deg); border: 1px solid rgba(255, 0, 110, 0.1); }

.app-name-premium { font-size: 2rem; font-weight: 900; color: #10002b; letter-spacing: 8px; margin-bottom: 5px; background: linear-gradient(135deg, #10002b 0%, #ff006e 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.app-tagline { font-size: 0.7rem; font-weight: 800; color: #cbd5e1; letter-spacing: 3px; margin-bottom: 60px; }

/* Liquid Loader */
.loader-container-premium { width: 100%; }
.status-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.75rem; font-weight: 900; color: #94a3b8; }
#load-pc { color: #ff006e; }

.liquid-track { width: 100%; height: 10px; background: #f8fafc; border-radius: 20px; overflow: hidden; position: relative; border: 1px solid #f1f5f9; }
.liquid-fill { position: absolute; top: 0; left: 0; width: 0%; height: 100%; background: linear-gradient(90deg, #ff006e, #8338ec); border-radius: 20px; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 20px rgba(255, 0, 110, 0.4); }
.liquid-glow { position: absolute; top: 0; right: 0; width: 30px; height: 100%; background: white; opacity: 0.5; filter: blur(5px); }

.footer-secure { margin-top: 40px; font-size: 0.6rem; font-weight: 900; color: #cbd5e1; letter-spacing: 2px; }

/* ==========================================
   7. FLOATING ELEMENTS & NETWORK STATUS
   ========================================== */
#network-status {
    position: fixed; top: 15px; left: 50%; transform: translateX(-50%) translateY(-150%);
    background: rgba(30, 30, 30, 0.9); backdrop-filter: blur(10px);
    padding: 8px 20px; border-radius: 30px; color: white; font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 10px; z-index: 9999; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 20px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1);
}
#network-status.show { transform: translateX(-50%) translateY(0); }
.net-dot { width: 8px; height: 8px; border-radius: 50%; }
.net-offline .net-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: blink 1s infinite; }
.net-online .net-dot { background: var(--success); box-shadow: 0 0 10px var(--success); }
@keyframes blink { 50% { opacity: 0.4; } }

#notif-perm-banner {
    background: linear-gradient(90deg, #ff9e00, #ff006e); color: white; padding: 10px; 
    text-align: center; font-size: 0.9rem; display: flex; justify-content: space-between; 
    align-items: center; border-radius: 12px; margin: 10px 15px;
    box-shadow: 0 5px 15px rgba(255, 0, 110, 0.3); cursor: pointer;
}
.perm-btn { background: white; color: var(--primary); border: none; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 0.8rem; cursor: pointer; }

#smart-back-btn {
    position: fixed; top: 20px; left: 20px; background: rgba(16, 0, 43, 0.85); backdrop-filter: blur(15px);
    color: white; padding: 10px 18px; border-radius: 25px; font-size: 0.95rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px; z-index: 2000;
    border: 1px solid rgba(255,0,110,0.5); box-shadow: 0 8px 25px rgba(0,0,0,0.6), 0 0 15px rgba(255,0,110,0.3);
    cursor: pointer; transition: 0.3s;
}
#smart-back-btn:active { transform: scale(0.9); }

/* Pull To Refresh Loader */
#ptr-loader {
    position: absolute; top: calc(var(--header-height) + 10px); left: 50%; transform: translateX(-50%) scale(0);
    width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    z-index: 99; box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: transform 0.2s; pointer-events: none;
}
#ptr-loader i { color: var(--primary); font-size: 1.2rem; }
#ptr-loader.loading { transform: translateX(-50%) scale(1) !important; animation: bounceLoader 0.6s infinite alternate; }
@keyframes bounceLoader { from { top: 70px; } to { top: 80px; } }

/* ==========================================
   8. PERFORMANCE FIXES FOR WEAK DEVICES
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
img, video { content-visibility: auto; }
