/* ============================================
   PAISAPAY - ULTIMATE MOBILE-FIRST UI
   Premium Dark Theme | Touch Optimized
   ============================================ */

:root {
    /* Colors */
    --primary: #6C3CE1;
    --primary-light: #8B5CF6;
    --primary-dark: #5A2FC7;
    --primary-gradient: linear-gradient(135deg, #6C3CE1, #9B59B6);
    --primary-gradient-hover: linear-gradient(135deg, #7C4CE1, #AB69C6);
    
    /* Backgrounds */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-input: #0d1524;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Borders */
    --border-color: #1e293b;
    
    /* Status */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(108,60,225,0.15);
    
    /* Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    /* Sizes */
    --header-height: 56px;
    --bottom-nav-height: 60px;
}

/* ============================================
   RESET
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
    padding-top: calc(var(--header-height) + 12px);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

/* ============================================
   HEADER / NAVBAR
   ============================================ */

.navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px !important;
    height: var(--header-height);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.navbar-brand {
    font-weight: 800;
    font-size: 17px;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.navbar-brand i {
    font-size: 20px;
    color: var(--primary-light);
}

.navbar .badge {
    font-size: 11px;
    padding: 4px 12px;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

.navbar.fixed-bottom {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color);
    padding: 4px 0 env(safe-area-inset-bottom) !important;
    height: var(--bottom-nav-height);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.navbar.fixed-bottom .container {
    padding: 0 4px;
}

.nav-link {
    color: var(--text-muted) !important;
    text-align: center;
    padding: 4px 8px !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 10px;
    font-weight: 500;
    min-width: 48px;
    text-decoration: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.nav-link i {
    font-size: 20px;
    transition: all 0.2s ease;
}

.nav-link span {
    font-size: 9px;
    line-height: 1.2;
}

.nav-link.active {
    color: var(--primary-light) !important;
}

.nav-link.active i {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(108,60,225,0.3);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 0 0 2px 2px;
}

.nav-link .badge-dot {
    position: absolute;
    top: 0;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.nav-link .badge-count {
    position: absolute;
    top: -4px;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg-secondary);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 12px;
}

.card:hover {
    border-color: rgba(108,60,225,0.2);
    transform: translateY(-2px);
}

.card-body {
    padding: 16px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   ADS - Universal Ad Styles
   ============================================ */

/* Ad Slot Container */
.ad-slot {
    background: #0d1524;
    border: 1px solid #1a2234;
    border-radius: 8px;
    padding: 8px;
    margin: 8px auto;
    text-align: center;
    min-height: 50px;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.ad-slot .ad-label {
    font-size: 8px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.ad-slot .adsbygoogle {
    display: block;
    max-width: 100%;
}

/* Ad Sizes */
.ad-slot-728x90 { max-width: 728px; min-height: 90px; }
.ad-slot-320x50 { max-width: 320px; min-height: 50px; }
.ad-slot-300x250 { max-width: 300px; min-height: 250px; }
.ad-slot-160x600 { max-width: 160px; min-height: 600px; }
.ad-slot-468x60 { max-width: 468px; min-height: 60px; }
.ad-slot-160x300 { max-width: 160px; min-height: 300px; }

/* Ad Placements */
.ad-sticky { position: sticky; top: 80px; }
.ad-top { margin: 8px auto; }
.ad-bottom { margin: 8px auto; }
.ad-inline { margin: 12px auto; }

/* Hide side ads on mobile */
@media (max-width: 768px) {
    .ad-slot-160x600, 
    .ad-slot-160x300 { 
        display: none; 
    }
    .ad-slot-728x90 { 
        max-width: 100%; 
        min-height: 50px; 
    }
}

/* ============================================
   BUTTONS - Touch Optimized
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 16px rgba(108,60,225,0.3);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108,60,225,0.4);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary-light);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-light {
    background: #f8fafc;
    color: #0f172a;
}

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 36px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    min-height: 56px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================
   FORMS - Touch Optimized
   ============================================ */

.form-control, .form-select {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,60,225,0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-group-text {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-right: none;
    color: var(--text-muted);
    padding: 0 14px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    display: flex;
    align-items: center;
    min-height: 48px;
}

.input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
}

.form-check-input {
    width: 20px;
    height: 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: rgba(108,60,225,0.15); color: var(--primary-light); }
.badge-secondary { background: var(--border-color); color: var(--text-secondary); }
.badge-gold { background: linear-gradient(135deg, #F1C40F, #F39C12); color: #000; }

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-card i {
    font-size: 24px;
    margin-bottom: 4px;
}

.stat-card .number {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.stat-card .label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   TASK CARDS
   ============================================ */

.task-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.task-card:active {
    transform: scale(0.96);
}

.task-card .icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    margin-bottom: 6px;
    background: var(--primary-gradient);
}

.task-card .title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card .reward {
    font-size: 13px;
    font-weight: 700;
    color: var(--warning);
    margin-top: 2px;
}

/* ============================================
   LIST ITEMS
   ============================================ */

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    min-height: 56px;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.list-item .left .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(108,60,225,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.list-item .left .info {
    flex: 1;
    min-width: 0;
}

.list-item .left .info .title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item .left .info .sub {
    font-size: 11px;
    color: var(--text-muted);
}

.list-item .right {
    text-align: right;
    flex-shrink: 0;
}

.list-item .right .amount {
    font-size: 14px;
    font-weight: 700;
}

.list-item .right .amount.positive { color: var(--success); }
.list-item .right .amount.negative { color: var(--danger); }

.list-item .right .date {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
}

/* ============================================
   LOGIN/SIGNUP CARD
   ============================================ */

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-card .logo .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 24px rgba(108,60,225,0.3);
    margin-bottom: 12px;
}

.auth-card .logo h2 {
    font-size: 22px;
    font-weight: 800;
}

.auth-card .logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}


/* ============================================
   ✅ UNIVERSAL FIX: Input Text Color
   Works on all pages, all form inputs
   ============================================ */

/* All input fields - Force dark background & white text */
input,
textarea,
select,
.form-control,
.form-select {
    background-color: #0d1524 !important;
    color: #ffffff !important;
    border: 2px solid #1e293b !important;
}

/* When focused/typing - Keep dark background */
input:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    background-color: #0d1524 !important;
    color: #ffffff !important;
    border-color: #6C3CE1 !important;
    box-shadow: 0 0 0 4px rgba(108, 60, 225, 0.15) !important;
    outline: none !important;
}

/* Placeholder text color */
input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

/* Disabled inputs */
input:disabled,
textarea:disabled,
.form-control:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Number input arrows - keep dark */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Autofill override - prevent white background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0d1524 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Select dropdown */
select option {
    background-color: #0d1524 !important;
    color: #ffffff !important;
}

/* Input group addon */
.input-group-text {
    background-color: #0d1524 !important;
    color: #94a3b8 !important;
    border: 2px solid #1e293b !important;
}
/* ============================================
   TOAST
   ============================================ */

.toast-container {
    z-index: 9999;
    padding: 12px;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    max-width: 100%;
    margin-bottom: 8px;
}

.toast .toast-body {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
}


/* ============================================
   ✅ FINAL TOAST FIX - BELOW NAV
   ============================================ */

/* Nav bar z-index */
.navbar-universal,
.pp-top-nav,
.top-nav,
#ppTopNav {
    z-index: 1000 !important;
}

/* Toast - BELOW nav but ABOVE content */
.custom-toast-fixed {
    z-index: 999 !important;
    position: fixed !important;
    top: 65px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #1a2234 !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
    padding: 12px 24px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    min-width: 280px !important;
    max-width: 90% !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    pointer-events: auto !important;
}

/* Override any other toast */
.toast-container,
.toast,
.pp-toast,
.custom-toast {
    z-index: 999 !important;
}

/* Mobile */
@media (max-width: 480px) {
    .custom-toast-fixed {
        top: 58px !important;
        min-width: auto !important;
        max-width: 95% !important;
        font-size: 13px !important;
        padding: 10px 16px !important;
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        width: auto !important;
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 40px;
    opacity: 0.3;
    margin-bottom: 8px;
}

.empty-state h6 {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile First - Default styles are for mobile */

/* Small phones (under 400px) */
@media (max-width: 400px) {
    .card-body { padding: 12px; }
    .btn { font-size: 13px; padding: 10px 14px; min-height: 42px; }
    .stat-card .number { font-size: 18px; }
    .nav-link i { font-size: 18px; }
    .nav-link span { font-size: 8px; }
    .auth-card { padding: 20px 14px; }
    .auth-card .logo .icon { width: 56px; height: 56px; font-size: 24px; }
    .auth-card .logo h2 { font-size: 20px; }
    .task-card { padding: 10px; min-height: 80px; }
    .task-card .icon { width: 36px; height: 36px; font-size: 16px; }
    .task-card .title { font-size: 11px; }
}

/* Tablets (768px and up) */
@media (min-width: 768px) {
    body { padding-top: calc(var(--header-height) + 20px); padding-bottom: calc(var(--bottom-nav-height) + 24px); }
    .card-body { padding: 24px; }
    .auth-card { padding: 40px 32px; }
    .stat-card .number { font-size: 28px; }
    .container { max-width: 720px; }
}

/* Desktops (992px and up) */
@media (min-width: 992px) {
    .container { max-width: 960px; }
}

/* Large Desktops (1200px and up) */
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

.fade-in {
    animation: fadeInUp 0.4s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* ============================================
   UTILITY
   ============================================ */

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-secondary-custom { color: var(--text-secondary) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.bg-card-custom { background: var(--bg-card) !important; }
.border-custom { border-color: var(--border-color) !important; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.shadow-glow { box-shadow: var(--shadow-glow); }
.rounded-xl { border-radius: var(--radius-xl); }

/* ============================================
   GRADIENTS (Background classes)
   ============================================ */

.bg-primary-gradient { background: var(--primary-gradient) !important; }
.bg-gradient-purple { background: linear-gradient(135deg, #6C3CE1, #8E44AD) !important; }
.bg-gradient-blue { background: linear-gradient(135deg, #3498DB, #2ECC71) !important; }
.bg-gradient-gold { background: linear-gradient(135deg, #F1C40F, #F39C12) !important; }
.bg-gradient-green { background: linear-gradient(135deg, #2ECC71, #27AE60) !important; }
.bg-gradient-red { background: linear-gradient(135deg, #E74C3C, #C0392B) !important; }
.bg-gradient-pink { background: linear-gradient(135deg, #E91E63, #9C27B0) !important; }

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 20px 0;
}

/* ============================================
   SCROLLBAR (Firefox)
   ============================================ */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* ============================================
   SAFE AREA (Notch phones)
   ============================================ */

@supports (padding: max(0px)) {
    .navbar.fixed-bottom {
        padding-bottom: max(4px, env(safe-area-inset-bottom)) !important;
    }
}