/* =========================================================================
 *  /css/console.css
 *  Fast Bitcoin Accelerator — left-side terminal panel.
 *  Uses IBM Plex Mono for a true terminal feel. Classic phosphor-green
 *  text with a soft glow on a frosted-glass dark background — like a CRT
 *  monitor running Windows CMD.
 * ========================================================================= */

/* ============== LEFT-SIDE TERMINAL CONSOLE ============== */

.fbt-console {
    position: fixed;
    top: 0;
    left: -440px; /* hidden off-canvas */
    width: 100%;
    max-width: 400px;
    height: 100dvh;
    z-index: 9999;
    padding: 22px 22px 90px 22px;

    /* Strong frosted-glass blur. Page content behind stays visible. */
    background-color: rgba(1, 14, 26, 0.55);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);

    /* Default text color: classic terminal phosphor green */
    color: #4ade80;
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-weight: 400;
    font-size: 14.5px;
    line-height: 1.55;
    letter-spacing: 0;

    opacity: 0;
    transition: left 0.35s ease-in-out, opacity 0.35s ease-in-out;
    overflow: hidden;

    /* Defensive: never let content force the panel wider than itself */
    box-sizing: border-box;
}

.fbt-console.open {
    left: 0;
    opacity: 1;
}

/* Fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .fbt-console {
        background-color: rgba(1, 14, 26, 0.88);
    }
}

/* Header */
.fbt-console__header h2 {
    margin: 0 0 16px 0;
    padding: 8px 0;
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-weight: 600;
    font-size: 17px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
    letter-spacing: 0;
}

/* Scrolling output container */
.fbt-console__output {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100dvh - 120px);
    padding: 0 4px 80px 0;
    -ms-overflow-style: none;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}
.fbt-console__output::-webkit-scrollbar { width: 5px; }
.fbt-console__output::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}
.fbt-console__output::-webkit-scrollbar-track { background: transparent; }

/* All dynamic lines start hidden, then fade/slide in via .show */
.fbt-line {
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    margin-bottom: 5px;
    font-size: 14.5px;
    color: #4ade80;
    /* Phosphor green glow — gives that CRT/CMD vibe */
    text-shadow: 0 0 6px rgba(74, 222, 128, 0.55),
                 0 0 14px rgba(74, 222, 128, 0.22);
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}
.fbt-line.show {
    opacity: 1;
    transform: translateY(0);
}

/* "Checking Transaction ID /" — the first spinner line */
.fbt-line--checking {
    color: #4ade80;
    font-size: 15px;
    margin-bottom: 14px;
}
.fbt-spinner {
    display: inline-block;
    width: 10px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
}

/* "Transaction Found: <hash>" */
.fbt-line--found {
    margin-bottom: 10px;
    line-height: 1.45;
}
.fbt-line--found .fbt-label {
    color: #4ade80;
    font-weight: 500;
}
.fbt-line--found .fbt-hash {
    color: #d4f7e0;
    font-weight: 400;
    word-break: break-all;
    text-shadow: 0 0 5px rgba(212, 247, 224, 0.5);
}

/* Fee / Size rows — values in white for contrast */
.fbt-line--meta { margin-bottom: 5px; }
.fbt-line--meta .fbt-value {
    color: #ffffff;
    font-weight: 500;
    margin-left: 4px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

/* "Transaction not within the next block" — blue accent + gap below */
.fbt-line--status {
    color: #60a5fa;
    margin-top: 14px;
    margin-bottom: 22px;
    font-weight: 500;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.55),
                 0 0 14px rgba(96, 165, 250, 0.22);
}

/* "Rebroadcasting..." marker */
.fbt-line--broadcasting {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.45);
}

/* Each node line: name on left, Done on right */
.fbt-line--node {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.fbt-line--node .fbt-node {
    word-break: break-all;
    color: #4ade80;
    /* Inherits the green glow from .fbt-line */
}
.fbt-line--node .fbt-done {
    color: #ffffff;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
}

/* Final "don't pay" warning line for Mode B + next-block */
.fbt-line--warn {
    margin-top: 18px;
    color: #fbbf24;
    font-weight: 500;
    line-height: 1.5;
    font-size: 14.5px;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.55);
}

/* Close button (hidden by default — auto-close handles it) */
.fbt-console__close {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 22px;
    background-color: rgba(0, 0, 0, 0.55);
    display: none;
}
.fbt-console__close button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background-color: #ffaa33;
    color: #fff;
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.fbt-console.show-close .fbt-console__close { display: block; }

/* =========================================================
   MOBILE — defensive sizing so nothing overflows the viewport
   ========================================================= */
@media (max-width: 768px) {
    .fbt-console {
        /* Cap at viewport width minus a small gutter; never wider */
        max-width: 100vw;
        width: 100vw;
        padding: 16px 14px 70px 14px;
        font-size: 12.5px;
        line-height: 1.5;
        /* When closed, hide further left so it never peeks */
        left: -110vw;
    }
    .fbt-console__header h2 {
        font-size: 15px;
        margin-bottom: 10px;
    }
    .fbt-line,
    .fbt-line--checking,
    .fbt-line--found,
    .fbt-line--meta,
    .fbt-line--status,
    .fbt-line--broadcasting,
    .fbt-line--warn {
        font-size: 12.5px;
    }
    .fbt-line--node {
        font-size: 12.5px;
        /* On very narrow screens the "Done" wraps below the name if needed */
        gap: 8px;
    }
    .fbt-console__output {
        max-height: calc(100dvh - 100px);
        padding-right: 2px;
    }
}


/* ============== "NO PAYMENT NEEDED" ALERT ============== */
/* Uses the same Bootstrap classes (btn + alert-primary + hide) as the
 * "Transaction is already confirmed!" alert so the two messages look and
 * behave identically. No custom styling needed here.
 */


/* ============== ATTENTION ARROW (Google Ads style) ============== */
.fbt-arrow-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.78);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

.fbt-arrow-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Arrow — square dimensions (matches the 1:1 viewBox of the new SVG).
 * Position is set inline by JS so its tip lands on the button.
 */
.fbt-arrow {
    position: absolute;
    width: 180px;
    height: 180px;
    pointer-events: none;
    filter: drop-shadow(0 0 14px rgba(255, 170, 51, 0.8));
    animation: fbtArrowBob 0.9s ease-in-out infinite;
}

@keyframes fbtArrowBob {
    0%, 100% { transform: translateY(0)   scale(1); }
    50%      { transform: translateY(-8px) scale(1.04); }
}

/* ============== PERSISTENT BUTTON PULSE ============== */
#acc_btn {
    animation: fbtPulseSubtle 2.2s ease-in-out infinite;
}

@keyframes fbtPulseSubtle {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 170, 51, 0.45); }
    50%      { box-shadow: 0 0 26px rgba(255, 170, 51, 0.85); }
}

body.fbt-arrow-active #acc_btn {
    position: relative;
    z-index: 10000;
    animation: fbtPulseStrong 0.85s ease-in-out infinite;
}

@keyframes fbtPulseStrong {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(255, 170, 51, 0.55),
                    0 0 36px 6px rgba(255, 170, 51, 0.7);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 170, 51, 0.18),
                    0 0 52px 12px rgba(255, 170, 51, 0.95);
    }
}

@media (max-width: 768px) {
    .fbt-arrow {
        width: 130px;
        height: 130px;
    }
}


/* =========================================================================
 *  DESKTOP TRANSACTION DETAILS — two-card layout (frosted glass)
 *  Shown only on screens ≥768px (mobile uses the simpler stacked block).
 *  Card 1 (info): LIGHT frosted glass so black labels are readable.
 *  Card 2 (price): DARKER frosted glass for visual emphasis.
 * ========================================================================= */

/* --- Card 1: transaction info — LIGHT frosted glass --- */
.fbt-tx-card {
    max-width: 720px;
    margin: 8px auto 22px;
    padding: 22px 32px;
    background: rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.40);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.10);
    text-align: left;
}

.fbt-tx-row {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}
.fbt-tx-row:last-child {
    border-bottom: none;
}

/* Black uppercase label — 14px, readable on the light frosted bg */
.fbt-tx-label {
    flex: 0 0 195px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    padding-top: 4px;
}

/* Hash value — Google Sans Flex, white, wraps */
.fbt-tx-card .fbt-tx-hash {
    flex: 1;
    font-family: 'Google Sans Flex', 'Inter', sans-serif !important;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff !important;
    word-break: break-all;
    line-height: 1.55;
    letter-spacing: -0.2px;
    background: transparent !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Size value */
.fbt-tx-size {
    flex: 1;
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
    font-size: 21px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.fbt-tx-meta {
    margin-top: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* --- Card 2: price — DARKER frosted glass for emphasis --- */
.fbt-price-card {
    max-width: 720px;
    margin: 0 auto 26px;
    padding: 20px 32px 24px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.fbt-price-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin-bottom: 12px;
}

.fbt-price-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    color: #ffffff;
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
}

/* The detail rules in index.php (lines ~583) drive the actual fee number
 * styling now — they use Google Sans Flex with proper specificity. */

/* =========================================================================
 *  FONT SMOOTHING
 *  Makes white text on the frosted-glass cards render crisper, especially
 *  on macOS Chrome/Safari where browser default smoothing is heavy.
 * ========================================================================= */
.fbt-tx-card,
.fbt-price-card,
.fbt-tx-label,
.fbt-tx-card .fbt-tx-hash,
.fbt-tx-size,
.fbt-tx-meta,
.fbt-price-label,
.mining_fee {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
