/* Bakram Market - Auction Stylesheet */

/* Auction Stats */
.auction-stats {
    background: var(--gradient);
    padding: 30px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.stat-box i {
    font-size: 2.5rem;
    opacity: 0.9;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Auction Filters */
.auction-filters {
    background: var(--surface);
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
}

.filters-bar {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.filter-group .form-control {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100%;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Auction Grid */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Auction Card */
.auction-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
}

.auction-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow);
}

/* Auction Image */
.auction-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.auction-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.auction-card:hover .auction-image img {
    transform: scale(1.05);
}

/* Auction Status */
.auction-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-live {
    background: #D32F2F;
    color: white;
    animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.status-upcoming {
    background: var(--secondary);
    color: white;
}

.status-ended {
    background: var(--text-secondary);
    color: white;
}

/* Auction Actions */
.auction-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
}

/* Auction Info */
.auction-info {
    padding: 20px;
}

.auction-category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--background);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.auction-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.auction-details {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* Auction Timer */
.auction-timer {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--background);
    padding: 12px;
    border-radius: 8px;
}

.timer-block {
    flex: 1;
    text-align: center;
}

.timer-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.timer-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timer-low {
    background: #FFEBEE;
}

.timer-low .timer-value {
    color: #D32F2F;
}

/* Auction Bid Section */
.auction-bid-section {
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.current-bid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bid-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bid-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.bid-input-group {
    display: flex;
    gap: 10px;
}

.bid-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.bid-input:focus {
    outline: none;
    border-color: var(--primary);
}

.min-bid {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Upcoming Auction Card */
.auction-card.upcoming {
    opacity: 0.95;
}

.auction-schedule {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auction-starting-bid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.auction-starting-bid span:first-child {
    color: var(--text-secondary);
}

/* Bid History Modal */
.bid-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.bid-history-modal.active {
    display: flex;
}

.bid-history-content {
    background: var(--surface);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
}

.bid-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bid-history-table {
    width: 100%;
    border-collapse: collapse;
}

.bid-history-table th,
.bid-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.bid-history-table th {
    background: var(--background);
    font-weight: 600;
}

.bid-history-table .highest-bid {
    background: #E8F5E9;
    font-weight: 600;
    color: var(--primary);
}

/* Real-time Bid Updates */
.bid-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--surface);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 40px var(--shadow);
    z-index: 1500;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.bid-notification.show {
    transform: translateX(0);
}

.bid-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bid-notification-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Place Bid Button */
.btn-place-bid {
    position: relative;
}

.btn-place-bid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .auction-grid {
        grid-template-columns: 1fr;
    }
    
    .bid-input-group {
        flex-direction: column;
    }
    
    .auction-stats {
        padding: 20px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-box {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-box i {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
}

/* Empty State */
.auction-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.auction-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--border);
}

/* Loading State */
.auction-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success/Error Messages */
.bid-success {
    background: #E8F5E9;
    color: var(--success);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.bid-error {
    background: #FFEBEE;
    color: var(--error);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #D32F2F;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Live indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #D32F2F;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulseLive 1s infinite;
}