/* ============================================================================
 * multi.css – combined crumbs + pistyle themes
 * Toggle via body.crumb-style vs body.pi-style
 * Last updated: 2026-01
 * ============================================================================ */

/* ============================================================================
   PI-STYLE (purple / gold) – default when body has .pi-style
   ============================================================================ */
body.pi-style {
    --bg: #4a3474;
    --panel: #4a2f6f;
    --border: #3a295e;
    --border-light: #fed293;
    --fg: #feffff;
    --muted: #e6ddf3;
    --accent: #fbb44a;
    --accent-text: #251200;
    --banner-bg: #4a2f6f;
    --banner-text: #000000;
    --danger: #ef4444;
}

/* ============================================================================
   CRUMBS-STYLE (dark teal/green) – active when body has .crumb-style
   ============================================================================ */
body.crumb-style {
    --bg: #000;
    --panel: #111611;
    --border: #1b2a21;
    --border-light: #2dd4bf;
    --fg: #eafffb;
    --muted: #9ca3af;
    --accent: #2dd4bf;
    --accent-text: #000;
    --banner-bg: #2dd4bf;
    --banner-text: #000;
    --danger: #ef4444;
}

/* ============================================================================
   Shared base rules – both themes
   ============================================================================ */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg) !important;
    color: var(--fg);
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Cards */
.card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
}

.card-top {
    height: 44px;
    display: grid;
    place-items: center;
    width: 100%;
    padding: 0;
    margin: 0;
    text-align: center;
    font-weight: bold;
    background: var(--banner-bg);
    color: var(--banner-text);
    border-bottom: 1px solid var(--bg);
}

.card-body {
    padding: 14px 12px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

.card-action {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--bg);
}

/* Buttons */
.btn {
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    filter: brightness(1.05);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    justify-content: center;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* States */
.card.locked {
    opacity: 0.88;
    position: relative;
    overflow: hidden;
}

.card.locked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,.65), rgba(0,0,0,.65)),
                url("/assets/underm.png") center 60% / 70% no-repeat;
    z-index: 6;
    pointer-events: none;
}

.card.locked .btn {
    pointer-events: none;
    border-color: #334d40;
    color: #6b7280;
    opacity: 0.85;
}

.card.danger {
    border-color: var(--danger);
}

.card.danger::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(239,68,68,.08);
    pointer-events: none;
}


/* Vertical spacing between cards */
.content > .card + .card {
    margin-top: 12px;
}

/* Chart fixes */
canvas, #chart {
    max-width: 100%;
    width: 100%;
    display: block;
}

/* ============================================================================
   BubbleMaps-specific overrides & utilities
   ============================================================================ */

/* Input + button row */
.head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.head input {
    flex: 1;
    min-width: 220px;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--fg);
    font-family: inherit;
}
.head button {
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    font-weight: 600;
}
.head button:hover { filter: brightness(1.05); }

/* Zoom controls */
.zoom-controls {
    margin: 8px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.zoom-controls button {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--panel);
    color: var(--fg);
}
.zoom-controls label {
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

/* Graph container */
#graph {
    height: 420px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    position: relative;
}
@media (max-width: 750px) {
    #graph { height: 380px; }
}

/* Card head adjustments */
.card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    background: var(--banner-bg);
    color: var(--banner-text);
}
.card-head #acctLabel {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60vw;
    color: var(--fg);
}
.card-head strong { flex-shrink: 0; }

/* Empty state */
.empty {
    color: var(--muted);
    text-align: center;
    padding: 40px 8px;
}

/* Note/warning */
.note {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 4px 0 10px;
    text-align: center;
}

/* Footer */
footer {
    margin: 24px 0 40px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}
footer .links a {
    margin: 0 6px;
    color: var(--muted);
    text-decoration: none;
}
footer .links a:hover { text-decoration: underline; }

/* vis-network overrides for theme consistency */
.vis-network {
    background: var(--panel) !important;
}
.vis-network .vis-node {
    font: 12px ui-monospace !important;
    color: var(--fg) !important;
}
.vis-network .vis-edge {
    color: var(--muted) !important;
}
.vis-network .vis-background {
    background: var(--panel) !important;
}


/* Force global logo size – override anything */
.logo-banner,
.logo-banner img,
.card.logo-card img {
    max-width: 180px !important;
    width: 80% !important;
    height: auto !important;
    opacity: 0.9;
    display: block !important;
    margin: 0 auto !important;
}

@media (max-width: 600px) {
    .logo-banner img,
    .card.logo-card img {
        max-width: 160px !important;
        width: 70% !important;
    }
}

/* Mobile: smaller but still readable */
@media (max-width: 600px) {
    .logo-banner img {
        max-width: 160px;
        width: 70%;
    }
}

/* BubbleMap Legend – theme-aware colors */
.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 20px;
    margin: 16px 0;
}

.legend-grid .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Theme-specific dot colors */
body.crumb-style .legend-grid .dot.incoming   { background: #59a14f; }
body.crumb-style .legend-grid .dot.outgoing   { background: #e15759; }
body.crumb-style .legend-grid .dot.exchange-in  { background: linear-gradient(to right, #59a14f 50%, #3b82f6 50%); }
body.crumb-style .legend-grid .dot.exchange-out { background: linear-gradient(to right, #e15759 50%, #3b82f6 50%); }
body.crumb-style .legend-grid .dot.current    { background: #f28e2b; }

body.pi-style .legend-grid .dot.incoming   { background: #4caf50; }          /* softer green for purple bg */
body.pi-style .legend-grid .dot.outgoing   { background: #ef5350; }          /* softer red */
body.pi-style .legend-grid .dot.exchange-in  { background: linear-gradient(to right, #4caf50 50%, #42a5f5 50%); }
body.pi-style .legend-grid .dot.exchange-out { background: linear-gradient(to right, #ef5350 50%, #42a5f5 50%); }
body.pi-style .legend-grid .dot.current    { background: #fbb44a; }          /* gold accent for pi-style */

/* Watchdog-specific fixes – keep tables full-width and centered in cards */
.card table {
    width: 100%;
    table-layout: auto;
    margin: 0 auto;
}

.card th, .card td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

/* Tier icons – smaller and inline */
.tier-icon {
    width: 16px !important;           /* reduced from 20px */
    height: 16px !important;
    vertical-align: middle;
    margin-right: 6px;
}

/* Fix left-bunch – ensure table cells don't collapse */
.card .table-wrap {
    overflow-x: auto;
    width: 100%;
}

.card tbody tr td:first-child {
    min-width: 140px;  /* wallet address column */
}

/* Optional: subtle zebra for readability */
.card tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}
.table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

/* Mobile tables: smooth horizontal scroll + clear hint */
@media (max-width: 768px) {
    .card .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* smooth iOS momentum scroll */
        scrollbar-width: thin;
        scrollbar-color: var(--muted) transparent;
        position: relative;
        margin: 12px 0;
    }

    .card .table-wrap::-webkit-scrollbar {
        height: 6px;
    }
    .card .table-wrap::-webkit-scrollbar-thumb {
        background: var(--muted);
        border-radius: 3px;
    }

    .card table {
        min-width: 100%;                   /* at least full card width */
        width: max-content;                /* expand if content needs more */
        table-layout: auto;
        border-collapse: collapse;
    }

    .card th, .card td {
        padding: 8px 10px;
        white-space: nowrap;               /* keep text on one line */
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;                  /* cap very long cells (e.g. addresses) */
    }

    /* Make long columns scrollable but hint obvious */
    .card .table-wrap::before,
    .card .table-wrap::after {
        content: "Swipe →";
        position: absolute;
        right: 8px;
        bottom: 8px;
        font-size: 0.8rem;
        color: var(--muted);
        background: rgba(0,0,0,0.6);
        padding: 4px 8px;
        border-radius: 6px;
        pointer-events: none;
        z-index: 2;
        opacity: 0.85;
    }
    .card .table-wrap::before {
        content: "← Swipe";
        left: 8px;
        right: auto;
    }

    /* Hide hint if no scroll needed (optional) */
    .card .table-wrap:not(:has(table[style*="width"]))::before,
    .card .table-wrap:not(:has(table[style*="width"]))::after {
        display: none;
    }
}

/* Desktop: no hint, no forced min-width */
@media (min-width: 769px) {
    .card .table-wrap::before,
    .card .table-wrap::after {
        display: none;
    }
    .card table {
        width: 100%;
        min-width: 100%;
    }
}

/* Track & Trace – Recent TX links ONLY */
#recentList a.badge {
  color: #ffffff;
  text-decoration: none;
}

#recentList a.badge:hover {
  text-decoration: underline;
}
