/* =========================================================
   LelangKu — Custom CSS (extends Bootstrap 5)
   Breakpoints: xs <576 | sm 576 | md 768 | lg 992 | xl 1200
   ========================================================= */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --navy:       #1e3a5f;
    --navy-dark:  #152a44;
    --blue:       #2563eb;
    --blue-soft:  #e7f1ff;
    --sidebar-w:  260px;
    --topbar-h:   56px;
}

/* ── Base ──────────────────────────────────────────────── */
html  { scroll-behavior: smooth; }
body  { font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif; }
img   { max-width: 100%; }

/* ── Navbar (public) ───────────────────────────────────── */
.navbar-lelangku { background-color: var(--navy) !important; }
.navbar-lelangku .nav-link                   { color: #e2e8f0; padding: .5rem .75rem; }
.navbar-lelangku .nav-link:hover,
.navbar-lelangku .nav-link.active            { color: #fff; }
/* Brand always white & legible */
.navbar-lelangku .navbar-brand               { color: #fff !important; font-size: 1.1rem; }
/* Hamburger button — clearly visible on dark background */
.navbar-lelangku .navbar-toggler {
    border-color: rgba(255,255,255,.5) !important;
    padding: .35rem .55rem;
}
.navbar-lelangku .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2c255%2c255%2c1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
/* Collapsed mobile menu */
@media (max-width: 991.98px) {
    .navbar-lelangku .navbar-collapse {
        background-color: var(--navy-dark);
        padding: .5rem 0 .75rem;
        border-top: 1px solid rgba(255,255,255,.1);
        margin: 0 -0.75rem; /* extend to container edges */
        padding-left: .75rem;
        padding-right: .75rem;
    }
    .navbar-lelangku .navbar-nav .nav-link {
        padding: .65rem .75rem;
        border-radius: .375rem;
    }
    .navbar-lelangku .navbar-nav .nav-link:hover {
        background: rgba(255,255,255,.08);
    }
    /* buttons inside collapsed menu */
    .navbar-lelangku .navbar-nav li.nav-item > .btn,
    .navbar-lelangku .navbar-nav li > a.btn {
        display: block;
        margin: .35rem 0;
        text-align: center;
    }
}
.top-25 { top: 18%; }

/* Notification badge positioning fix on mobile */
.nav-link .badge { font-size: .6rem; }

/* ── Sidebar (admin & participant) ─────────────────────── */
.sidebar {
    background-color: var(--navy);
    width: var(--sidebar-w);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1050;
    flex-shrink: 0;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-participant { width: 240px; }
.sidebar-brand   { background-color: var(--navy-dark); }
.sidebar-section { letter-spacing: .08em; font-size: .68rem; font-weight: 700; }
.sidebar .nav-link {
    color: #cbd5e1;
    padding: .55rem .9rem;
    border-radius: .4rem;
    font-size: .9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.10); }
.sidebar .nav-link.active { color: #fff; background: var(--blue); }
.sidebar .nav-link i { width: 1.25rem; text-align: center; }
.sidebar-footer  { background-color: var(--navy-dark); }

/* Main content offset (desktop) */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; }
.sidebar-participant ~ .main-content { margin-left: 240px; }

/* ─ Overlay backdrop for mobile sidebar ─ */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1049;
}
.sidebar-backdrop.show { display: block; }

/* ─ Mobile: sidebar hidden off-screen ─ */
@media (max-width: 991.98px) {
    .sidebar,
    .sidebar-participant {
        transform: translateX(-110%);
    }
    .sidebar.show,
    .sidebar-participant.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.35);
    }
    .main-content,
    .sidebar-participant ~ .main-content {
        margin-left: 0 !important;
    }
}

/* Topbar */
.topbar { min-height: var(--topbar-h); }

/* ── Hero (public home) ─────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    min-height: 56vh;
    display: flex;
    align-items: center;
    color: #fff;
}
@media (max-width: 575.98px) {
    .hero-section         { min-height: auto; padding: 3rem 0 2.5rem; }
    .hero-section h1      { font-size: 1.75rem; }
    .hero-section .lead   { font-size: .95rem; }
    .hero-section .btn-lg { padding: .6rem 1.2rem; font-size: .95rem; }
}

/* ── Auction cards ──────────────────────────────────────── */
.auction-card {
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
    height: 100%;
}
.auction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .6rem 1.6rem rgba(0,0,0,.12) !important;
}
/* Smaller image height on mobile */
.auction-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: #f1f5f9;
}
.auction-card-thumb {
    height: 200px;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 3rem;
}
@media (max-width: 575.98px) {
    .auction-card .card-img-top,
    .auction-card-thumb { height: 160px; }
}
.auction-price { font-size: 1.15rem; font-weight: 700; color: #198754; }

/* ── Category icon grid ─────────────────────────────────── */
.category-icon-card {
    transition: transform .15s ease, background .15s ease;
    text-align: center;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: .75rem;
    padding: 1.25rem .5rem;
    text-decoration: none;
    color: #334155;
    height: 100%;
    display: block;
}
.category-icon-card:hover {
    transform: translateY(-4px);
    background: var(--blue-soft);
    color: var(--blue);
    border-color: var(--blue-soft);
}
.category-icon-card i { font-size: 2.4rem; color: var(--blue); }
.category-icon-card .cat-name {
    font-weight: 600; margin-top: .5rem;
    display: block; font-size: .85rem;
}
@media (max-width: 575.98px) {
    .category-icon-card    { padding: .9rem .3rem; }
    .category-icon-card i  { font-size: 1.8rem; }
    .category-icon-card .cat-name { font-size: .75rem; }
}

/* ── Auction room ───────────────────────────────────────── */
.countdown-display {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.countdown-display.expired { color: #6c757d; }
.current-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #198754;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 767.98px) {
    .countdown-display { font-size: 1.5rem; }
    .current-price     { font-size: 1.6rem; }
}
/* bid-form-card: not sticky so it doesn't obscure content on scroll */
.bid-form-card { position: static; }

/* Bid history table compact on small screens */
.bid-history-table { font-size: .85rem; }
.bid-history-table th,
.bid-history-table td { padding: .35rem .4rem; vertical-align: middle; }

/* ── Detail page carousel ───────────────────────────────── */
.detail-carousel img           { height: 420px; object-fit: cover; }
.detail-carousel .carousel-placeholder {
    height: 420px;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 4rem;
}
@media (max-width: 767.98px) {
    .detail-carousel img,
    .detail-carousel .carousel-placeholder { height: 250px; }
}
@media (max-width: 575.98px) {
    .detail-carousel img,
    .detail-carousel .carousel-placeholder { height: 200px; }
}

/* ── Avatar ─────────────────────────────────────────────── */
.avatar-lg { width: 120px; height: 120px; object-fit: cover; }
@media (max-width: 575.98px) { .avatar-lg { width: 80px; height: 80px; } }

/* ── Stat cards ─────────────────────────────────────────── */
.stat-card { border: none; border-radius: .9rem; }
.stat-card .stat-icon {
    width: 56px; height: 56px; border-radius: .75rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
@media (max-width: 575.98px) {
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .stat-card .fs-3      { font-size: 1.4rem !important; }
}

/* ── Tables — horizontal scroll on mobile ───────────────── */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    white-space: nowrap;
}
.table-actions { white-space: nowrap; }

/* Hide less-important columns on small screens */
@media (max-width: 767.98px) {
    .table .d-none-mobile { display: none !important; }
    .table td, .table th  { font-size: .82rem; padding: .4rem .5rem; }
}

/* ── Forms ──────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .form-control, .form-select { font-size: .9rem; }
    .btn-lg { font-size: .95rem; padding: .55rem 1rem; }
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty-state i { font-size: 4rem; }
@media (max-width: 575.98px) {
    .empty-state        { padding: 2rem .5rem; }
    .empty-state i      { font-size: 2.5rem; }
    .empty-state h4     { font-size: 1.1rem; }
}

/* ── Pagination — touch-friendly ────────────────────────── */
@media (max-width: 575.98px) {
    .pagination .page-link {
        padding: .45rem .65rem;
        font-size: .82rem;
        min-width: 36px;
        text-align: center;
    }
}

/* ── Badges & pills ─────────────────────────────────────── */
.badge { font-size: .7rem; }
@media (max-width: 575.98px) { .badge { font-size: .65rem; } }

/* ── Admin / Participant sidebar overlay on mobile ──────── */
/* Hamburger toggle button (visible only on mobile) */
.sidebar-toggle {
    display: none;
    background: none; border: none;
    color: var(--navy); font-size: 1.4rem;
    padding: .25rem .5rem; cursor: pointer;
    line-height: 1;
}
@media (max-width: 991.98px) { .sidebar-toggle { display: inline-flex; align-items: center; } }

/* ── Main content padding adjustment on mobile ──────────── */
@media (max-width: 575.98px) {
    .main-content > main,
    .main-content .p-3,
    .main-content .p-md-4 { padding: .75rem !important; }
}

/* ── Card responsive tweaks ─────────────────────────────── */
@media (max-width: 575.98px) {
    .card-body { padding: .9rem; }
    .card-body .h5, .card-body h5 { font-size: 1rem; }
    .card-header { padding: .65rem .9rem; }
}

/* ── Public "Beranda" stats strip ───────────────────────── */
@media (max-width: 575.98px) {
    .stats-strip .fw-bold { font-size: 1.4rem !important; }
    .stats-strip .small   { font-size: .72rem; }
}

/* ── Participant/Admin panels on mobile ─────────────────── */
@media (max-width: 575.98px) {
    /* Stack action buttons vertically */
    .table-actions .btn + .btn { margin-top: .2rem; }
    /* Topbar title trim */
    .topbar h1.h5 { font-size: .95rem; max-width: calc(100vw - 160px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── Input formatting ───────────────────────────────────── */
input[data-rupiah], .bid-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

/* ── Utility helpers ─────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-navy      { color: var(--navy) !important; }
.bg-navy        { background-color: var(--navy) !important; }
.bg-navy-dark   { background-color: var(--navy-dark) !important; }
.fw-mega        { font-weight: 800; }
.fs-tiny        { font-size: .72rem; }

/* ── Scrollbar (webkit) ─────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
