/* ==========================================
   Tonpra.com Legacy Stylesheet (Recreated from oldver)
   Vanilla CSS matching the original design
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, button, input, select, textarea {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    text-decoration: none;
}

/* ==========================================
   Header Section
   ========================================== */
.header {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    text-align: center;
    padding: 15px 20px;
    position: relative;
}

.header-title-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-bottom: 5px;
}

.header-title-row h1 {
    font-size: 3rem;
    font-weight: bold;
    margin: 0;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-title-row h1 a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-title-row h1 a:hover {
    color: #e0e0e0;
}

.header-title-row .header-side-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 9px 20px;
    font-size: 1.05rem;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.header-title-row .header-btn-left {
    left: 0;
    background: #ffc107;
    color: #212529;
}

.header-title-row .header-btn-left:hover {
    background: #e0a800;
    color: #212529;
    transform: translateY(-50%) scale(1.02);
}

.header-title-row .header-btn-left.active {
    background: #ffc107;
    color: #212529;
}

.header-title-row .header-btn-right {
    right: 0;
    background: #dc3545;
    color: white;
}

.header-title-row .header-btn-right:hover {
    background: #c82333;
    transform: translateY(-50%) scale(1.02);
}

.header-title-row .header-btn-right.active {
    background: #bd2130;
    color: white;
}

@media (max-width: 768px) {
    .header-title-row {
        flex-direction: column;
        gap: 10px;
        min-height: auto;
    }
    .header-title-row .header-side-btn {
        position: static;
        transform: none;
    }
    .header-title-row h1 {
        font-size: 2.2rem;
    }
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
}

.user-status-bar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 5px 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.user-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-logout-legacy {
    background: #dc3545;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
}

.header-links {
    display: flex;
    gap: 15px;
}

.header-links a {
    color: white;
    text-decoration: none;
}

.header-links a:hover {
    text-decoration: underline;
}

.header-badges {
    display: flex;
    gap: 10px;
}

.badge-btn {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-count {
    background-color: #6c757d;
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* ==========================================
   Navigation Section
   ========================================== */
.nav-section {
    background-color: rgba(193, 193, 193, 0.7);
    padding: 10px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-button {
    background-color: white;
    color: #333;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nav-button.active {
    background: #007bff;
    color: white;
}

.nav-button.btn-primary-legacy.active,
.nav-button.btn-nav-blue.active {
    background: #ffc107 !important;
    color: #212529 !important;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.35) !important;
}

.nav-button.btn-primary-legacy,
.nav-button.btn-success-legacy,
.nav-button.btn-info-legacy,
.nav-button.btn-warning-legacy,
.nav-button.btn-danger-legacy {
    padding: 13px 26px;
    font-size: 1.4rem;
}

.nav-button.btn-primary-legacy,
.nav-button.btn-nav-blue {
    background: #007bff;
    color: white;
}

.nav-button.btn-success-legacy {
    background: #28a745;
    color: white;
}

.nav-button.btn-info-legacy {
    background: #17a2b8;
    color: white;
}

.nav-button.btn-warning-legacy {
    background: #ffc107;
    color: #212529;
}

.nav-button.btn-danger-legacy {
    background: #dc3545;
    color: white;
}

/* Notification Container inside Navbar */
.ship-notify-container {
    position: relative;
    display: inline-block;
}

.ship-notify-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 2px solid #999;
    border-radius: 8px;
    padding: 3px 8px;
    white-space: nowrap;
    color: blue;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none; /* Hidden by default */
}

/* Pop-up อยู่เหนือปุ่มกำลังขาย ตามรูป new_flow_01-10-2026 */
.seller-offer-popup {
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    border: 1px solid #777777;
    border-radius: 2px;
    padding: 3px 10px;
    white-space: nowrap;
    color: #e70000;
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    pointer-events: none;
}
.seller-offer-popup::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 7px 0 7px;
    border-style: solid;
    border-color: #777777 transparent transparent transparent;
}
.seller-offer-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px 6px 0 6px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

/* ==========================================
   Main Content Area
   ========================================== */
.main-content {
    flex: 1;
    padding: 20px 10px;
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    box-sizing: border-box;
}

.content-placeholder {
    width: 95%;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    text-align: left; /* เปลี่ยนให้อ่านง่าย */
}

.main-content .content-placeholder {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 992px) {
    .main-content {
        width: 95%;
        max-width: 95%;
        padding: 15px 5px;
    }
    .content-placeholder {
        width: 95%;
        max-width: 95%;
    }
    .main-content .content-placeholder {
        width: 100%;
        max-width: 100%;
    }
}

.status-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.status-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 13px 26px;
    font-size: 1.4rem;
    margin: 5px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.status-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,123,255,0.3);
}

/* ==========================================
   Product Grid & Card (Exact copy of original layout)
   ========================================== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 1fr;
    gap: 15px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    align-items: stretch;
}

.auction-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid #dee2e6;
}

.auction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.lot-number {
    position: relative;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000; /* ดำทึบตามเวอชันเดิม */
}

.lot-number img {
    min-width: 130px;
    min-height: 130px;
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.lot-label {
    position: absolute;
    top: 10px;
    left: 15px;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: #000;
    z-index: 10;
}

.item-details {
    padding: 15px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.item-title {
    font-size: 1.05rem;
    color: #2b2b2b;
    margin-bottom: 0;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: normal;
}

.item-province {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    margin-bottom: 10px;
}

.price-info {
    background: linear-gradient(135deg, #ff851b, #ffc107); /* ส้มอมทอง */
    color: #fff;
    text-align: center;
    padding: 6px 10px;
    margin: 0 5px 10px 5px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255,133,27,0.2);
}

.time-info {
    background: #ffffff;
    color: #212529;
    text-align: center;
    padding: 8px 10px;
    margin: auto 5px 0 5px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #ced4da;
    margin-top: auto;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.time-info.status-selling {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #ffffff;
    border-color: #f7931e;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.time-info.status-sold {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #ffffff;
    border-color: #20c997;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.time-info.status-expired {
    background-color: #e9ecef;
    color: #495057;
    border-color: #ced4da;
}

.time-info.status-cancelled {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

/* Hover Action Button */
.bid-button {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    width: min(80%, 240px);
    margin: 0 auto;
    display: none; /* ซ่อนไว้รอ hover */
    font-size: 1.1rem; /* ขยายฟอนต์ขึ้น 10% */
    line-height: 1.3;
    font-weight: bold;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 12;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255,107,53,0.4);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.auction-card:hover .bid-button {
    display: block;
}

.bid-button:hover {
    background: linear-gradient(135deg, #ff5722, #ff9800);
    box-shadow: 0 6px 15px rgba(255,87,34,0.5);
    transform: translate(-50%, -55%);
}

/* ==========================================
   Form Styling (New added for transaction mockup)
   ========================================== */
.form-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #357abd;
    margin-bottom: 20px;
    border-bottom: 2px solid #357abd;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: 'Sarabun', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 5px rgba(74,144,226,0.3);
}

.btn-submit {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit:hover {
    background-color: #218838;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

/* ==========================================
   Table & Lists (New added for transaction history)
   ========================================== */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.table-legacy {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: white;
}

.table-legacy th,
.table-legacy td {
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    text-align: left;
    font-size: 0.9rem;
}

.table-legacy th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.table-legacy tr:hover {
    background-color: #f1f3f5;
}

/* Transaction Badges */
.badge-legacy {
    display: inline-block;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 20px;
    color: white;
}

.badge-active { background-color: #007bff; }
.badge-agreed { background-color: #17a2b8; }
.badge-paid { background-color: #ffc107; color: #212529; }
.badge-shipped { background-color: #28a745; }
.badge-canceled { background-color: #dc3545; }
.badge-expired { background-color: #6c757d; }

/* Detail Page specific layout */
.detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.detail-image-box {
    background: #000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    overflow: hidden;
}

.detail-image-box img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.detail-info-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.detail-price-box {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 8px;
}

.detail-price-title {
    font-size: 0.9rem;
    color: #856404;
    font-weight: bold;
}

.detail-price-value {
    font-size: 2rem;
    font-weight: 800;
    color: #df2020;
}

/* ==========================================
   Footer Section
   ========================================== */
.footer {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    text-align: center;
    padding: 25px 20px;
    margin-top: auto;
}

.footer-date {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.footer-time {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* ==========================================
   Pagination Section
   ========================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 10px;
}

.pagination-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #28a745, #20c997);
}

/* ==========================================
   Responsive Grid
   ========================================== */
@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
    .detail-container {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .lot-number {
        height: 180px;
    }
}
@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .user-status-bar {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==========================================
   Social Login Buttons (Copied from oldver)
   ========================================== */
.social-login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}

.social-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-btn:hover {
  opacity: 0.9;
}

.social-btn.facebook {
  background: #3b5998;
}

.social-btn.line {
  background: #00c300;
}

.social-btn.google {
  background: #db4437;
}

.social-btn.email {
  background: #6c757d;
}

/* =====================================================
   Legacy Circle Hover Navigation & Message Popup Styles
   ===================================================== */
.container-wrapperCircle {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.containerCircle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    padding: 6px 14px;
    min-width: 280px;
    max-width: 380px;
    height: 48px;
    background-color: white;
    border: 3px solid #f9e25d;
    border-radius: 25px;
    box-shadow: 0 0 0 1px #4e79a7;
    pointer-events: auto;
}

.hover-zone,
.circle,
.text-area {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-zone {
    display: flex;
    align-items: center;
    margin: 0 12px;
    opacity: 1;
    visibility: visible;
    flex-shrink: 0;
    pointer-events: auto;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 20px;
}

.circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 0;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.teal-color {
    background-color: #20c997; /* Teal เขียวมิ้นต์ สบายตาและเข้ากับคอนเซปต์ */
}

.blue-color {
    background-color: #007bff; /* น้ำเงินชัดเจน */
}

.orange-color {
    background-color: #fd7e14; /* ส้มเด่นชัด */
}

.text-area {
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    font-size: 15px;
    color: #333;
    max-width: 0;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-area a {
    text-decoration: none;
    font-weight: bold;
    color: #212529;
    display: inline-block;
    padding: 6px 8px;
    border-radius: 4px;
}

.text-area a:hover {
    color: #0056b3;
}

.hover-zone:hover {
    flex-grow: 1;
    margin: 0 4px;
}

.hover-zone:hover .text-area {
    opacity: 1;
    visibility: visible;
    max-width: 220px;
    margin-left: 8px;
}

.containerCircle:hover .hover-zone:not(:hover) {
    opacity: 0.15;
    transform: scale(0.85);
    margin: 0 2px;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.popup-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 35px;
    width: 95%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    font-family: 'Sarabun', sans-serif;
    animation: popupFadeIn 0.25s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup-content h4 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.popup-content label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 4px;
    color: #555;
    font-size: 14px;
}

.popup-content input[type="text"],
.popup-content textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.popup-content input[type="text"]:focus,
.popup-content textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.popup-content button[type="button"] {
    margin-top: 18px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    transition: opacity 0.2s;
}

.popup-content button[type="button"]:hover {
    opacity: 0.88;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

#statusMessage {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Sarabun', sans-serif;
}

/* =====================================================
   Legacy Bidding Section Styles (Make Offer / Bidding UI)
   ===================================================== */
.bid-section {
    margin: 30px 0;
    padding: 25px;
    background-color: #f9f9f9;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.bid-label {
    font-size: 24px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.bid-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-minus,
.btn-plus {
    background-color: #666;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    font-size: 36px;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.btn-minus:hover,
.btn-plus:hover {
    background-color: #555;
}

.bid-input {
    flex: 1;
    max-width: 400px;
    height: 60px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 0 15px;
    box-sizing: border-box;
    font-weight: bold;
    color: #28a745;
}

.bid-input:focus {
    outline: none;
    border-color: #007bff;
}

.submit-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.bid-section .btn-submit {
    background-color: #0066ff;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bid-section .btn-submit:hover {
    background-color: #0052cc;
}

.autobid-section {
    position: absolute;
    right: 10px;
    text-align: right;
}

.autobid-title {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-bottom: 3px;
}

.autobid-status {
    font-size: 13px;
    color: #999;
}

.autobid-status.active {
    color: #28a745;
    font-weight: bold;
}

/* =====================================================
   Legacy Thumbnail Gallery & Lightbox Styles
   ===================================================== */
.thumbnail-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thumbnail:hover {
    border-color: #ffd700;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail.active {
    border-color: #ffd700;
    border-width: 3px;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: lightboxFadeIn 0.3s;
}

.lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.lightbox .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100001;
    transition: color 0.2s;
}

.lightbox .close:hover {
    color: #ffd700;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   Step Popup Modal (5 Steps Buying/Selling)
   ========================================== */
.step-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Sarabun', sans-serif;
}

.step-modal-content {
    background: #fdfdfd;
    padding: 25px 30px;
    border-radius: 5px;
    max-width: 550px;
    width: 95%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    max-height: 95vh;
    overflow-y: auto;
}

.step-title {
    background-color: #d4e8c1;
    border: 3px solid #8ba4f9;
    color: #000;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.step-row-container {
    background-color: #e8ebf7;
    border-radius: 20px;
    padding: 20px 10px 15px 10px;
    margin-bottom: 20px;
    position: relative;
}

.step-number {
    position: absolute;
    background-color: #1724d9;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.step-box {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
}

.orange-box {
    background-color: #f7a256;
    color: #000;
}

.blue-box {
    background-color: #1724d9;
    color: #fff;
}

.light-green-box {
    background-color: #9cf69c;
    color: #000;
}

.yellow-green-box {
    background-color: #c9f704;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    width: 100%;
    padding: 15px;
    line-height: 1.4;
}

.step-arrow {
    color: #1724d9;
    font-size: 20px;
    font-weight: bold;
}

.btn-close-modal {
    background-color: #ff0000;
    color: #fff;
    border: none;
    padding: 8px 45px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border-radius: 4px;
}

.btn-close-modal:hover {
    background-color: #d00;
}

/* Sold Banner Overlay (Step 7: ป้ายขายแล้ว) */
.badge-sold-overlay {
    position: absolute;
    top: 15px;
    right: -35px;
    background: #dc3545;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 4px 40px;
    transform: rotate(45deg);
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Expired Banner Overlay (Step 8: ป้ายหมดเวลา) */
.badge-expired-overlay {
    position: absolute;
    top: 15px;
    right: -35px;
    background: #6c757d;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 4px 40px;
    transform: rotate(45deg);
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Step 10: Status Buttons (โอนแล้ว / รอรับพระ) */
.btn-status-paid {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
}

.btn-status-paid:hover {
    background-color: #218838;
}

.btn-status-waiting {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: default;
    box-shadow: 0 2px 4px rgba(220,53,69,0.2);
}

/* Step 11: Seller Status Buttons (ส่งที่ / ส่งแล้ว) */
.btn-status-ship-to {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.btn-status-ship-to:hover {
    background-color: #0056b3;
}

.btn-status-shipped {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
}

.btn-status-shipped:hover {
    background-color: #218838;
}

/* Step 13: Feedback System Buttons & Tabs */
.btn-status-feedback {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
    transition: background-color 0.2s;
}

.btn-status-feedback:hover {
    background-color: #218838;
}

.feedback-tab-btn {
    padding: 8px 18px;
    border: 1px solid #ced4da;
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
}

.feedback-tab-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Step 15.2: Near Expiry Carousel */
.near-expiry-carousel-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto 30px auto;
    display: flex;
    align-items: center;
}

.near-expiry-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 10px 5px;
    width: 100%;
    align-items: stretch;
}

.near-expiry-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.near-expiry-track .auction-card {
    min-width: calc(20% - 12px);
    max-width: calc(20% - 12px);
    flex-shrink: 0;
}

.near-expiry-track .time-info {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #ffffff;
    border-color: #f7931e;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.carousel-arrow-btn {
    background: #007bff;
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    user-select: none;
}

.carousel-arrow-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.carousel-arrow-btn.prev-btn {
    margin-right: 10px;
}

.carousel-arrow-btn.next-btn {
    margin-left: 10px;
}

@media (max-width: 1200px) {
    .near-expiry-track .auction-card {
        min-width: calc(25% - 12px);
        max-width: calc(25% - 12px);
    }
}

@media (max-width: 992px) {
    .near-expiry-track .auction-card {
        min-width: calc(33.333% - 10px);
        max-width: calc(33.333% - 10px);
    }
}

@media (max-width: 768px) {
    .near-expiry-track .auction-card {
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
}

@media (max-width: 480px) {
    .near-expiry-track .auction-card {
        min-width: 80%;
        max-width: 80%;
    }
}

/* Step 15 Status Badges on Cards */
.badge-status-overlay {
    position: absolute;
    top: 10px;
    right: 15px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    z-index: 11;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.badge-status-overlay.badge-sold,
.lot-label.badge-sold {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge-status-overlay.badge-expired,
.lot-label.badge-expired {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.badge-status-overlay.badge-cancelled,
.lot-label.badge-cancelled {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

/* ==========================================
   Full-screen Loading Screen Overlay (Vanilla CSS)
   ========================================== */
#app-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#app-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loading-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid #e9ecef;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: app-spin 0.9s linear infinite;
    margin-bottom: 18px;
}

.app-loading-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.app-loading-subtext {
    font-size: 0.9rem;
    color: #6c757d;
}

@keyframes app-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   Flow Modals (According to Mockups /new_flow & /new_flow_01-10-2026)
   Strictly No Icons - Clean Vanilla CSS
   ========================================== */
.flow-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.flow-modal-box {
    background-color: #ffffff;
    padding: 35px 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    min-width: 320px;
    max-width: 440px;
    width: 90%;
    animation: flowModalFadeIn 0.2s ease-out;
}

@keyframes flowModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.flow-modal-title {
    font-size: 1.6rem;
    font-weight: normal;
    color: #111111;
    margin-top: 0;
    margin-bottom: 25px;
    line-height: 1.45;
}

.flow-modal-content {
    font-size: 1.35rem;
    color: #222222;
    margin-bottom: 25px;
    line-height: 1.5;
}

.flow-modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.flow-btn {
    border: none;
    border-radius: 4px;
    padding: 8px 30px;
    font-size: 1.25rem;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.flow-btn-green {
    background-color: #28a745;
    color: #ffffff;
}

.flow-btn-green:hover {
    background-color: #218838;
}

.flow-btn-red {
    background-color: #dc3545;
    color: #ffffff;
}

.flow-btn-red:hover {
    background-color: #c82333;
}



