/* --- Final Correct CSS --- */

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Added to make the main content area narrower and more centered */
.container {
    max-width: 960px;
}

/* Header Styles */
.site-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    max-height: 50px;
}
.main-nav a {
    margin-left: 20px;
    font-weight: 500;
    color: #343a40;
    text-decoration: none;
}
.main-nav a:hover {
    color: #c0392b;
}

/* Page Titles */
/* Added to center the main "Upcoming Auctions" title */
.page-title-section {
    text-align: center;
    margin-bottom: 40px;
}

.event-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}
.event-title {
    font-weight: 700; /* Made the event title bold */
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
    display: inline-block;
}
.event-details {
    color: #6c757d;
    margin-bottom: 25px;
}

/* Vehicle Card Styles */
.vehicle-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #343a40;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px; /* Added margin to create a gap between rows */
}
.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #343a40;
}

.vehicle-card .vehicle-img-container {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background-color: #fff;
    cursor: zoom-in; /* Indicates the image is clickable for zooming */
}
.vehicle-card .vehicle-img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Changed back to 'cover' to fill the area */
}
.vehicle-card .lot-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.vehicle-card .vehicle-info {
    padding: 20px;
}

.vehicle-card .vehicle-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.7rem; /* Reduced for better balance in smaller layout */
    text-align: center;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-card .vehicle-price {
    font-size: 1.5rem; /* Reduced for better balance */
    font-weight: bold;
    color: #c0392b;
    text-align: center;
    margin-bottom: 1rem;
}

.vehicle-card .vehicle-meta-grid {
    font-size: 1rem; /* Reduced for better balance */
    color: #6c757d;
}

/* --- Image Zoom Modal Styles --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
    /* Use Flexbox to center the image */
    justify-content: center;
    align-items: center;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;   /* Made smaller */
    max-height: 80vh; /* Made smaller */
    animation-name: zoom;
    animation-duration: 0.4s;
}

@keyframes zoom {
    from {transform: scale(0.5)}
    to {transform: scale(1)}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
}

/* =============================================== */
/* === KOD BARU UNTUK DITAMBAH DI BAWAH FAIL === */
/* =============================================== */

/* Betulkan Isu Lapisan Modal (Skrin Hitam) */
.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1050 !important;
}
/* Gaya untuk Modal Zoom Gambar */
.image-zoom-modal {
  display: none; 
  position: fixed; 
  z-index: 1060; /* Pastikan ia di atas SEMUA elemen lain, termasuk modal bidaan */
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
}

.image-zoom-modal .modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 800px;
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

.image-zoom-modal .close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.image-zoom-modal .close-modal:hover,
.image-zoom-modal .close-modal:focus {
  color: #bbb;
  text-decoration: none;
}
/* Gaya untuk Bar Penapis Mendatar */
.filter-bar {
    background-color: #ffffff;
    padding: 20px;
    border: 1px solid #e3e3e3;
    border-radius: 5px;
    margin-bottom: 40px; /* DIUBAHSUAI: Jarak ditambah di sini */
}

.filter-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-bar .item-count {
    font-size: 18px; /* DIUBAHSUAI: Saiz teks dibesarkan */
    font-weight: bold;
    color: #2c3e50; /* DIUBAHSUAI: Warna ditukar kepada biru gelap */
}

/* Kod lain untuk .filter-bar kekal sama */
.filter-bar .filter-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #e53935;
}

.filter-bar .form-inline .form-group {
    margin-right: 15px;
    margin-bottom: 10px;
}

.filter-bar .form-inline .form-control {
    min-width: 160px;
}

.filter-bar .form-inline .btn {
     margin-left: 10px;
     margin-top: 5px;
}
#countdown-modal-content {
    background-color: #f4f4f4;
    border-radius: 8px;
    padding: 10px;
}

#countdown-modal-content .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#countdown-modal-content .modal-title {
    font-weight: bold;
    color: #555;
}

#countdown-modal-content #countdown-event-name {
    font-weight: 700;
    color: #e53935; /* Warna merah */
    margin-top: 0;
    margin-bottom: 10px;
}

#countdown-timer {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.timer-box {
    font-size: 40px;
    font-weight: bold;
    color: #fff;
    background-color: #333;
    padding: 15px;
    border-radius: 5px;
    min-width: 70px;
}

.timer-labels {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
}

.timer-labels span {
    font-size: 12px;
    color: #555;
    width: 70px;
    padding-left: 15px; /* Selaraskan dengan kotak */
    padding-right: 15px;
}

.timer-live {
    font-size: 30px;
    font-weight: bold;
    color: #27ae60; /* Warna hijau */
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* =============================================== */
/* === KOD BARU UNTUK DITAMBAH DI BAWAH FAIL === */
/* =============================================== */

/* Gaya untuk Harga pada Kad Kenderaan */
.vehicle-price {
    font-weight: bold;
    font-size: 17px;
    line-height: 1.3;
}
.reserve-price {
    color: #333;
    margin-bottom: 2px;
}
.highest-bid {
    color: #27ae60; /* Warna Hijau */
    margin-bottom: 10px;
}
.reserve-price span, .highest-bid span {
    font-weight: bold;
}
.highest-bid span {
    color: red;
}
p.vehicle-price.text-center.reserve-price > span {
    color: red;
}

/* Gaya untuk Mesej Ralat dalam Modal Bidaan */
#biddingModal .modal-error {
    color: #e74c3c; /* Warna Merah Ralat */
    font-weight: bold;
    margin-top: 10px;
    display: none; /* Sembunyi secara lalai */
}
.vehicle-grid {
  display: flex;
  flex-wrap: wrap;
}

.vehicle-grid > [class*='col-'] {
  display: flex;
  flex-direction: column;
}

.vehicle-card {
  height: 100%; /* Memastikan kad mengisi ketinggian penuh lajur */
  display: flex;
  flex-direction: column;
}

.vehicle-card .vehicle-info {
  flex-grow: 1; /* Memaksa bahagian info untuk memanjang */
}

.vehicle-card .social-share {
  margin-top: auto; /* Menolak pautan "Share" ke bahagian paling bawah kad */
}