﻿/* ========================================
   ALBION BM SCANNER v3.0
   blackmarket.css — Black Market scanner, flip tables, filters
   ======================================== */
/* ============================================
   SUMMARY BAR (5-card compact footer)
   ============================================ */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow-card);
}

.summary-bar-item {
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px 12px;
}

.summary-bar-item .summary-label {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 4px;
}

.summary-bar-item .summary-value {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.summary-bar-item.emerald {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.06);
}
.summary-bar-item.emerald .summary-label { color: rgba(16, 185, 129, 0.6); }
.summary-bar-item.emerald .summary-value { color: #34d399; }

.summary-bar-item.sky {
    border-color: rgba(56, 189, 248, 0.2);
    background: rgba(56, 189, 248, 0.06);
}
.summary-bar-item.sky .summary-label { color: rgba(56, 189, 248, 0.6); }
.summary-bar-item.sky .summary-value { color: #38bdf8; }

.summary-bar-item.amber {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.06);
}
.summary-bar-item.amber .summary-label { color: rgba(245, 158, 11, 0.6); }
.summary-bar-item.amber .summary-value { color: #fbbf24; }

/* ============================================
   TAB SWITCHER (BM Flip / Upgrade Flip)
   ============================================ */
.tab-switcher {
    display: inline-flex;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
}

.tab-switcher-btn {
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-switcher-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
}

.tab-switcher-btn.active {
    background: rgba(212, 168, 67, 0.15);
    color: #fbbf24;
}

.tab-switcher-btn .badge-soon {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    margin-left: 6px;
    vertical-align: middle;
}

/* ============================================
   DATA AGE BADGE (inline in tables)
   ============================================ */
.data-age-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    vertical-align: middle;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.data-age-badge.fresh {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.data-age-badge.moderate {
    background: rgba(234, 179, 8, 0.12);
    color: #fbbf24;
}

.data-age-badge.stale {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

/* ============================================
   PRICE SOURCE BADGES (inline in tables)
   ============================================ */
.price-source-badge {
    font-size: 11px;
    vertical-align: middle;
    margin-left: 4px;
    cursor: help;
}

.price-source-badge.api { color: #34d399; }
.price-source-badge.manual { color: #fbbf24; }
.price-source-badge.est { color: rgba(255,255,255,0.3); }

/* ============================================
   LAST REFRESH INFO
   ============================================ */
.last-refresh-info {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

.last-refresh-info .refresh-time {
    color: rgba(255,255,255,0.55);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE — New components
   ============================================ */
@media (max-width: 768px) {
    .summary-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .summary-bar-item:last-child {
        grid-column: span 2;
    }
    .settings-box-grid {
        grid-template-columns: 1fr;
    }
    .freshness-presets {
        gap: 3px;
    }
    .freshness-preset-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .summary-bar {
        grid-template-columns: 1fr;
    }
    .summary-bar-item:last-child {
        grid-column: span 1;
    }
}

/* ============================================
   BM COPY NAME
   ============================================ */
.bm-copy-name {
    cursor: pointer !important;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
}

.bm-copy-name:hover {
    color: var(--gold-primary) !important;
    text-decoration-color: var(--gold-primary);
}

/* ============================================
   BM SHOPPING LIST BUTTONS
   ============================================ */
.bm-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bm-add-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    transform: scale(1.1);
}

.bm-added {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(212, 168, 67, 0.4);
    background: rgba(212, 168, 67, 0.12);
    color: #fbbf24;
    font-size: 14px;
    font-weight: 700;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bm-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bm-remove-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
    transform: scale(1.1);
}

/* ============================================
   BM FLIP TABLE — YoianAlbion-Inspired Design
   ============================================ */
.bm-flip-table {
    table-layout: fixed;
    width: 100%;
}

.bm-flip-table thead tr {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
}

.bm-flip-table thead th {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.55);
    padding: 14px 20px;
    white-space: nowrap;
}

.bm-th-item { width: 38%; }

/* Row styles */
.bm-row {
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.bm-row:hover {
    background: rgba(255,255,255,0.04);
}

/* ---- Item Cell ---- */
.bm-item-td { padding: 14px 20px !important; }

.bm-item-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bm-item-icon-wrap {
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.bm-item-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
    transition: transform 0.2s ease;
}

.bm-row:hover .bm-item-img {
    transform: scale(1.12);
}

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

.bm-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bm-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease;
}

button.bm-item-name:hover {
    color: var(--gold-primary);
}

.bm-tier-tag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.4);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
}

.bm-item-sub {
    margin-top: 3px;
    font-size: 11px;
    color: rgba(255,255,255,0.32);
}

/* ---- Inline Add Button ---- */
.bm-add-btn-inline {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bm-add-btn-inline:hover {
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.25);
    transform: scale(1.04);
}

.bm-add-btn-inline:active {
    transform: scale(0.97);
}

/* ---- Price Cells ---- */
.bm-price-td {
    padding: 14px 20px !important;
    white-space: nowrap;
}

.bm-price-main {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    font-variant-numeric: tabular-nums;
}

.bm-price-bm {
    font-size: 13px;
    font-weight: 700;
    color: #f59e0b;
    font-variant-numeric: tabular-nums;
}

.bm-price-sub {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: rgba(255,255,255,0.32);
}

/* ---- Profit Cell ---- */
.bm-profit-td {
    padding: 14px 20px !important;
    white-space: nowrap;
    text-align: right;
}

.bm-profit-glow {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #4ade80;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.4));
}

.bm-profit-loss {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #f87171;
}

/* ---- Margin Cell ---- */
.bm-margin-td {
    padding: 14px 20px !important;
    text-align: right;
}

.bm-margin-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

.bm-margin-pill.positive {
    border: 1px solid rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.bm-margin-pill.negative {
    border: 1px solid rgba(248, 113, 113, 0.2);
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

/* ---- Age Cell ---- */
.bm-age-td {
    padding: 14px 20px !important;
    text-align: right;
    color: rgba(255,255,255,0.45);
}

/* ---- Table Footer ---- */
.bm-table-footer td {
    padding: 10px 20px !important;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    display: flex;
    justify-content: space-between;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .bm-flip-table thead th { padding: 10px 12px; font-size: 10px; }
    .bm-item-td, .bm-price-td, .bm-profit-td, .bm-margin-td, .bm-age-td { padding: 10px 12px !important; }
    .bm-item-img { width: 32px; height: 32px; }
    .bm-item-name { font-size: 12px; }
}

@media (max-width: 768px) {
    .bm-flip-table { table-layout: auto; }
    .bm-th-item { width: auto; }
    .bm-add-btn-inline { padding: 3px 7px; font-size: 10px; }
}

/* ============================================
   BM TIME FILTERS — AlbionMarketHub Style
   ============================================ */
.bm-time-filters {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
}

.bm-time-filter-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bm-time-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.bm-time-filter-item {
    flex: 1;
}

.bm-time-filter-item label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 5px;
}

.bm-time-filter-item select {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bm-time-filter-item select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15);
}

.bm-time-arrow {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 300;
    padding-bottom: 8px;
    opacity: 0.5;
}

.bm-time-hint {
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

/* ============================================
   BM SEARCH INPUT
   ============================================ */
.bm-results-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.bm-search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.5;
}

.bm-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px 6px 32px;
    color: var(--text-primary);
    font-size: 12px;
    width: 180px;
    transition: all 0.25s ease;
}

.bm-search-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15);
    width: 220px;
}

.bm-search-input::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   BM INLINE AGE DOTS
   ============================================ */
.bm-price-city {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 10px;
    color: rgba(255,255,255,0.35);
}

.bm-age-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bm-age-dot.fresh { background: #4ade80; box-shadow: 0 0 4px rgba(74, 222, 128, 0.5); }
.bm-age-dot.moderate { background: #f59e0b; box-shadow: 0 0 4px rgba(245, 158, 11, 0.4); }
.bm-age-dot.stale { background: #ef4444; box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }

.bm-age-text {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   BM PROFIT DETAILS (Fee Breakdown)
   ============================================ */
.bm-profit-details {
    margin-top: 2px;
}

.bm-fee-line {
    font-size: 10px;
    color: rgba(245, 158, 11, 0.7);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   BM PAGINATION
   ============================================ */
.bm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.bm-page-btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bm-page-btn:hover:not(:disabled) {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: rgba(212, 168, 67, 0.08);
}

.bm-page-btn.active {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    color: #000;
    font-weight: 700;
}

.bm-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bm-page-dots {
    color: var(--text-muted);
    font-size: 12px;
    padding: 0 4px;
}

/* ============================================
   UPGRADE FLIP — Recipe & Material Styles
   ============================================ */
.bm-upgrade-arrow {
    color: var(--gold-primary);
    font-size: 12px;
    font-weight: 700;
    margin: 0 2px;
}

.bm-tier-target {
    background: rgba(212, 168, 67, 0.15) !important;
    border-color: rgba(212, 168, 67, 0.3) !important;
    color: #fbbf24 !important;
}

.bm-upgrade-recipe {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.bm-mat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid;
    background: rgba(0,0,0,0.3);
    white-space: nowrap;
}

.bm-mat-cost {
    font-size: 10px;
    color: rgba(245, 158, 11, 0.7);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bm-mat-fee {
    color: rgba(139, 92, 246, 0.7) !important;
}

/* ============================================
   BM STOP SCAN BUTTON
   ============================================ */
.bm-stop-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    animation: stopPulse 1.5s ease-in-out infinite;
}

.bm-stop-btn:hover {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px);
}

@keyframes stopPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ============================================
   BM UPGRADE COPY ACTIONS
   ============================================ */
.bm-copy-btn-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.bm-copy-btn-action:hover {
    background: rgba(212, 168, 67, 0.15);
    border-color: rgba(212, 168, 67, 0.3);
    color: #fbbf24;
}

.bm-copy-btn-action:active {
    transform: scale(0.95);
}

