/* ================================================================
   Account Cards – Dashboard Row Design
   Checkbox (40px) | Image (180px full height) | Body (title/meta/actions)
   ================================================================ */

/* === Strip outer wrappers so .mm-card is the only card === */
.sl-item,
.ul-item {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}
/* Hide modals/scripts inside wrappers from taking layout space */
.sl-item > .modal,
.sl-item > script,
.ul-item > .modal,
.ul-item > script {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
}

/* === .mm-card – The row container === */
.mm-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}
.mm-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* === Checkbox – overlay on image === */
.mm-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    accent-color: #3586BB;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.mm-card:hover .mm-card-checkbox,
.mm-card-checkbox:checked {
    opacity: 1;
}

/* === Thumbnail – 230px full card height, left panel === */
.mm-card-thumb {
    flex: 0 0 230px;
    width: 230px;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
    align-self: stretch;
}
.mm-card-thumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, rgba(0,0,0,0.08));
    pointer-events: none;
    z-index: 1;
}
.mm-card-thumb a,
.mm-card-thumb > a,
.mm-card-thumb form,
.mm-card-thumb > *:first-child {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.mm-card-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* === Card body – fills remaining space === */
.mm-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 1.25rem 1.35rem 1rem 1.35rem;
}
.mm-card-body > *:last-child {
    padding-bottom: 0.25rem !important;
}
.mm-card-body * {
    margin-bottom: 0 !important;
}
/* Nuke stray style/br/script tags inside the card */
.mm-card style,
.mm-card-actions style,
.mm-card-body style,
.mm-card br,
.mm-card-actions br,
.mm-card script,
.mm-card-actions script {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Top row: info section */
.mm-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.mm-card-info {
    flex: 1;
    min-width: 0;
}

/* === Title row: title + #ID + badges === */
.mm-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
}
.mm-card-title a {
    color: #1e293b !important;
    text-decoration: none !important;
}
.mm-card-title a:hover {
    color: #3586BB !important;
}
.mm-card-id {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 400;
    margin-left: 0.25rem;
}

/* Badges */
.mm-badge {
    display: inline-block;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.62rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.35rem;
    letter-spacing: 0.2px;
}
.mm-badge-warn {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FCD34D;
}
.mm-badge-danger {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
.mm-badge-muted {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* === Meta row: date . amount . bidder . email . posted by === */
.mm-card-meta {
    font-size: 0.82rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
    margin-bottom: 0.15rem;
}
.mm-meta-sep {
    margin: 0 0.3rem;
    color: #cbd5e1;
}
.mm-card-email {
    color: #94a3b8;
}
.mm-card-posted {
    color: #94a3b8;
    font-style: italic;
}
.mm-card-amount {
    font-weight: 700;
    color: #065F46;
}

/* Status badges in meta line */
.mm-card-meta .winning.key {
    background: #ECFDF5;
    color: #065F46;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}
.mm-card-meta .not-winning.key {
    background: #FEF2F2;
    color: #991B1B;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}
.mm-card-meta .winning-reserve.key {
    background: #FFFBEB;
    color: #92400E;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}
.mm-card-meta .void {
    background: #F5F3FF;
    color: #5B21B6;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}

/* === Chart area (right side of top row) === */
.mm-card-chart {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mm-card-chart canvas {
    display: block;
}
.mm-card-stats {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}
.mm-card-stats span:first-child {
    font-weight: 700;
    color: #1e293b;
}
.mm-stat-increase {
    font-weight: 600;
    color: #065F46 !important;
}

/* === Actions row – single row with buttons + more dropdown === */
.mm-card-actions {
    border-top: 1px solid #f1f5f9;
    padding: 0.6rem 0 0 0;
    margin: 0.35rem 0 0 0;
}

/* Row options wrapper */
.mm-card-actions .mm-row-options {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.35rem !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center;
    font-size: 0.78rem;
    line-height: 1.3;
}

/* Status text */
.mm-status-void { color: #64748b; font-style: italic; font-size: 0.78rem; }
.mm-status-done { color: #065F46; font-size: 0.75rem; font-weight: 600; }
.mm-status-done i { margin-right: 0.15rem; }

/* All buttons base */
.mm-card-actions .btn,
.mm-card-actions .mm-row-options .btn {
    font-size: 0.76rem !important;
    padding: 0.28rem 0.6rem !important;
    border-radius: 6px !important;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-weight: 600;
    transition: all 0.15s;
    line-height: 1.35;
}

/* Light buttons (List Similar, Feedback, etc.) */
.mm-card-actions .btn-light,
.mm-card-actions .mm-row-options .btn-light {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}
.mm-card-actions .btn-light:hover { background: #f8fafc !important; border-color: #cbd5e1 !important; }

/* Invoice / Success buttons (green pill) */
.mm-card-actions .btn-success { font-size: 0.76rem !important; border-radius: 50px !important; }
.mm-card-actions .btn-outline-success { font-size: 0.76rem !important; border-radius: 50px !important; }
.mm-card-actions .btnSubmitCustom { font-size: 0.76rem !important; padding: 0.28rem 0.6rem !important; border-radius: 50px !important; }

/* Auction Report button – #3586BB filled */
.btn-auction-report,
.mm-card-actions .btn-auction-report,
.mm-card-actions .mm-row-options .btn-auction-report {
    background: #3586BB !important;
    border-color: #3586BB !important;
    color: #fff !important;
    font-size: 0.78rem !important;
    font-weight: 600;
    border-radius: 50px !important;
    padding: 0.3rem 0.65rem !important;
    transition: all 0.15s;
    line-height: 1.3;
}
.btn-auction-report:hover,
.mm-card-actions .btn-auction-report:hover,
.mm-card-actions .mm-row-options .btn-auction-report:hover {
    background: #2a6d99 !important;
    border-color: #2a6d99 !important;
    color: #fff !important;
}

/* Bid Timeline button – #3586BB outline pill */
.btn-bid-timeline,
.mm-card-actions .btn-bid-timeline,
.mm-card-actions .mm-row-options .btn-bid-timeline {
    background: transparent !important;
    color: #3586BB !important;
    border: 1.5px solid #3586BB !important;
    border-radius: 50px !important;
    font-size: 0.78rem !important;
    font-weight: 600;
    padding: 0.3rem 0.75rem !important;
    transition: all 0.2s;
    line-height: 1.3;
}
.btn-bid-timeline:hover,
.mm-card-actions .btn-bid-timeline:hover,
.mm-card-actions .mm-row-options .btn-bid-timeline:hover {
    background: #3586BB !important;
    color: #fff !important;
    border-color: #3586BB !important;
    box-shadow: 0 2px 8px rgba(53,134,187,0.3);
    transform: translateY(-1px);
}
.btn-bid-timeline i {
    margin-right: 0.2rem;
}

/* Danger buttons (Report Bidder) */
.mm-card-actions .btn-outline-danger,
.mm-card-actions .mm-row-options .btn-outline-danger {
    font-size: 0.76rem !important;
    border-radius: 6px !important;
    background: transparent !important;
    border: 1px solid #fca5a5 !important;
    color: #dc2626 !important;
}
.mm-card-actions .btn-outline-danger:hover {
    background: #FEF2F2 !important;
    border-color: #ef4444 !important;
}

/* === Mobile cards === */

/* Dead class cleanup */

@media (max-width: 575.98px) {
    /* === Desktop card hidden on mobile, mobile card visible === */

    /* Mobile card: vertical layout */
    .card.d-sm-none {
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        overflow: hidden;
        margin-bottom: 0.65rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
        transition: all 0.25s ease;
    }
    .card.d-sm-none:hover {
        border-color: #cbd5e1;
        box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    }

    /* Image: full width, max 220px height */
    .card.d-sm-none .card-img-top {
        width: 100%;
        max-height: 220px;
        object-fit: cover;
        display: block;
    }

    /* Card body */
    .card.d-sm-none .card-body {
        font-family: 'Inter', -apple-system, system-ui, sans-serif;
        padding: 0.75rem;
    }
    .card.d-sm-none .card-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 0.35rem !important;
    }
    .card.d-sm-none .card-title a {
        color: #1e293b !important;
        text-decoration: none;
    }
    .card.d-sm-none .card-title a:hover {
        color: #3586BB !important;
    }
    .card.d-sm-none .card-body p {
        font-size: 0.8rem;
        margin-bottom: 0.15rem !important;
        color: #64748b;
        line-height: 1.5;
    }
    .card.d-sm-none .card-body p b {
        color: #94a3b8;
        text-transform: uppercase;
        font-size: 0.66rem;
        letter-spacing: 0.3px;
    }

    /* Card footer: clean button layout */
    .card.d-sm-none .card-footer {
        background: #fafbfc;
        border-top: 1px solid #f1f5f9;
        padding: 0.55rem 0.75rem;
    }
    .card.d-sm-none .card-footer .mm-row-options {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        align-items: center;
        justify-content: flex-start;
    }
    .card.d-sm-none .card-footer .mm-row-options .btn {
        font-size: 0.76rem !important;
        padding: 0.3rem 0.6rem !important;
        border-radius: 6px !important;
        font-family: 'Inter', -apple-system, system-ui, sans-serif;
        font-weight: 600;
    }

    /* No checkbox column on mobile */
    .card.d-sm-none .mm-card-checkbox { display: none; }

    /* Row selection checkbox in footer */
    .card.d-sm-none .row-selection-checkbox {
        margin-top: 0.5rem;
    }
}

/* === Modal improvements === */
.doubleConfirmModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    background: #fff !important;
}
.doubleConfirmModal .modal-dialog {
    max-width: 480px !important;
}
.doubleConfirmModal .modal-body h1 {
    font-size: 1.05rem !important;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-weight: 700;
    color: #1e293b;
}
.doubleConfirmModal .modal-body p,
.doubleConfirmModal .modal-body ol li {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 0.88rem;
    color: #475569;
}

/* === Legacy class overrides === */
.mm-listing-details .winning.key {
    background: #ECFDF5 !important;
    color: #065F46 !important;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}
.mm-listing-details .not-winning.key {
    background: #FEF2F2 !important;
    color: #991B1B !important;
    padding: 0.08rem 0.4rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
}

/* === Hide old structure classes that might conflict === */
.mm-card .col-sm-1,
.mm-card .col-sm-3,
.mm-card .col-sm-8,
.mm-card .col-sm-9,
.mm-card .col-12 {
    max-width: none !important;
    flex: none !important;
    padding: 0 !important;
}

/* === Bid Timeline Modal === */
.bid-timeline-modal .modal-dialog {
    max-width: 720px;
    margin: 2rem auto;
}
.bid-timeline-modal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    overflow: hidden;
}
.bid-timeline-modal .modal-header {
    border-top: 3px solid #3586BB;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    background: #fff;
}
.bid-timeline-modal .modal-title {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1e293b;
}
.bid-timeline-modal .modal-title .btm-listing-id {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 400;
    margin-left: 0.4rem;
}
.bid-timeline-modal .modal-body {
    padding: 1.25rem;
    background: #fff;
}
.bid-timeline-modal .close {
    font-size: 1.4rem;
    color: #94a3b8;
    opacity: 0.7;
}
.bid-timeline-modal .close:hover {
    opacity: 1;
    color: #1e293b;
}

/* Chart container inside modal */
.btm-chart-wrap {
    position: relative;
    height: 320px;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(53,134,187,0.02) 0%, rgba(53,134,187,0.06) 100%);
}

/* Stats bar below chart */
.btm-stats {
    display: flex;
    gap: 0;
    margin-top: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    border-radius: 8px;
}
.btm-stat {
    flex: 1;
    text-align: center;
    border-right: 1px solid #f1f5f9;
}
.btm-stat:last-child {
    border-right: none;
}
.btm-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #3586BB;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}
.btm-stat-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.15rem;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

/* Legend dots */
.btm-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: #64748b;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}
.btm-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.btm-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.btm-legend-dot.start { background: #22c55e; }
.btm-legend-dot.bid { background: #3586BB; }
.btm-legend-dot.end { background: #ef4444; }

/* No data message */
.btm-no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}
.btm-no-data i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}
