/**
 * Homepage Styles
 */

/* Category Tree Styles */
.category-tree {
    margin-bottom: 20px;
}

.category-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.category-toggle {
    cursor: pointer;
    width: 20px;
    display: inline-block;
    text-align: center;
    margin-right: 5px;
}

.category-toggle-placeholder {
    width: 20px;
    display: inline-block;
    margin-right: 5px;
}

.category-checkbox {
    margin-bottom: 0;
    flex-grow: 1;
}

.category-children {
    margin-left: 25px; /* Increased indentation */
    padding-left: 5px;
    border-left: 1px solid #eee; /* Add a subtle line to show hierarchy */
}

.category-children.hide {
    display: none;
}

.category-children.show {
    display: block;
}

/* Auction Information Header */
.sidebar {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

.auction-info-header {
    background-color: var(--bs-dark);
    color: #ffffff;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.auction-info-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

/* Random Lot Preview Styles */
.random-lot-preview {
    margin-bottom: 5px;
    padding: 0 10px;
}

.random-lot-preview img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.random-lot-preview .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
    font-weight: 600;
}

.random-lot-preview small {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-block;
    color: #333333;
}

/* Featured Lot Preview Styles */
.featured-lot-preview {
    margin-bottom: 5px;
    padding: 0 10px;
}

.featured-lot-preview img {
    width: 200px;
    height: 150px;
    object-fit: contain;
    border-radius: 5px;
    background-color: #f8f9fa;
    margin: 0 auto;
    display: block;
}

/* Tab Styles */
#sidebarTabs .nav-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

#sidebarTabsContent {
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 5px 5px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #333333;
}

/* For upcoming auctions without countdown timer */
.top-position {
    top: 10px !important;
}

/* Critical fix for outbid status - with !important to ensure it's applied immediately */
.current-bid[data-outbid="true"] {
    color: #dc3545 !important; /* Red color for outbid */
    font-weight: bold !important;
}

/* Ensure the outbid class is always applied when data-outbid is true */
.current-bid[data-outbid="true"]:not(.outbid) {
    color: #dc3545 !important;
    font-weight: bold !important;
}

/* Additional styles to ensure outbid and winning status is displayed correctly */
.current-bid.outbid,
.current-bid[data-outbid="true"] {
    color: #dc3545 !important; /* Red color for outbid */
    font-weight: bold !important;
}

.current-bid.winning,
.current-bid[data-winning="true"] {
    color: #28a745 !important; /* Green color for winning bids */
    font-weight: bold !important;
}

/* Immediate styling for bid status - applied as early as possible */
[data-outbid="true"] {
    color: #dc3545 !important; /* Red color for outbid */
    font-weight: bold !important;
}

[data-winning="true"] {
    color: #28a745 !important; /* Green color for winning bids */
    font-weight: bold !important;
}

/* Ensure outbid notifications have black text */
.auction-notification.outbid,
.auction-notification.outbid .auction-notification-title,
.auction-notification.outbid .auction-notification-message {
    color: black !important;
}

/* Ensure winning notifications have black text */
.auction-notification.winning,
.auction-notification.winning .auction-notification-title,
.auction-notification.winning .auction-notification-message {
    color: black !important;
}

/* Prevent green notifications from showing when outbid notifications are present */
.auction-notification.outbid ~ .auction-notification.bid,
.auction-notification.outbid ~ .auction-notification.highBid,
.auction-notification.outbid ~ .auction-notification.winning,
.auction-notification.bid.outbid,
.auction-notification.highBid.outbid,
.auction-notification.winning.outbid {
    display: none !important;
}

/* Hide bid notifications when outbid notifications exist anywhere in the container */
#notification-container:has(.auction-notification.outbid) .auction-notification.bid,
#notification-container:has(.auction-notification.outbid) .auction-notification.highBid,
#notification-container:has(.auction-notification.outbid) .auction-notification.winning {
    display: none !important;
}

/* Pulsing animation for refresh indicator */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

#refresh-indicator.active {
    visibility: visible !important;
    animation: pulse 0.8s infinite;
}

#refresh-indicator.error {
    background-color: #dc3545 !important;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.9) !important;
    visibility: visible !important;
    animation: pulse 0.8s infinite;
}

/* Base styles for highlight - specific animations are created dynamically */

/* Ensure text colors remain visible during highlight */
.current-bid.highlight.outbid,
.current-bid[class*="highlight-"].outbid {
    color: #dc3545 !important;
}

.current-bid.highlight.winning,
.current-bid[class*="highlight-"].winning {
    color: #28a745 !important;
}

/* Debug styles to make it obvious when highlighting is active */
.debug-highlight {
    outline: 2px solid red !important;
}

/* Container for max bid area */
.max-bid-container {
    margin-bottom: 2px !important;
    min-height: 1.2em;
}

/* Style for user's max bid display (full width pale yellow box) */
.user-max-bid {
    font-size: 0.75em; /* Reduced to 0.75em */
    color: #000000; /* Changed to black */
    font-weight: normal; /* Changed from bold to normal */
    background-color: #fffbf0; /* Very pale yellow */
    padding: 4px 8px;
    text-align: center;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

/* Spacer for when no max bid exists */
.max-bid-spacer {
    min-height: 1.2em;
}

/* Center the winning and outbid badges without breaking layout */
.current-bid {
    text-align: center;
}

/* Add space between lot image and first line of text */
.auction-info {
    padding-top: 30px;
}

/* Modified 2024-07-01: Style for bid count (now inline with badge) */
.bid-count {
    font-size: 0.85em;
    color: #6c757d !important; /* Added !important to override any inherited colors */
    white-space: nowrap;
}

/* Added 2024-07-01: Ensure bid count has consistent color even when parent has outbid class */
.outbid .bid-count,
.current-bid.outbid .bid-count,
div.outbid .bid-count,
[data-outbid="true"] .bid-count,
.current-bid[data-outbid="true"] .bid-count {
    color: #6c757d !important;
}

/* Added 2024-07-01: Override any text color inheritance for bid count */
.bid-count,
.bid-count * {
    color: #6c757d !important;
    text-shadow: none !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Added 2024-07-12: Ensure bid count stays visible */
.bid-count-visible,
.bid-count-visible * {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #6c757d !important;
}

