/* R1 (navbar fixed) + R3 (no scrollbar shift) */
html {
    scrollbar-gutter: stable;
}

/* R5: page owns its base look + layout (were inherited from dashboard.css) */
body {
    background-color: #f4f7fc;
    background-image: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)), url("../../dashboard/img/dashboard.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #333;
    overflow-x: clip;
}

.completed-auction-page {
    font-family: 'Poppins', sans-serif;
}
.completed-auction-container {
    display: flex;
    max-width: 1800px;
    margin: 40px auto;
    padding: 0 40px;
    gap: 50px;
}
.completed-auction-main {
    flex-grow: 1;
}
@media (max-width: 900px) {
    .completed-auction-container { flex-direction: column; }
}
@media (max-width: 600px) {
    .completed-auction-container { padding: 0 16px; margin: 20px auto; }
}

/* ============================================================
   COMPLETED AUCTION CSS
   ============================================================ */

.completed-auction-page {
    padding-bottom: 60px;
}

.completed-auction-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.completed-auction-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    color: #0f172a;
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
}

[data-theme="dark"] .page-title {
    color: #f8fafc;
}

.page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.completed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(100, 116, 139, 0.25);
    white-space: nowrap;
}

[data-theme="dark"] .completed-indicator {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.3);
}

.page-subtitle {
    color: var(--color-text-muted, #64748b);
    font-size: 14px;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface, #ffffff);
    color: var(--color-text, #1e293b);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: var(--color-surface-hover, #f8fafc);
    border-color: #0088ea;
    color: #0088ea;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-input-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #e2e8f0);
    background: var(--color-bg, #f8fafc);
    color: var(--color-text, #1e293b);
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #0088ea;
    background: var(--color-surface, #ffffff);
}

.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 22px;
}

/* ============================================================
   AUCTION CARD STYLES
   ============================================================ */
.auction-card {
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 136, 234, 0.12) 0%, transparent 60%),
        repeating-linear-gradient(to right,
            rgba(59, 130, 246, 0.01) 0px,
            rgba(59, 130, 246, 0.01) 35px,
            rgba(59, 130, 246, 0.03) 35px,
            rgba(59, 130, 246, 0.03) 70px), #ffffff;
    border: 1px solid rgba(0, 136, 234, 0.16);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.05), 0 10px 24px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    min-height: 230px;
}

.auction-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.16), 0 12px 30px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 136, 234, 0.45);
}

/* Background SVG Art */
.ac-bg-art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ac-bg-art svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-sonar-group {
    animation: pa-opacity-pulse 5s ease-in-out infinite;
}

@keyframes pa-opacity-pulse {

    0%,
    100% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }
}

/* ── Card Header ── */
.ac-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px 14px 22px;
    position: relative;
    z-index: 1;
}

/* Bright Blue Accent Bar (Matching Image 1) */
.ac-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22px;
    height: 26px;
    width: 4px;
    background-color: #0088ea;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(0, 136, 234, 0.55);
}

.ac-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f8fafc;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.ac-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0088ea, #0ea5e9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.ac-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.ac-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ac-name {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-badge.completed {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.ac-date-time {
    font-size: 12.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.ac-date-time span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Inner Details Grid ── */
.ac-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    font-size: 13px;
    color: #1e293b;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 0 20px 16px 20px;
    padding: 14px 16px;
    position: relative;
    z-index: 1;
}

.ac-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ac-label {
    color: #64748b;
    font-weight: 500;
}

.ac-value {
    font-weight: 700;
    color: #0f172a;
}

.ac-value.highlight {
    color: #0088ea;
}

/* ── Footer ── */
.ac-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: auto;
    background: rgba(248, 250, 252, 0.5);
    position: relative;
    z-index: 1;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    background: #0088ea;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 136, 234, 0.25);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-card-action .btn-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 16px;
    line-height: 1;
}

.btn-card-action:hover {
    background: #0070c0;
    box-shadow: 0 4px 14px rgba(0, 136, 234, 0.45);
}

.btn-card-action:hover .btn-arrow {
    transform: translateX(3px);
}

/* ── Dark Mode ── */
[data-theme="dark"] .page-title {
    color: #f8fafc;
}

[data-theme="dark"] .page-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .btn-refresh {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

[data-theme="dark"] .btn-refresh:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #0088ea;
    color: #60a5fa;
}

[data-theme="dark"] .auction-card {
    background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.92) 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 6px 18px rgba(0, 0, 0, 0.35),
        0 18px 36px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .auction-card:hover {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 10px 28px rgba(59, 130, 246, 0.18),
        0 20px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .ac-name,
[data-theme="dark"] .ac-value {
    color: #f8fafc;
}

[data-theme="dark"] .ac-value.highlight {
    color: #60a5fa;
}

[data-theme="dark"] .ac-details {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.65) 100%);
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #e2e8f0;
}

[data-theme="dark"] .ac-label {
    color: #94a3b8;
}

[data-theme="dark"] .status-badge.completed {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .ac-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .filter-bar {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .search-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

/* ── Empty State ── */
.empty-state-box {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-surface, #ffffff);
    border: 1px dashed var(--color-border, #e2e8f0);
    border-radius: 16px;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

[data-theme="dark"] .empty-state-box {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 136, 234, 0.1);
    color: #0088ea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

[data-theme="dark"] .empty-state-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text, #0f172a);
    margin: 0;
}

[data-theme="dark"] .empty-state-title {
    color: #f8fafc;
}

.empty-state-desc {
    font-size: 14px;
    color: #64748b;
    max-width: 400px;
    margin: 0;
}

[data-theme="dark"] .empty-state-desc {
    color: #94a3b8;
}

/* ── Mobile Responsiveness ── */
@media (max-width: 768px) {
    .completed-auction-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-title {
        font-size: 26px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn-refresh {
        width: 100%;
        justify-content: center;
    }

    .filter-bar {
        padding: 10px 14px;
        border-radius: 12px;
    }

    .search-input-wrap {
        min-width: 0;
        width: 100%;
    }

    .auction-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .completed-auction-page {
        padding-bottom: 60px;
    }

    .page-title {
        font-size: 23px;
    }

    .completed-indicator {
        font-size: 11px;
        padding: 3px 8px;
    }

    .page-subtitle {
        font-size: 13px;
    }

    .auction-card {
        border-radius: 16px;
    }

    .ac-header {
        padding: 16px 16px 12px 16px;
        gap: 12px;
    }

    .ac-avatar,
    .ac-avatar-placeholder {
        width: 44px;
        height: 44px;
        font-size: 17px;
        border-radius: 10px;
    }

    .ac-name {
        font-size: 15.5px;
    }

    .ac-date-time {
        font-size: 12px;
        gap: 8px;
    }

    .ac-details {
        margin: 0 16px 14px 16px;
        padding: 12px 14px;
        font-size: 12.5px;
        gap: 8px 12px;
    }

    .ac-footer {
        padding: 12px 16px;
        gap: 8px;
    }

    .btn-card-action {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 12.5px;
    }

    .empty-state-box {
        padding: 40px 16px;
        border-radius: 16px;
    }

    .empty-state-icon {
        width: 52px;
        height: 52px;
    }

    .empty-state-title {
        font-size: 16px;
    }

    .empty-state-desc {
        font-size: 13px;
    }
}
/* ── DARK THEME: page background (was light #f4f7fc with a white veil) ── */
[data-theme="dark"] body {
    background-color: var(--color-bg);
    background-image: linear-gradient(rgba(5, 8, 17, 0.72), rgba(5, 8, 17, 0.88)), url("../../dashboard/img/dashboard.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--color-text);
}
