@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-light: #e0e7ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --dark: #0f172a;
    --bg: #f8fafc;
    --card: #ffffff;
    --text-main: #334155;
    --text-sub: #64748b;
    --border: #e2e8f0;
    --fb-blue: #1877F2;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --border: #334155;
    --primary-light: #312e81;
    --success-light: #064e3b;
    --danger-light: #7f1d1d;
    --warning-light: #78350f;
}

* { 
    box-sizing: border-box; 
    outline: none; 
    -webkit-tap-highlight-color: transparent; 
}
body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background-color: var(--bg); 
    color: var(--text-main); 
    margin: 0; 
    padding: 0; 
    transition: 0.3s; 
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* LOGIN SCREEN */
#loginScreen {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--bg); 
    z-index: 9999; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    padding: 20px;
}
.login-box {
    background: var(--card); 
    padding: 30px; 
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 350px;
    text-align: center; 
    border: 1px solid var(--border);
}
.login-title { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--dark); 
    margin-bottom: 10px; 
}
.pin-display { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 20px; 
}
.pin-dot { 
    width: 15px; 
    height: 15px; 
    border-radius: 50%; 
    border: 2px solid var(--border); 
    transition: 0.2s; 
}
.pin-dot.filled { 
    background: var(--primary); 
    border-color: var(--primary); 
}
.keypad { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
    margin-top: 20px; 
}
.key-btn { 
    background: var(--bg); 
    border: 1px solid var(--border); 
    padding: 15px; 
    border-radius: 12px; 
    font-size: 1.2rem; 
    font-weight: 700; 
    cursor: pointer; 
    color: var(--text-main); 
    transition: 0.1s; 
}
.key-btn:active { 
    transform: scale(0.95); 
    background: var(--primary-light); 
}
.ban-msg { 
    color: var(--danger); 
    font-weight: 700; 
    margin-top: 15px; 
    display: none; 
}
.forgot-link { 
    margin-top: 20px; 
    font-size: 0.85rem; 
    color: var(--text-sub); 
    cursor: pointer; 
    text-decoration: underline; 
}

/* APP CONTENT */
#appContent { 
    display: none; 
    padding: 15px; 
    padding-bottom: 90px; 
    max-width: 500px; 
    margin: 0 auto; 
    width: 100%;
}

/* HEADER & TABS */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}
.brand { 
    font-size: 1.4rem; 
    font-weight: 800; 
    background: linear-gradient(to right, var(--primary), #8b5cf6); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
.header-icons { 
    display: flex; 
    gap: 8px; 
}
.icon-btn { 
    background: var(--card); 
    border: 1px solid var(--border); 
    color: var(--text-main); 
    padding: 8px 10px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-size: 1rem; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    transition: 0.2s; 
}

.nav-wrapper { 
    background: var(--card); 
    padding: 5px; 
    border-radius: 16px; 
    margin-bottom: 20px; 
    border: 1px solid var(--border); 
    overflow-x: auto; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03); 
    width: 100%;
}
.nav-tabs { 
    display: flex; 
    gap: 5px; 
    min-width: max-content; 
}
.nav-item { 
    flex: 1; 
    padding: 10px 15px; 
    text-align: center; 
    font-size: 0.85rem; 
    font-weight: 700; 
    border-radius: 12px; 
    color: var(--text-sub); 
    cursor: pointer; 
    transition: 0.3s; 
    white-space: nowrap;
}
.nav-item.active { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); 
    /* REMOVED the problematic properties */
}

.section { 
    display: none; 
    /* animation: slideUp 0.4s ease; */ /* Temporarily disable animation */
    width: 100%;
}
.section.active { 
    display: block; 
}
@keyframes slideUp { 
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

/* DASHBOARD */
.dashboard-card { 
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); 
    color: white; 
    padding: 25px; 
    border-radius: 24px; 
    text-align: center; 
    margin-bottom: 20px; 
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3); 
    position: relative; 
    overflow: hidden; 
}
.profit-val { 
    font-size: 2.6rem; 
    font-weight: 800; 
    margin: 5px 0; 
    letter-spacing: -1px; 
}
.profit-lbl { 
    font-size: 0.8rem; 
    opacity: 0.8; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-weight: 600; 
}
.today-badge { 
    background: rgba(255,255,255,0.15); 
    padding: 6px 14px; 
    border-radius: 30px; 
    font-size: 0.75rem; 
    display: inline-block; 
    backdrop-filter: blur(5px); 
    margin-top: 5px; 
    font-weight: 500; 
    border: 1px solid rgba(255,255,255,0.1); 
}

.stats-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    margin-bottom: 20px; 
}
.stat-box { 
    background: var(--card); 
    padding: 15px; 
    border-radius: 16px; 
    border: 1px solid var(--border); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02); 
    text-align: center; 
}
.stat-lbl { 
    font-size: 0.7rem; 
    color: var(--text-sub); 
    font-weight: 700; 
    text-transform: uppercase; 
}
.stat-val { 
    font-size: 1.1rem; 
    font-weight: 700; 
    margin-top: 5px; 
    display: block; 
}

/* INPUTS & BUTTONS */
.card-box { 
    background: var(--card); 
    padding: 20px; 
    border-radius: 20px; 
    margin-bottom: 20px; 
    border: 1px solid var(--border); 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); 
}
.form-title { 
    font-weight: 700; 
    font-size: 0.95rem; 
    margin-bottom: 15px; 
    color: var(--text-main); 
}

.inp-wrap { 
    margin-bottom: 12px; 
}
.inp-field { 
    width: 100%; 
    background: var(--bg); 
    color: var(--text-main); 
    border: 1px solid var(--border); 
    padding: 12px 15px; 
    border-radius: 12px; 
    font-size: 0.95rem; 
    transition: 0.3s; 
    font-family: inherit; 
}
.inp-field:focus { 
    border-color: var(--primary); 
    background: var(--card); 
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); 
}

.btn-full { 
    width: 100%; 
    padding: 14px; 
    border-radius: 14px; 
    font-weight: 700; 
    font-size: 1rem; 
    border: none; 
    cursor: pointer; 
    color: white; 
    transition: 0.2s; 
}
.btn-pri { 
    background: var(--primary); 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); 
}

.btn-grp { 
    display: flex; 
    gap: 10px; 
}
.btn-act { 
    flex: 1; 
    padding: 12px; 
    border-radius: 12px; 
    border: none; 
    font-weight: 700; 
    color: white; 
    cursor: pointer; 
    font-size: 0.95rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}
.btn-sell { 
    background: linear-gradient(135deg, #10b981, #059669); 
}
.btn-cost { 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
}

/* LISTS & HISTORY */
.list-item { 
    background: var(--card); 
    padding: 16px; 
    border-radius: 16px; 
    margin-bottom: 10px; 
    border: 1px solid var(--border); 
    position: relative; 
    transition: 0.2s; 
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
}
.serial-badge { 
    background: var(--bg); 
    color: var(--text-sub); 
    font-size: 0.75rem; 
    font-weight: 700; 
    padding: 4px 8px; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
    min-width: 35px; 
    text-align: center; 
    margin-top: 2px; 
}
.item-content { 
    flex: 1; 
    overflow: hidden; 
}
.g-email { 
    font-weight: 700; 
    color: var(--primary); 
    font-size: 0.95rem; 
    margin-bottom: 4px; 
    display: block; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    cursor: pointer; 
}
.g-pass { 
    font-family: monospace; 
    background: var(--bg); 
    padding: 3px 8px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    color: var(--text-main); 
    display: inline-block; 
    cursor: pointer; 
}
.btn-details { 
    position: absolute; 
    top: 16px; 
    right: 16px; 
    background: #e0f2fe; 
    color: #0284c7; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 8px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    cursor: pointer; 
}

.slot-container { 
    display: flex; 
    gap: 6px; 
    margin-top: 10px; 
    padding-top: 10px; 
    border-top: 1px dashed var(--border); 
}
.slot-btn { 
    flex: 1; 
    padding: 6px; 
    border-radius: 6px; 
    border: 1px solid; 
    font-size: 0.75rem; 
    font-weight: 700; 
    cursor: pointer; 
    text-align: center; 
    transition: 0.2s; 
}
.s-free { 
    background: var(--success-light); 
    color: var(--success); 
    border-color: var(--success); 
} 
.s-sold { 
    background: var(--danger-light); 
    color: var(--danger); 
    border-color: var(--danger); 
}

.history-wrapper { 
    background: var(--card); 
    border-radius: 20px; 
    border: 1px solid var(--border); 
    overflow: hidden; 
    margin-top: 10px; 
    box-shadow: 0 4px 10px -2px rgba(0,0,0,0.05); 
}
.history-item { 
    padding: 12px; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.9rem; 
    align-items: center; 
}
.txn-icon { 
    width: 42px; 
    height: 42px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.2rem; 
    flex-shrink: 0; 
    margin-right: 12px; 
}
.icon-green { 
    background: var(--success-light); 
    color: var(--success); 
} 
.icon-red { 
    background: var(--danger-light); 
    color: var(--danger); 
} 
.icon-orange { 
    background: var(--warning-light); 
    color: var(--warning); 
}
.pagination { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 20px; 
    background: var(--bg); 
    border-top: 1px solid var(--border); 
}

/* STOCK & PARTNERS */
.stock-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--card); 
    padding: 12px 15px; 
    border-radius: 14px; 
    border: 1px solid var(--border); 
    margin-bottom: 10px; 
}
.stock-pill { 
    background: #eff6ff; 
    color: var(--fb-blue); 
    font-weight: 700; 
    padding: 4px 10px; 
    border-radius: 8px; 
    font-size: 0.9rem; 
}

.star-summary-card { 
    background: linear-gradient(135deg, #1877F2, #2563eb); 
    color: white; 
    padding: 15px; 
    border-radius: 16px; 
    margin-bottom: 20px; 
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); 
}
.star-sum-row { 
    display: flex; 
    justify-content: space-between; 
    margin-top: 10px; 
}
.star-sum-box { 
    text-align: center; 
    flex: 1; 
    border-right: 1px solid rgba(255,255,255,0.2); 
}
.star-sum-box:last-child { 
    border: none; 
}
.ss-val { 
    font-size: 1.2rem; 
    font-weight: 800; 
    display: block; 
}
.ss-lbl { 
    font-size: 0.7rem; 
    opacity: 0.9; 
    text-transform: uppercase; 
}

.search-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
}
.btn-dl-icon { 
    padding: 0 15px; 
    background: var(--dark); 
    color: white; 
    border-radius: 12px; 
    border: none; 
    font-size: 1.2rem; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* MODALS */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    backdrop-filter: blur(4px); 
    z-index: 9999; /* Increased z-index */
    display: none; 
    justify-content: center; 
    align-items: center; 
}
.modal-box { 
    background: var(--card); 
    width: 90%; 
    max-width: 340px; 
    padding: 25px; 
    border-radius: 24px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
    animation: popIn 0.3s; 
    position: relative;
    z-index: 10000;
}
@keyframes popIn { 
    from { 
        transform: scale(0.9); 
        opacity: 0; 
    } 
    to { 
        transform: scale(1); 
        opacity: 1; 
    } 
}
.detail-row { 
    display: flex; 
    justify-content: space-between; 
    border-bottom: 1px solid var(--border); 
    padding: 10px 0; 
}
.d-lbl { 
    color: var(--text-sub); 
    font-size: 0.8rem; 
    font-weight: 600; 
}
.d-val { 
    font-weight: 600; 
    text-align: right; 
    color: var(--text-main); 
    font-size: 0.9rem; 
}
.modal-inp { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    margin-bottom: 12px; 
    font-size: 1rem; 
    background: var(--bg); 
    color: var(--text-main); 
}
.modal-btns { 
    display: flex; 
    justify-content: flex-end; 
    gap: 10px; 
    margin-top: 20px; 
}
.btn-m { 
    padding: 10px 20px; 
    border-radius: 10px; 
    border: none; 
    cursor: pointer; 
    font-weight: 600; 
}
.btn-cancel-order { 
    width: 100%; 
    padding: 12px; 
    background: var(--danger-light); 
    color: var(--danger); 
    border: none; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    margin-top: 15px; 
}

.toast { 
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: var(--dark); 
    color: white; 
    padding: 10px 24px; 
    border-radius: 50px; 
    font-size: 0.85rem; 
    opacity: 0; 
    pointer-events: none; 
    transition: 0.3s; 
    z-index: 2000; 
    font-weight: 600; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); 
}
.toast.show { 
    opacity: 1; 
    bottom: 40px; 
}
.hidden { 
    display: none; 
}

/* === SECURITY & RESET MODALS === */
.security-icon-wrap {
    width: 80px; 
    height: 80px; 
    background: var(--primary-light); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 15px;
    animation: pulseBlue 2s infinite;
}
@keyframes pulseBlue {
    0% { 
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); 
    }
    70% { 
        box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); 
    }
}

.danger-icon-wrap {
    width: 80px; 
    height: 80px; 
    background: #fee2e2; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 15px;
    animation: pulseRed 2s infinite;
}
.danger-icon { 
    font-size: 2.5rem; 
}
@keyframes pulseRed {
    0% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); 
    }
    70% { 
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); 
    }
}

.shake { 
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; 
}
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* === FORGOT PIN FIX === */
#forgotModal { 
    z-index: 20000 !important; 
}

/* =========================================
   EDIT MODAL UI (UPDATED & VISIBLE)
   ========================================= */

/* Header Style */
.edit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.edit-icon { 
    width: 45px; 
    height: 45px; 
    background: #e0e7ff; 
    color: #4f46e5; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.4rem; 
    font-weight: 800;
}

/* INPUT BOX (GHOR) STYLE - UPDATED FOR VISIBILITY */
.edit-inp-box {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 10px 12px; 
    border-radius: 12px; 
    margin-bottom: 12px; 
    transition: all 0.2s ease;
    position: relative;
}

.edit-inp-box:focus-within {
    background: #ffffff;
    border-color: #4f46e5; 
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.edit-label {
    font-size: 0.75rem; 
    font-weight: 700; 
    color: #64748b;
    margin-bottom: 4px; 
    display: block; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.clean-inp {
    width: 100%; 
    border: none; 
    background: transparent; 
    font-size: 1rem; 
    color: #334155; 
    font-weight: 600; 
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
    padding: 0;
}

/* =========================================
   JS GENERATED MODAL STYLES (PREMIUM UI)
   ========================================= */
.edit-icon { 
    width: 42px; 
    height: 42px; 
    background: var(--primary-light); 
    color: var(--primary); 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.3rem; 
    font-weight: 800;
}

.edit-label {
    font-size: 0.7rem; 
    font-weight: 700; 
    color: var(--text-sub);
    margin-bottom: 6px; 
    display: block; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.edit-inp-box {
    background: var(--bg); 
    border: 1px solid var(--border);
    padding: 8px 12px; 
    border-radius: 12px; 
    margin-bottom: 12px; 
    transition: 0.2s;
}

.edit-inp-box:focus-within {
    border-color: var(--primary); 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
    background: var(--card);
}

.clean-inp {
    width: 100%; 
    border: none; 
    background: transparent; 
    font-size: 0.95rem; 
    color: var(--text-main); 
    font-weight: 600; 
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
}

.security-icon-wrap, .danger-icon-wrap {
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 15px;
}

.security-icon-wrap {
    background: var(--primary-light); 
    animation: pulseBlue 2s infinite;
}

.danger-icon-wrap {
    background: var(--danger-light); 
    animation: pulseRed 2s infinite;
}

.danger-icon { 
    font-size: 2.5rem; 
}

/* =========================================
   PROFIT PROGRESS BAR UI (PREMIUM)
   ========================================= */
.prog-container {
    margin-top: 15px;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.prog-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    margin-bottom: 6px;
}

.prog-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.prog-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #10b981);
    width: 0%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.loss-alert {
    font-size: 0.7rem;
    color: #fca5a5;
    margin-top: 6px;
    display: block;
    font-weight: 600;
    animation: pulseText 2s infinite;
}

.profit-badge {
    font-size: 0.75rem;
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

@keyframes pulseText {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* =========================================
   ANIMATION FIXES - REMOVED PROBLEMATIC ANIMATIONS
   ========================================= */

/* Comment out problematic animations temporarily */
/*
.dashboard-card, 
.star-summary-card, 
.card-box, 
.list-item, 
.history-item {
    animation: fadeInUpSmooth 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}
*/

@keyframes popInSmooth {
    0% { opacity: 0; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.modal-box {
    animation: popInSmooth 0.4s ease-out !important;
}

button:active, .btn-m:active, .slot-btn:active, .icon-btn:active {
    transform: scale(0.95) !important;
    transition: transform 0.1s;
}

/* List hover effect - keep but ensure it doesn't break layout */
.list-item:hover, .history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.list-item, .history-item {
    transition: all 0.3s ease;
}

/* Tab slider - REMOVED PROBLEMATIC CODE */
/*
.nav-wrapper {
    position: relative;
}
.nav-tabs {
    position: relative;
    border-bottom: 2px solid var(--border);
}

.nav-item.active {
    border-bottom: 3px solid var(--primary);
    border-radius: 12px 12px 0 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--primary) !important;
    font-weight: 800;
}
*/

/* Z-INDEX FIXES */
#resetModal { 
    z-index: 20000 !important; 
}
#gptModal { 
    z-index: 10000 !important; 
}

/* =========================================
   PREMIUM PROGRESS BAR UI (ONLY FOR PROFIT CARD)
   ========================================= */
.prog-container {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.25);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
}

.prog-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.prog-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.prog-fill {
    height: 100%;
    width: 0%;
    border-radius: 20px;
    background: linear-gradient(90deg, #ff512f, #f09819); 
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1); 
    position: relative;
    box-shadow: 0 0 15px rgba(240, 152, 25, 0.6);
}

.prog-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.loss-alert {
    font-size: 0.75rem;
    color: #ffccbc;
    margin-top: 8px;
    display: block;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 0, 0, 0.1);
    padding: 4px;
    border-radius: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.profit-msg {
    font-size: 0.75rem;
    color: #a7f3d0;
    margin-top: 8px;
    display: block;
    font-weight: 700;
    text-align: center;
}

/* =========================================
   GMAIL TAGS UI (MARK SYSTEM)
   ========================================= */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-btn.active {
    border-color: transparent;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.t-gemini.active { background: #4f46e5; }
.t-gpt.active { background: #10b981; }
.t-plus.active { background: #f59e0b; }
.t-new.active { background: #06b6d4; }
.t-pay.active { background: #ef4444; }

.list-tags {
    display: flex;
    gap: 4px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.mini-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    background: var(--bg);
    border: 1px solid var(--border);
    display: inline-block;
    margin: 2px;
}

/* SHAKE ANIMATION FOR WRONG PIN */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-15px); }
    40% { transform: translateX(15px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.4s ease-in-out;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Search Highlight Animation */
.match-highlight {
    background: #fbbf24 !important;
    color: #000 !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
    transform: scale(1.05);
    z-index: 10;
    font-weight: 800;
    animation: popAnim 0.5s infinite alternate;
}

@keyframes popAnim {
    from { transform: scale(1); box-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
    to { transform: scale(1.05); box-shadow: 0 0 15px rgba(251, 191, 36, 1); }
}

/* Expired Slot Animation */
.slot-expired {
    background-color: #ef4444 !important;
    color: white !important;
    border: 1px solid #b91c1c !important;
    font-weight: bold;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* বাটন ডিজাইন */
.toggle-grp { 
    display: flex; 
    gap: 10px; 
    margin-top: 15px; 
}
.btn-tog { 
    flex: 1; 
    padding: 10px; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    cursor: pointer; 
    color: white; 
}
.bg-green { 
    background: #10b981; 
}
.bg-red { 
    background: #ef4444; 
}
.bg-gray { 
    background: #6b7280; 
}

/* অফার ক্লোজ স্লট ডিজাইন */
.slot-closed {
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
    border: 1px solid #d1d5db !important;
}


/* =========================================
   CRITICAL FIXES FOR MENU/TAB ISSUE
   ========================================= */

/* 1. Prevent any position/transform issues */
.nav-wrapper, .nav-tabs, .nav-item {
    transform: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

/* 2. Ensure app content stays in place */
#appContent {
    position: relative;
    transform: none !important;
}

/* 3. Fix modal positioning */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 4. Remove any problematic animations on tabs */
.nav-item {
    animation: none !important;
}

/* 5. Ensure proper overflow handling */
body, html {
    overflow-x: hidden;
    max-width: 100%;
}

/* 6. Fix any flexbox issues */
.nav-tabs {
    display: flex;
    flex-wrap: nowrap;
}

/* 7. Ensure click events work properly */
.nav-item {
    cursor: pointer;
    user-select: none;
}

/* 8. Critical mobile fix */
@media (max-width: 480px) {
    .nav-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs {
        min-width: 100%;
    }
    
    .nav-item {
        flex-shrink: 0;
    }
}

/* ১. সার্চ হাইলাইট স্টাইল (সবার উপরে ভাসবে) */
.match-highlight { 
    background: #facc15 !important; /* উজ্জ্বল হলুদ */
    color: #000 !important;         /* টেক্সট কালো */
    border: 2px solid #000 !important; 
    animation: pulse 1s infinite; 
    transform: scale(1.15);         /* একটু বড় দেখাবে */
    z-index: 100 !important;        /* ব্যাজ বা অন্য সবকিছুর উপরে থাকবে */
    position: relative;             /* z-index কাজ করার জন্য জরুরি */
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.9); /* গ্লো ইফেক্ট */
}

/* ২. পালস অ্যানিমেশন (আগের চেয়ে স্মুথ) */
@keyframes pulse { 
    0% { transform: scale(1.1); box-shadow: 0 0 10px rgba(250, 204, 21, 0.5); } 
    50% { transform: scale(1.2); box-shadow: 0 0 25px rgba(250, 204, 21, 1); } 
    100% { transform: scale(1.1); box-shadow: 0 0 10px rgba(250, 204, 21, 0.5); } 
}

/* ৩. ব্যাজগুলোর সাথে যাতে ঝামেলা না হয় */
.acc-suspended, .acc-offer-closed {
    position: relative; /* ব্যাজগুলো এর ভেতরে থাকবে */
}

.suspend-badge, .offer-badge {
    z-index: 5; /* হাইলাইটের (১০০) চেয়ে কম রাখা হয়েছে */
    pointer-events: none; /* যাতে ব্যাজের নিচে থাকা বাটনে ক্লিক করা যায় */
}

/* active ট্যাব এর জন্য স্টাইল */
.nav-item.active {
    color: var(--primary) !important;
    background: var(--primary-light) !important; /* হালকা ব্যাকগ্রাউন্ড */
    border-top: 3px solid var(--primary); /* উপরে একটি বর্ডার */
    font-weight: 800 !important;
}

.nav-item {
    transition: all 0.3s ease;
    border-top: 3px solid transparent; /* স্মুথ ট্রানজিশন এর জন্য */
}