/* =====================================================
   CGC REWARD APP – FULLY ISOLATED & SAFE CSS
   Theme-Proof | Mobile-Friendly | Production Ready
   ===================================================== */

/* ---------- ROOT ISOLATION ---------- */
#cgc-reward-root {
    all: initial;
    isolation: isolate;
    display: block;
    min-height: 100vh;
    background: #f8fafc !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #1e293b !important;
    line-height: 1.6;
    position: relative;
    z-index: 10;
}

/* ---------- SAFE RESET (theme killer) ---------- */
#cgc-reward-root *,
#cgc-reward-root *::before,
#cgc-reward-root *::after {
    box-sizing: border-box !important;
    font-family: inherit !important;
}

/* ---------- TYPOGRAPHY ---------- */
#cgc-reward-root h1,
#cgc-reward-root h2,
#cgc-reward-root h3,
#cgc-reward-root h4 {
    margin: 0;
    font-weight: 800;
    color: #0f172a;
}

#cgc-reward-root p {
    margin: 0;
    color: #475569;
}

/* ---------- INPUTS ---------- */
#cgc-reward-root input,
#cgc-reward-root select,
#cgc-reward-root textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    outline: none;
}

#cgc-reward-root input:focus {
    border-color: #2563eb;
}

/* ---------- BUTTONS ---------- */
#cgc-reward-root button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    white-space: normal;
    line-height: 1.3;
    height: auto;
    background: #2563eb;
    color: #ffffff;
}

#cgc-reward-root button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- LOGIN / AUTH FORMS ---------- */
#cgc-reward-root .space-y-4 > * + * {
    margin-top: 12px;
}

#cgc-reward-root .space-y-6 > * + * {
    margin-top: 16px;
}

#cgc-reward-root .text-xs {
    font-size: 12px;
}

/* ---------- TABLE ---------- */
#cgc-reward-root table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

#cgc-reward-root th {
    padding: 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    background: #f1f5f9;
    text-align: left;
}

#cgc-reward-root td {
    padding: 14px;
    font-size: 13px;
    color: #334155;
    border-top: 1px solid #e5e7eb;
}

/* ---------- ACTION BUTTON GROUP ---------- */
#cgc-reward-root td .flex {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#cgc-reward-root td button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

/* ---------- MODALS ---------- */
#cgc-reward-root .fixed {
    position: fixed !important;
    inset: 0;
    z-index: 999999 !important;
}

/* ---------- SCROLL ---------- */
#cgc-reward-root ::-webkit-scrollbar {
    width: 6px;
}

#cgc-reward-root ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

/* ---------- MOBILE OPTIMIZATION ---------- */
@media (max-width: 768px) {

    #cgc-reward-root {
        font-size: 14px;
    }

    #cgc-reward-root button {
        width: 100%;
        padding: 10px;
        font-size: 13px;
    }

    #cgc-reward-root table,
    #cgc-reward-root thead,
    #cgc-reward-root tbody,
    #cgc-reward-root th,
    #cgc-reward-root td,
    #cgc-reward-root tr {
        display: block;
    }

    #cgc-reward-root th {
        display: none;
    }

    #cgc-reward-root td {
        padding: 10px;
        border-top: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* ===== FIX: Master Liquidity Balance Visibility ===== */
#cgc-reward-root .bg-slate-900 h2,
#cgc-reward-root .bg-slate-900 .text-blue-400 {
    color: #60a5fa !important;
}

#cgc-reward-root .bg-slate-900 p {
    color: #cbd5f5 !important;
}

/* ===== FIX: USER WALLET PANEL TEXT VISIBILITY (BLUE BG) ===== */
#cgc-reward-root .bg-blue-600,
#cgc-reward-root .bg-blue-700,
#cgc-reward-root .bg-blue-800,
#cgc-reward-root .bg-indigo-600,
#cgc-reward-root .bg-indigo-700 {
    color: #ffffff !important;
}

#cgc-reward-root .bg-blue-600 *,
#cgc-reward-root .bg-blue-700 *,
#cgc-reward-root .bg-blue-800 *,
#cgc-reward-root .bg-indigo-600 *,
#cgc-reward-root .bg-indigo-700 * {
    color: #ffffff !important;
}

/* Numbers / balances extra clarity */
#cgc-reward-root .bg-blue-600 h1,
#cgc-reward-root .bg-blue-600 h2,
#cgc-reward-root .bg-blue-600 h3,
#cgc-reward-root .bg-blue-600 span,
#cgc-reward-root .bg-blue-600 strong {
    color: #ffffff !important;
}

/* ===== FORCE FIX: WALLET BALANCE COLOR (LAST OVERRIDE) ===== */

/* Any blue/gradient wallet container */
#cgc-reward-root [class*="bg-blue"],
#cgc-reward-root [class*="bg-indigo"],
#cgc-reward-root [class*="bg-gradient"] {
    color: #ffffff !important;
}

/* Text, spans, strong, numbers */
#cgc-reward-root [class*="bg-blue"] *,
#cgc-reward-root [class*="bg-indigo"] *,
#cgc-reward-root [class*="bg-gradient"] * {
    color: #ffffff !important;
}

/* 🔥 IMPORTANT: balance shown inside input / readonly field */
#cgc-reward-root [class*="bg-blue"] input,
#cgc-reward-root [class*="bg-indigo"] input,
#cgc-reward-root [class*="bg-gradient"] input {
    color: #ffffff !important;
    background: transparent !important;
    border-color: rgba(255,255,255,0.4) !important;
}

/* Placeholder safety */
#cgc-reward-root [class*="bg-blue"] input::placeholder {
    color: rgba(255,255,255,0.7) !important;
}

