/**
 * Auction System CSS - Styles for bidding interface
 */

/* Auction item containers */
.auction-item-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

/* Removed overlay for auction items - no dark background */
.auction-item-container .info-superposee {
    display: none; /* Hide the overlay completely for auction items */
}

/* Auction item description at bottom */
.auction-item-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px;
    font-size: 12px;
    text-align: center;
    z-index: 5;
}

/* Lightbox auction preview styles */
.auction-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auction-preview-container img,
.auction-preview-container video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Specific width for auction images */
img[alt="Contenu en enchères"] {
    width: 245px !important;
    height: auto !important;
}

.auction-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    margin-top: 20px;
}

.auction-preview-panel .auction-bid-button-lightbox {
    background: linear-gradient(45deg, #e50043, #ff1744);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
	text-align: center;
}

.auction-preview-panel .auction-bid-button-lightbox:hover {
    background: linear-gradient(45deg, #ff1744, #e50043);
    transform: translateY(-2px);
}

.auction-preview-panel .auction-countdown {
    color: #ffeb3b;
    font-weight: 600;
    text-align: center;
}

.auction-preview-panel .item-description {
    color: #ffffff;
    text-align: center;
    line-height: 1.4;
}

.auction-ended {
    color: #aaa;
    font-style: italic;
    text-align: center;
}

/* Auction badges */
.auction-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: linear-gradient(45deg, #e50043, #ff6b6b) !important;
    color: white !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    border-radius: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    z-index: 10 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* Auction countdown */
.auction-countdown {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.countdown-text {
    display: inline-block;
    background: rgba(255, 235, 59, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 235, 59, 0.5);
}

/* Auction buttons */
.auction-bid-button {
    background: linear-gradient(45deg, #e50043, #ff1744) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 120px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 4px rgba(229, 0, 67, 0.3) !important;
}

.auction-bid-button:hover {
    background: linear-gradient(45deg, #ff1744, #e50043) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(229, 0, 67, 0.4) !important;
}

.auction-bid-button:active {
    transform: translateY(0) !important;
}

.auction-history-button {
    background: transparent !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.5) !important;
    padding: 4px 12px !important;
    border-radius: 15px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.auction-history-button:hover {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.8) !important;
}

/* Modal styles */
.auction-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.auction-modal.show {
    opacity: 1 !important;
}

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

.auction-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auction-modal-content {
    position: relative;
    background: linear-gradient(145deg, #2c2c2c, #1f1f1f);
    color: #f1f1f1;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.9);
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.auction-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.auction-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auction-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.auction-modal-close:hover {
    background: rgba(229, 0, 67, 0.1);
    color: #e50043;
    transform: scale(1.1);
}

.auction-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.auction-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Bid form */
.auction-current-info {
    background: linear-gradient(135deg, rgba(229, 0, 67, 0.15), rgba(229, 0, 67, 0.05));
    border: 1px solid rgba(229, 0, 67, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.auction-current-info p {
    margin: 8px 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
}

.auction-bid-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.auction-bid-form input {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f1f1;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.auction-bid-form input:focus {
    outline: none;
    border-color: #e50043;
    background: rgba(229, 0, 67, 0.08);
    box-shadow: 0 0 0 3px rgba(229, 0, 67, 0.15);
    transform: translateY(-1px);
}

.bid-help-text {
    display: block;
    margin-top: 8px;
    color: #aaa;
    font-size: 13px;
    line-height: 1.3;
}

/* Buttons */
.auction-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auction-btn-primary {
    background: linear-gradient(135deg, #e50043, #ff1744);
    color: white;
    box-shadow: 0 4px 15px rgba(229, 0, 67, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auction-btn-primary:hover {
    background: linear-gradient(135deg, #ff1744, #e50043);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 0, 67, 0.4);
}

.auction-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(229, 0, 67, 0.3);
}

.auction-btn-primary:disabled {
    background: linear-gradient(135deg, #666, #555);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.auction-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f1f1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.auction-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Bid history */
.bid-history-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
}

.bid-history-list::-webkit-scrollbar {
    width: 6px;
}

.bid-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.bid-history-list::-webkit-scrollbar-thumb {
    background: rgba(229, 0, 67, 0.6);
    border-radius: 3px;
}

.bid-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 0, 67, 0.8);
}

.bid-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bid-history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.bid-history-item.highest-bid {
    background: linear-gradient(135deg, rgba(229, 0, 67, 0.15), rgba(229, 0, 67, 0.05));
    border-color: rgba(229, 0, 67, 0.3);
    box-shadow: 0 0 20px rgba(229, 0, 67, 0.1);
}

.bid-history-item.highest-bid::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #e50043, #ff1744);
}

.bid-amount {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    min-width: 80px;
    text-align: left;
}

.bid-info {
    text-align: right;
    flex: 1;
    min-width: 0;
    margin-left: 16px;
}

.bidder-name {
    display: block;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.bid-time {
    display: block;
    font-size: 12px;
    color: #aaa;
    font-weight: 500;
}

.highest-badge {
    position: absolute;
    right: 16px;
    top: 8px;
    background: linear-gradient(135deg, #e50043, #ff1744);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(229, 0, 67, 0.3);
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #aaa;
}

.loading-spinner:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #444;
    border-top: 2px solid #e50043;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Feedback styles */
.auction-feedback {
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .auction-modal {
        padding: 12px;
    }
    
    .auction-modal-content {
        max-width: none;
        width: 100%;
        max-height: 90vh;
    }
    
    .auction-modal-header {
        padding: 20px;
    }
    
    .auction-modal-header h3 {
        font-size: 1.25em;
    }
    
    .auction-modal-body {
        padding: 20px;
        max-height: calc(90vh - 120px);
    }
    
    .auction-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .auction-btn {
        width: 100%;
        min-height: 52px;
        font-size: 16px;
    }
    
    .bid-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    
    .bid-amount {
        font-size: 20px;
        min-width: auto;
    }
    
    .bid-info {
        text-align: left;
        width: 100%;
        margin-left: 0;
    }
    
    .bidder-name {
        max-width: none;
        font-size: 14px;
    }
    
    .highest-badge {
        position: relative;
        right: auto;
        top: auto;
        align-self: flex-end;
        margin-top: -8px;
    }
}

@media (max-width: 480px) {
    .auction-modal {
        padding: 8px;
    }
    
    .auction-modal-header,
    .auction-modal-body {
        padding: 16px;
    }
    
    .auction-modal-header h3 {
        font-size: 1.1em;
    }
    
    .auction-modal-footer {
        padding: 12px 16px;
    }
    
    .auction-bid-button {
        padding: 8px 16px !important;
        font-size: 14px !important;
        min-width: 100px !important;
    }
    
    .auction-badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }
    
    .auction-current-info {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .auction-bid-form input {
        padding: 14px;
        font-size: 16px;
    }
    
    .bid-history-list {
        max-height: 300px;
    }
    
    .bid-history-item {
        padding: 12px;
    }
}

/* Animation for new bids */
@keyframes newBidAnimation {
    0% { 
        background-color: rgba(229, 0, 67, 0.4);
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(229, 0, 67, 0.3);
    }
    50% {
        background-color: rgba(229, 0, 67, 0.2);
        transform: scale(1.01);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
        box-shadow: none;
    }
}

.new-bid {
    animation: newBidAnimation 3s ease-out;
}

/* Loading animation improvements */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.loading-spinner {
    animation: pulse 2s ease-in-out infinite;
}

/* Countdown animation */
@keyframes countdown-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.auction-countdown.urgent {
    animation: countdown-pulse 1s ease-in-out infinite;
    color: #ff6b6b !important;
}

/* Smooth modal transitions */
.auction-modal.closing {
    animation: fadeOut 0.3s ease forwards;
}

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

.auction-modal.closing .auction-modal-content {
    animation: modalSlideOut 0.3s ease forwards;
}

@keyframes modalSlideOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Button press animation */
.auction-btn:active {
    animation: buttonPress 0.15s ease;
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* Success feedback animation */
@keyframes successFeedback {
    0% {
        background-color: rgba(76, 175, 80, 0.1);
        border-color: rgba(76, 175, 80, 0.3);
    }
    100% {
        background-color: transparent;
        border-color: transparent;
    }
}

.bid-success {
    animation: successFeedback 2s ease-out;
    color: #4caf50 !important;
}

/* Error feedback animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.bid-error {
    animation: errorShake 0.5s ease-in-out;
    color: #f44336 !important;
}