/* ============================================================
   assets/css/auctions.css
   Live-auctions page only.
   ============================================================ */

/* ─── Content wrapper ─────────────────────────────────────── */
.content {
    position: relative;
    overflow: hidden;
    min-height: 420px;   /* enough room, no wasted space */
    flex: 1;
}

/* Auction step: let the grid size to its tallest column
   instead of being clipped by the generic .list-body cap. */
#auctionListBody {
    max-height: none;
    overflow: visible;
}

/* ─── Step containers ─────────────────────────────────────── */
.step-container {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    transform: translateX(0);
    opacity: 0;
}

.step-container.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.step-container.hidden-right {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.step-container.hidden-left {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.step-container.slide-out-left  { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.step-container.slide-in-right  { transform: translateX(0);     opacity: 1; pointer-events: auto; }
.step-container.slide-out-right { transform: translateX(100%);  opacity: 0; pointer-events: none; }
.step-container.slide-in-left   { transform: translateX(0);     opacity: 1; pointer-events: auto; }

/* ─── Debug panel ─────────────────────────────────────────── */
.debug-panel {
    margin-top: 20px;
    border-radius: 14px;
    background: #1e293b;
    border: 1px solid #334155;
    overflow: hidden;
    display: none;
    color: #e2e8f0;
}

.debug-panel.visible { display: block; }

.debug-panel .debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
}

.debug-panel .debug-body {
    padding: 16px 20px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    background: #0f172a;
    color: #e2e8f0;
}

.debug-panel .debug-body .section { margin-bottom: 16px; }

.debug-panel .debug-body .section-title {
    font-weight: 600;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 6px;
    border-bottom: 1px solid #334155;
    padding-bottom: 4px;
}

.debug-panel .debug-body .param-item {
    display: flex;
    gap: 12px;
    padding: 2px 0;
    font-size: 12px;
}

.debug-panel .debug-body .param-key   { color: #60a5fa; min-width: 120px; }
.debug-panel .debug-body .param-value { color: #e2e8f0; word-break: break-all; }

.debug-panel .debug-body .json-pre {
    white-space: pre-wrap;
    word-break: break-all;
    color: #e2e8f0;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.debug-panel .debug-body .empty-message {
    color: #64748b;
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
}

.debug-panel .debug-body::-webkit-scrollbar { width: 5px; }
.debug-panel .debug-body::-webkit-scrollbar-track { background: #1e293b; border-radius: 8px; }
.debug-panel .debug-body::-webkit-scrollbar-thumb { background: #475569; border-radius: 8px; }
.debug-panel .debug-body::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ─── Auction grid ────────────────────────────────────────── */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: #f8fafc;
    overflow-x: auto;
}

.auction-grid .grid-column {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    min-width: 0;
    transition: border-color 0.2s ease;
}

.auction-grid .grid-column.highlight-day {
    border-color: #dc2626;
    border-width: 2px;
}

.auction-grid .grid-column.highlight-day .column-header {
    background: #dc2626;
    color: #ffffff;
    border-bottom-color: #b91c1c;
}

.auction-grid .grid-column.highlight-day .column-header .toggle-icon { color: #ffffff; }

.auction-grid .column-header {
    background: #e2e8f0;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    top: 0;
    z-index: 2;
    cursor: default;
    user-select: none;
}

.auction-grid .column-body {
    padding: 0;
    margin: 8px 0;
    max-height: 520px;   /* was 450 — shows a few more venues */
    overflow-y: auto;
}

.auction-grid .grid-item {
    display: flex;
    align-items: stretch;
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
    background: #fff;
    min-height: 48px;
}

.auction-grid .grid-item:last-child { border-bottom: none; }

.auction-grid .grid-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #3b82f6;
    align-self: center;
}

.auction-grid .grid-item .grid-item-label {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
    gap: 8px;
    min-width: 0;
    padding: 2px 0;
}

.auction-grid .grid-item .item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 2px;
}

.auction-grid .grid-item .item-info .item-name {
    font-weight: 500;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.3;
}

.auction-grid .grid-item .item-info .item-count {
    font-size: 12px;
    color: #475569;
    background: #e9edf2;
    padding: 2px 10px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    display: inline-block;
    align-self: flex-start;
    line-height: 1.4;
}

.auction-grid .grid-item .item-status {
    font-size: 11px;
    color: #475569;
    background: #d1d5db;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: center;
    margin-left: auto;
}

.auction-grid .grid-item .item-status.entry-opened     { background: #bbf7d0; color: #166534; }
.auction-grid .grid-item .item-status.bid-accepting    { background: #fde68a; color: #92400e; }
.auction-grid .grid-item .item-status.auction-closed   { background: #fca5a5; color: #991b1b; }
.auction-grid .grid-item .item-status.auction-started  { background: #93c5fd; color: #1e40af; }
.auction-grid .grid-item .item-status.aa-stock-closed  { background: #e9d5ff; color: #5b21b6; }
.auction-grid .grid-item .item-status.aa-stock-opening { background: #a7f3d0; color: #065f46; }

.auction-grid .empty-column {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    margin: 8px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
    line-height: 1.4;
    min-height: 60px;
}

.auction-grid .column-header .toggle-icon {
    display: none;
    margin-left: 6px;
    font-size: 12px;
    transition: transform 0.25s ease;
}

.auction-grid .column-header .toggle-icon.open { transform: rotate(180deg); }

.auction-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e9edf2;
}

.auction-loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ─── Image skeleton ──────────────────────────────────────── */
.img-skeleton {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1;
    border-radius: inherit;
}

.img-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(200, 200, 200, 0.25), transparent);
    animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(0); }
    100% { transform: translateX(200%); }
}

.preview-wrapper .img-skeleton { border-radius: 4px; background: rgba(0, 0, 0, 0.45); }
.preview-wrapper .img-skeleton::after {
    background: linear-gradient(90deg, transparent, rgba(220, 220, 220, 0.3), transparent);
}

.preview-wrapper img.loaded ~ .img-skeleton { display: none; }

.preview-wrapper { position: relative; background: rgba(0, 0, 0, 0.1); }

@media (max-width: 768px) {
    .auction-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

@media (max-width: 480px) {
    .auction-grid { grid-template-columns: 1fr; gap: 6px; }
    .auction-grid .grid-column { border-radius: 8px; }
    .auction-grid .grid-column.highlight-day { border-color: #dc2626; border-width: 2px; }

    .auction-grid .column-header {
        padding: 12px 14px;
        font-size: 15px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #e2e8f0;
        border-bottom: 1px solid #cbd5e1;
        position: relative;
    }

    .auction-grid .column-header:hover { background: #d1d5db; }
    .auction-grid .column-header .toggle-icon { display: inline-block; }

    .auction-grid .column-body {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        padding: 0;
        margin: 0;
    }

    .auction-grid .grid-column.expanded .column-body {
        max-height: 600px;
        overflow-y: auto;
        padding: 0;
        margin: 8px 0;
    }

    .auction-grid .grid-item { padding: 8px 12px; font-size: 14px; min-height: 50px; }
    .auction-grid .grid-item .item-info .item-name { font-size: 14px; }
    .auction-grid .grid-item .item-info .item-count { font-size: 12px; padding: 2px 10px; }
    .auction-grid .grid-item .item-status { font-size: 11px; padding: 2px 8px; max-width: 80px; }
    .auction-grid .empty-column { padding: 16px 8px; margin: 8px 0; font-size: 13px; min-height: 60px; }
}

/* ─── Car table ───────────────────────────────────────────── */
.car-table-wrap {
    overflow-x: auto;
    margin-top: 0;
}

.car-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 11px;
    min-width: 1300px;
}

.car-table th,
.car-table td {
    border: 1px solid #ddd;
    padding: 4px 3px;
    text-align: center;
    vertical-align: middle;
    color: #1e293b;
    background: #fff;
}

.car-table th {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    border-bottom: 2px solid #cbd5e1;
}

.row-nothing   { background: rgb(184, 184, 192) !important; }
.row-bid       { background: #ffffff !important; }
.row-buy       { background: #d6ffd6 !important; }
.row-buystock  { background: #ffe9ab !important; }
.row-negotiate { background: rgb(108 217 232) !important; }

.row-nothing td,
.row-bid td,
.row-buystock td,
.row-buy td,
.row-negotiate td { background: transparent !important; }

.list-container .list-body .car-table-wrap { overflow: visible; }
.list-container .list-body .car-table-wrap .car-table { min-width: 1300px; width: 100%; border-collapse: collapse; }
.list-container .list-body .car-table-wrap .car-table th,
.list-container .list-body .car-table-wrap .car-table td { background: #fff; }
.list-container .list-body .car-table-wrap .car-table th {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.action-link.bid,
.action-link.buy,
.action-link.negotiate {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 60px !important;
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.2s ease !important;
    letter-spacing: 0.2px;
    text-align: center;
    min-width: 100px;
}

.action-link.bid       { background: linear-gradient(135deg, #00b4d8, #0077b6) !important; }
.action-link.buy       { background: linear-gradient(135deg, #e63946, #c1121f) !important; }
.action-link.negotiate { background: linear-gradient(135deg, #c5d800, #b69000) !important; }

.action-link.bid:hover,
.action-link.buy:hover,
.action-link.negotiate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;
}

.action-link-container { margin: 0; padding: 0; }

.action-popup-message {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.45;
    border-radius: 10px;
    display: none;
    word-break: break-word;
}

.action-popup-message.visible {
    display: block;
    padding: 10px 12px;
    white-space: pre-line;
}

.action-popup-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.action-popup-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.car-table .action-popup-message.visible.success { font-size: 11px; }

.preview-wrapper {
    position: relative;
    display: inline-block;
    width: 104px;
    height: 78px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
}

.preview-wrapper .preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 1px solid #ddd;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 2;
}

.preview-wrapper .preview-img.loaded { opacity: 1; }

.preview-wrapper .preview-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.preview-wrapper:hover .preview-overlay { opacity: 1; }

.viewall-link {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 10px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #bae6fd;
    transition: background 0.2s, border-color 0.2s;
}

.viewall-link:hover { background: #bae6fd; border-color: #7dd3fc; }

.price-cell { white-space: nowrap; font-size: 10px; }

.car-table .image-list::-webkit-scrollbar,
.auction-grid .column-body::-webkit-scrollbar { width: 4px; height: 4px; }

.car-table .image-list::-webkit-scrollbar-track,
.auction-grid .column-body::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 8px; }

.car-table .image-list::-webkit-scrollbar-thumb,
.auction-grid .column-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

.car-table .image-list::-webkit-scrollbar-thumb:hover,
.auction-grid .column-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }