/**
 * you.bid Sticky Bid Bar Styles
 * Beautiful glassmorphism design with color coding and animations
 */

/* ============================================
   MAIN STICKY BAR CONTAINER
   ============================================ */
.youbid-sticky-bar {
    position: fixed;
    /* YOUBID FIX: Top position dynamically calculated by JavaScript */
    /* top: 140px; */
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    max-width: 1200px;
    width: 80%;
    z-index: 999;
    
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    /* YOUBID UPDATE: Stronger 3D shadow effect for more pop */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 
                0 8px 24px rgba(0, 0, 0, 0.18),
                0 4px 12px rgba(0, 0, 0, 0.12);
    /* YOUBID UPDATE: Removed border */
    
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.youbid-sticky-bar.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.youbid-sticky-bar.hidden {
    display: none !important;
}

/* YOUBID FIX: Hide sticky bar when modal is open */
body.uwap-modal-open .youbid-sticky-bar {
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transition: opacity 0.2s ease, z-index 0s 0.2s;
}

.youbid-sticky-bar.modal-open-hide {
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transition: opacity 0.2s ease, z-index 0s 0.2s;
}

/* YOUBID UPDATE: Light blue gradient background for all statuses */
.youbid-sticky-bar,
.youbid-sticky-bar.winning,
.youbid-sticky-bar.losing,
.youbid-sticky-bar.not-bidding {
    background: linear-gradient(135deg, #caf0f8 0%, #ade8f4 100%);
    /* YOUBID UPDATE: Removed left border */
}

.sticky-bar-container {
    position: relative;
    padding: 12px 15px 12px 18px;
}

.sticky-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    margin-right: 35px;
}

.sticky-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sticky-bid {
    flex: 1;
    min-width: 140px;
    align-self: flex-end;
}

.sticky-countdown {
    flex: 2;
    min-width: 240px;
    display: flex;
    align-items: center;
    align-self: flex-end;
    margin-left: -50px;
}

.sticky-action {
    flex: 1.5;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0px;
    min-width: 400px;
    align-self: flex-end;
}

/* YOUBID UPDATE: Black text for labels and values */
.sticky-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #333333;
    letter-spacing: 0.5px;
}

.sticky-value {
    font-size: 18px;
    font-weight: 700;
    color: #333333;
}

.sticky-price {
    color: #333333;
    font-size: 28px; /* Increased for better visibility on desktop */
}

/* YOUBID FIX: Styled badge label container (replaces text labels) */
.sticky-badge-label {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

/* YOUBID FIX: When price is hidden (closed auctions), center the badge vertically */
.sticky-bid:has(.sticky-price:not([style*="display: none"])) .sticky-badge-label {
    margin-bottom: 4px;
}

.sticky-bid:not(:has(.sticky-price)) .sticky-badge-label,
.sticky-bid:has(.sticky-price[style*="display: none"]) .sticky-badge-label {
    margin: auto 0; /* Center vertically when no price */
}

/* YOUBID FIX: Badge styling for sticky bar - slightly smaller than main page */
.sticky-badge-label .woo-ua-winned-for,
.sticky-badge-label .youbid-sold-pending-badge,
.sticky-badge-label .youbid-referred-to-seller-badge,
.sticky-badge-label .woo-ua-starting,
.sticky-badge-label .woo-ua-current {
    font-size: 11px !important;
    display: inline-block;
    margin: 0 !important;
    padding: 3px 7px !important;
}

/* YOUBID FIX: Ensure badges maintain their gradient styling from youbid-uiux-styling plugin */
.sticky-badge-label .woo-ua-winned-for.winning_bid,
.sticky-badge-label .youbid-sold-pending-badge,
.sticky-badge-label .youbid-referred-to-seller-badge {
    /* These inherit their gradient backgrounds from youbid-uiux-styling plugin */
    position: relative;
    display: inline-block;
}

@keyframes priceUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.sticky-price.price-updated {
    animation: priceUpdate 0.3s ease;
}

/* YOUBID UPDATE: White box with 3D shadow for countdown */
.countdown-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    height: 43px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.1),
                0 1px 3px rgba(0, 0, 0, 0.08);
}

.countdown-unit {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 3px;
}

/* YOUBID UPDATE: Red countdown numbers and labels */
.time-unit {
    font-size: 22px; /* Increased for better readability */
    font-weight: 700;
    color: #E60000;
    min-width: 28px;
    text-align: right;
}

.time-label {
    font-size: 12px; /* Increased for better readability */
    font-weight: 600;
    color: #E60000;
}

.sticky-countdown .pulse {
    animation: pulse 1.5s ease infinite;
}

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

.sticky-countdown .final-minute {
    color: #dc3545 !important;
}

.sticky-countdown .final-minute .time-unit {
    color: #dc3545 !important;
}

.countdown-closed {
    font-size: 18px;
    font-weight: 700;
    color: #dc3545;
    text-transform: uppercase;
}

/* YOUBID UPDATE: Hide status box for non-bidders */
.sticky-status {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    min-width: 240px;
    height: 43px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-left: -40px;
}

/* YOUBID UPDATE: Green status for winning (no border) */
.youbid-sticky-bar.winning .sticky-status {
    display: flex;
    background: #28a745;
}

.youbid-sticky-bar.winning .status-icon,
.youbid-sticky-bar.winning .status-text {
    color: #ffffff;
}

/* YOUBID UPDATE: Red status for losing (no border) */
.youbid-sticky-bar.losing .sticky-status {
    display: flex;
    background: #dc3545;
}

.youbid-sticky-bar.losing .status-icon,
.youbid-sticky-bar.losing .status-text {
    color: #ffffff;
}

.status-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.sticky-bid-button {
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 43px;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* YOUBID UPDATE: Fixed position 60px from right border */
    position: absolute;
    right: 60px;
    bottom: 0px;
    /* YOUBID UPDATE: Unified yellow-lime button color for all statuses */
    background: linear-gradient(135deg, #d4e157 0%, #c0ca33 100%);
    color: #4a4a4a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sticky-bid-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #dce775 0%, #c0ca33 100%);
}

.sticky-bid-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* YOUBID UPDATE: Same yellow-lime button for all statuses */
.youbid-sticky-bar.winning .sticky-bid-button,
.youbid-sticky-bar.losing .sticky-bid-button,
.youbid-sticky-bar.not-bidding .sticky-bid-button {
    background: linear-gradient(135deg, #d4e157 0%, #c0ca33 100%);
    color: #4a4a4a;
}

.youbid-sticky-bar.winning .sticky-bid-button:hover,
.youbid-sticky-bar.losing .sticky-bid-button:hover,
.youbid-sticky-bar.not-bidding .sticky-bid-button:hover {
    background: linear-gradient(135deg, #dce775 0%, #c0ca33 100%);
}

/* YOUBID UPDATE: Close button positioned on the right (75% size, center-aligned with yellow button) */
.sticky-close-btn {
    position: absolute;
    right: 10px;
    bottom: 15px;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    color: #333333;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sticky-close-btn:hover {
    background: rgba(0, 0, 0, 0.25);
    color: #000000;
    transform: scale(1.1);
}

/* YOUBID FIX: Apply urgent glow only to countdown-box to eliminate double border */
.youbid-sticky-bar.urgent .countdown-box {
    animation: countdownUrgentGlow 2s ease infinite;
}

@keyframes countdownUrgentGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                    0 2px 6px rgba(0, 0, 0, 0.1),
                    0 1px 3px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 0, 0, 0.4), 
                    0 2px 8px rgba(255, 0, 0, 0.3),
                    0 1px 4px rgba(255, 0, 0, 0.2),
                    0 0 20px rgba(255, 0, 0, 0.3);
    }
}

/* YOUBID NEW: Price flash animation when bid updates */
/* Animation speed is set dynamically by JavaScript based on flash rate */
@keyframes priceFlash {
    0%, 100% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(255, 215, 0, 0.6);
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

/* YOUBID FIX: Hide status box on tablets and smaller screens to prevent overlapping */
@media screen and (max-width: 1199px) {
    .youbid-sticky-bar.winning .sticky-status,
    .youbid-sticky-bar.losing .sticky-status {
        display: none !important;
    }
}

@media screen and (max-width: 1024px) {
    .youbid-sticky-bar {
        width: 90%;
        /* YOUBID FIX: Top position dynamically calculated by JavaScript */
        /* top: 100px; */
    }
    .sticky-bar-content {
        gap: 20px;
    }
    .sticky-col {
        min-width: auto;
    }
}

@media screen and (max-width: 768px) {
    .youbid-sticky-bar {
        width: 95%;
        /* YOUBID FIX: Top position dynamically calculated by JavaScript */
        /* top: 80px; */
    }
    .sticky-bar-container {
        padding: 12px 40px 12px 15px;
    }
    .sticky-bar-content {
        flex-direction: column;
        gap: 12px;
    }
    .sticky-col {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .sticky-action {
        flex-direction: column;
        gap: 10px;
    }
    .sticky-label {
        font-size: 10px;
    }
    .sticky-value {
        font-size: 16px;
    }
    .sticky-price {
        font-size: 20px;
    }
    .time-unit {
        font-size: 16px;
        min-width: 22px;
    }
    .time-label {
        font-size: 9px;
    }
    .countdown-box {
        gap: 6px;
    }
    .countdown-unit {
        gap: 2px;
    }
    .sticky-bid-button {
        width: 100%;
        padding: 10px 20px;
        font-size: 13px;
    }
    .sticky-status {
        width: 100%;
        justify-content: center;
    }
    .sticky-close-btn {
        width: 28px;
        height: 28px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
}

@media screen and (max-width: 480px) {
    .youbid-sticky-bar {
        width: 98%;
    }
    .sticky-bar-container {
        padding: 10px 35px 10px 12px;
    }
    .sticky-price {
        font-size: 18px;
    }
    .time-unit {
        font-size: 14px;
        min-width: 20px;
    }
}

.youbid-sticky-bar,
.sticky-price,
.sticky-bid-button {
    will-change: transform;
}

.sticky-bid-button,
.sticky-close-btn,
.sticky-status {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================
   
   IMPORTANT: Desktop styles above are LOCKED and working perfectly.
   All mobile-specific adjustments go in this section only.
   
   Breakpoints:
   - Tablet & Mobile (max-width: 992px)
   - Mobile Only (max-width: 768px)
   - Small Mobile (max-width: 480px)
   ============================================ */

/* Tablet and below (992px and smaller) */
@media screen and (max-width: 992px) {
    /* Mobile-specific styles will go here */
}

/* Mobile devices (768px and smaller) */
@media screen and (max-width: 768px) {
    
    /* Compact sticky bar for mobile - half height and moved up */
    .youbid-sticky-bar {
        width: 95%;
        max-width: 100%;
        /* YOUBID FIX: Top position dynamically calculated by JavaScript */
        /* top: 110px; */
        height: 50px; /* Half the original height */
    }
    
    .sticky-bar-container {
        padding: 6px 8px; /* Adjusted padding */
        height: 100%;
    }
    
    .sticky-bar-content {
        flex-direction: row; /* Horizontal layout */
        gap: 6px;
        margin-right: 0;
        align-items: flex-start; /* Align all items to top */
        height: 100%;
    }
    
    /* Show Current Bid on left side - match desktop positioning */
    .sticky-bid {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 2px;
        flex-shrink: 0;
        min-width: auto;
        margin-top: -12px; /* Move up 20px higher from 8px baseline */
    }
    
    .sticky-bid .sticky-label {
        display: block;
        font-size: 9px;
        font-weight: 600;
        color: #333333;
        text-transform: uppercase;
        line-height: 1.2;
        letter-spacing: 0.3px;
    }
    
    .sticky-bid .sticky-price {
        font-size: 20px; /* Increased from 18px */
        font-weight: 700;
        color: #333333;
        line-height: 1.1;
    }
    
    /* YOUBID FIX: Mobile adjustments for badge label */
    .sticky-badge-label {
        margin-bottom: 2px; /* Tighter spacing for mobile */
    }
    
    /* YOUBID FIX: Smaller badge font size for mobile */
    .sticky-badge-label .woo-ua-winned-for,
    .sticky-badge-label .youbid-sold-pending-badge,
    .sticky-badge-label .youbid-referred-to-seller-badge,
    .sticky-badge-label .woo-ua-starting,
    .sticky-badge-label .woo-ua-current {
        font-size: 8px !important; /* Smaller for mobile */
        padding: 2px 5px !important; /* Tighter padding */
    }
    
    /* Compact countdown box - vertical stack with label */
    .sticky-countdown {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 2px;
        flex: 1;
        min-width: auto;
        margin-left: 0;
        padding-top: 8px; /* Align with Current Bid positioning */
    }
    
    /* Show "Closing In" label - styled like Current Bid label */
    .sticky-countdown .sticky-label {
        display: block !important;
        font-size: 9px;
        font-weight: 600;
        color: #333333;
        text-transform: uppercase;
        line-height: 1.2;
        letter-spacing: 0.3px;
    }
    
    .countdown-box {
        padding: 4px 6px;
        gap: 4px;
        height: auto;
        justify-content: center;
    }
    
    .countdown-unit {
        gap: 2px;
        flex-direction: row; /* Numbers and labels side by side */
        align-items: baseline;
    }
    
    .time-unit {
        font-size: 14px; /* Increased for better readability on mobile */
        font-weight: 700;
        min-width: auto;
    }
    
    .time-label {
        font-size: 9px; /* Increased for better readability on mobile */
        margin-left: 1px;
    }
    
    /* Action section - compact button */
    .sticky-action {
        flex-shrink: 0;
        min-width: auto;
        width: auto;
        flex-direction: row;
        gap: 0;
        align-items: center;
        justify-content: center;
        padding-top: 8px; /* Align with other sections */
    }
    
    /* Hide status box completely on mobile */
    .sticky-status {
        display: none !important;
    }
    
    .status-icon {
        display: none;
    }
    
    .status-text {
        display: none;
    }
    
    /* Place Bid button - compact */
    .sticky-bid-button {
        position: static;
        width: auto;
        min-width: 60px;
        height: 32px;
        padding: 4px 12px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.3px;
        margin-left: 0;
        margin-right: 15px; /* Move 15px to the left */
        margin-bottom: 0;
        right: auto;
        bottom: auto;
    }
    
    /* Smaller close button for mobile - vertically centered */
    .sticky-close-btn {
        position: absolute;
        right: 4px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%); /* Center vertically */
        width: 16px;
        height: 16px;
        font-size: 11px;
        line-height: 16px;
    }
}

/* Small mobile devices (480px and smaller) */
@media screen and (max-width: 480px) {
    /* Mobile-specific styles will go here */
}
