.bid-header {
    background: #06060e;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .bid-header {
        padding: 12px 20px;
    }
}

/* Header Logo */
.header-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

@media (min-width: 428px) {
    .header-logo {
        width: 45px;
        height: 45px;
    }
}

@media (min-width: 768px) {
    .header-logo {
        width: 50px;
        height: 50px;
    }
}

/* Instagram-style Grid Layout - Mobile First */
.instagram-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    width: 100%;
}

/* For larger phones (iPhone Pro Max, etc) */
@media (min-width: 428px) {
    .instagram-grid {
        gap: 10px;
        padding: 10px;
    }
}

/* For tablets and larger - show 3 columns */
@media (min-width: 768px) {
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 12px;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Instagram Card */
.instagram-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    /* Better touch target for mobile */
    -webkit-tap-highlight-color: rgba(213, 167, 124, 0.2);
}

.instagram-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .instagram-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(213, 167, 124, 0.3);
    }
}

.instagram-card-inner {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (min-width: 428px) {
    .instagram-card {
        border-radius: 12px;
    }
    
    .instagram-card-inner {
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Instagram Image Wrapper */
.instagram-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Creates 1:1 aspect ratio */
    overflow: hidden;
    background: #0a0a0a;
}

.instagram-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .instagram-card:hover .instagram-img {
        transform: scale(1.05);
    }
}

.instagram-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Closing Soon badge - positioned at bottom */
.instagram-badge.bg-closing {
    top: auto;
    bottom: 8px;
    right: 8px;
    font-size: 9px;
    padding: 4px 8px;
}

@media (min-width: 428px) {
    .instagram-badge {
        top: 10px;
        right: 10px;
        font-size: 11px;
        padding: 6px 11px;
        border-radius: 16px;
    }
    
    .instagram-badge.bg-closing {
        top: auto;
        bottom: 10px;
        right: 10px;
        font-size: 10px;
        padding: 5px 9px;
    }
}

@media (min-width: 768px) {
    .instagram-badge {
        top: 12px;
        right: 12px;
        font-size: 12px;
        padding: 7px 13px;
        border-radius: 20px;
    }
    
    .instagram-badge.bg-closing {
        top: auto;
        bottom: 12px;
        right: 12px;
        font-size: 11px;
        padding: 6px 11px;
    }
}

/* Winning Badge - stays at top left */
.winning-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    animation: winningPulse 2s ease-in-out infinite;
}

@media (min-width: 428px) {
    .winning-badge {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 6px 11px;
        border-radius: 16px;
    }
}

@media (min-width: 768px) {
    .winning-badge {
        top: 12px;
        left: 12px;
        font-size: 12px;
        padding: 7px 13px;
        border-radius: 20px;
    }
}

@keyframes winningPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.8);
        transform: scale(1.05);
    }
}

/* User Winning Card Border */
.instagram-card.user-winning {
    border: 2px solid #958b59;
    box-shadow: 0 0 20px rgb(175 169 137 / 30%);
}

/* Instagram Card Body */
.instagram-card-body {
    padding: 10px;
}

@media (min-width: 428px) {
    .instagram-card-body {
        padding: 12px;
    }
}

@media (min-width: 768px) {
    .instagram-card-body {
        padding: 14px;
    }
}

.instagram-title {
    color: #d5a77c;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 36px;
}

@media (min-width: 428px) {
    .instagram-title {
        font-size: 14px;
        margin-bottom: 10px;
        min-height: 40px;
    }
}

@media (min-width: 768px) {
    .instagram-title {
        font-size: 15px;
        margin-bottom: 12px;
        line-height: 1.4;
        min-height: 42px;
    }
}

/* Instagram Stats */
.instagram-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

@media (min-width: 428px) {
    .instagram-stats {
        margin-bottom: 12px;
        padding: 10px 0;
    }
}

@media (min-width: 768px) {
    .instagram-stats {
        margin-bottom: 14px;
        padding: 10px 0;
    }
}

/* New Stacked Stats Layout */
.instagram-stats-stacked {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 0;
}

@media (min-width: 428px) {
    .instagram-stats-stacked {
        gap: 10px;
        margin-bottom: 12px;
        padding: 10px 0;
    }
}

@media (min-width: 768px) {
    .instagram-stats-stacked {
        gap: 12px;
        margin-bottom: 14px;
        padding: 10px 0;
    }
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

@media (min-width: 428px) {
    .stat-row {
        padding: 7px 10px;
        border-radius: 7px;
    }
}

@media (min-width: 768px) {
    .stat-row {
        padding: 8px 12px;
        border-radius: 8px;
    }
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    display: block;
    color: #888;
    font-size: 10px;
    margin-bottom: 0;
    font-weight: 500;
    text-align: left;
}

.stat-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-value small,
.stat-value .unit-text {
    font-size: 11px;
    font-weight: 400;
}

.stat-value strong {
    color: #d5a77c;
    font-size: 16px;
    line-height: 1;
}

@media (min-width: 428px) {
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 15px;
    }
    
    .stat-value small,
    .stat-value .unit-text {
        font-size: 12px;
    }
    
    .stat-value strong {
        font-size: 17px;
    }
}

@media (min-width: 768px) {
    .stat-label {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 17px;
    }
    
    .stat-value strong {
        font-size: 19px;
    }
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: #333;
}

@media (min-width: 768px) {
    .stat-divider {
        height: 32px;
    }
}

/* Instagram Button */
.instagram-btn {
    width: 100%;
    padding: 9px;
    font-size: 13px;
    border-radius: 6px;
    /* Better touch target */
    min-height: 38px;
    font-weight: 600;
}

@media (min-width: 428px) {
    .instagram-btn {
        padding: 10px;
        font-size: 14px;
        border-radius: 7px;
        min-height: 40px;
    }
}

@media (min-width: 768px) {
    .instagram-btn {
        padding: 11px;
        font-size: 15px;
        border-radius: 8px;
        min-height: 42px;
    }
}

/* Currency Icon Styling */
.currency-icon {
    height: 14px;
    width: auto;
    margin-right: 3px;
    vertical-align: baseline;
}

@media (min-width: 428px) {
    .currency-icon {
        height: 15px;
    }
}

@media (min-width: 768px) {
    .currency-icon {
        height: 16px;
        margin-right: 4px;
    }
}

/* Smaller currency icon for cards */
.currency-icon-small {
    height: 11px;
    width: auto;
    margin-right: 2px;
    vertical-align: baseline;
    flex-shrink: 0;
}

@media (min-width: 428px) {
    .currency-icon-small {
        height: 12px;
        margin-right: 3px;
    }
}

@media (min-width: 768px) {
    .currency-icon-small {
        height: 13px;
    }
}

.currency-icon-modal {
    height: 18px;
    width: auto;
    margin-right: 5px;
    vertical-align: middle;
}

/* Smooth update animation */
@keyframes pulseUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #efbf8f; }
    100% { transform: scale(1); }
}

@keyframes fadeOutRemove {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    100% { 
        opacity: 0;
        transform: scale(0.95);
    }
}

.stat-value strong {
    transition: all 0.3s ease;
}

.instagram-card.removing {
    animation: fadeOutRemove 0.3s ease forwards;
}

.gallery-item {
    /* aspect-ratio: 1 / 1; */
    overflow: hidden;
}

.gallery-img {
    max-width: 160px;
    /* height: 160px; */
    object-fit: cover;
    /* Ensures the image fills the block while keeping the aspect ratio */
    width: 50%;
}

/* Goldrose Button Style */
.goldrose-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 15px;
    background: linear-gradient(90deg, #d5a77c 0%, #efbf8f 45%, #7c5231 100%);
    border: 2px solid #d5a77c;
    border-radius: 0.88em;
    color: #000;
    font-weight: bold;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    /* box-shadow: 0 4px 12px rgba(255, 205, 87, 0.7); */
    transition: all 0.5s ease;
    font-size: 14px;
}

.goldrose-btn.btn-xs {
   
    padding: 3px 8px;
    font-size: 12px;
}


.other-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 15px;
    background:#24a0ed;
    border: 2px solid #24a0ed;
    border-radius: 0.88em;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    /* box-shadow: 0 4px 12px rgba(255, 205, 87, 0.7); */
    transition: all 0.5s ease;
    font-size: 14px;
}

.other-btn:hover {
    color: #fff;
    background: #094f7b;
    border: 2px solid #24a0ed;
}

.other-btn.btn-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    background: #24a0ed;
    border: 2px solid #24a0ed;
    border-radius: 0.88em;
    color: #fff;
    font-weight: normal;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    /* box-shadow: 0 4px 12px rgba(255, 205, 87, 0.7); */
    transition: all 0.5s ease;
    font-size: 12px;
}

/* Shine Effect */
.goldrose-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    transition: transform 0.5s ease;
}

.goldrose-btn:hover::after {
    transform: translateX(200%);
    color: #000;
}

.goldrose-btn:active,
.goldrose-btn:focus,
.goldrose-btn:hover {
    color: #000;
}

.card-title,
a.btn-link,
.title {
    color: #d5a77c;
    /* //#f7d2b2; */
}

/* Base styling for loader */
.loader::after {
    width: 50px;
    height: 50px;
    border: 5px solid #c9ae95;
    /* Light gold color */
    border-top: 5px solid #bc660b;
    /* Golden color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    content: '';
}

/* Animation for loader rotation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader {
    display: none;
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: hsl(0deg 0% 0% / 88%);
    z-index: 99;
    justify-content: center;
    align-items: center;
}

.toast-wrapper {
    z-index: 100;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    text-align: center;
    justify-content: center;
}

.toast {
    background: #151515 !important;
}
.card {
    border-radius: 14px;
    box-shadow: 2px 9px 10px 6px #00000021;
}

button#bidSubmit {
    padding: 10px 40px;
    margin-top: 20px;
}

.divider {
    border-right: 1px solid #818181;
    margin: 20px 0;
}

.badge.bg-open {
    background: #7da900 !important;
}

.badge {
    line-height: normal;
    min-height: 25px;
    border-radius: 20px;
    padding: 5px 10px;
    align-content: center;
}


.badge.bg-closing {
    background: #7da900 !important;
}


.badge.bg-closing {
    background: #ff4f3c !important;
    animation: blink 1s infinite; /* 1s blink effect, infinite loop */
    font-size: 12px;
    line-height: normal;
}


/* Blinking animation */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.bid-action-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-error {
    color: #ff0000;
}

div.modal {
    backdrop-filter: blur(20px);
}

/* Bid Modal Image Styling */
#bidModal .item-image {
    max-height: 40vh;
    width: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
}

#bidModal .modal-body {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#bidModal .modal-dialog {
    max-height: 95vh;
}

/* Mobile Modal Optimizations */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    /* Make modal buttons easier to tap */
    .modal-body button {
        min-height: 44px;
    }
    
    /* Better form inputs on mobile */
    .modal-body input {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
    
    /* Adjust image height for mobile */
    #bidModal .item-image {
        max-height: 35vh;
    }
    
    #bidModal .modal-body {
        max-height: 80vh;
    }
}

@media (min-width: 768px) {
    #bidModal .item-image {
        max-height: 50vh;
    }
    
    #bidModal .modal-body {
        max-height: none;
        overflow-y: visible;
    }
}

/* Outbid Notification */
.outbid-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(5px);
}

.outbid-notification.active {
    opacity: 1;
}

.outbid-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ff4f3c;
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 10px 40px rgba(255, 79, 60, 0.3);
}

.outbid-notification.active .outbid-content {
    transform: scale(1);
}

.outbid-image-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: shakeSad 0.6s ease-in-out;
}

.outbid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.outbid-overlay-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 79, 60, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 79, 60, 0.5);
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes shakeSad {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    20% { transform: translateX(-8px) rotate(-3deg); }
    40% { transform: translateX(8px) rotate(3deg); }
    60% { transform: translateX(-6px) rotate(-2deg); }
    80% { transform: translateX(6px) rotate(2deg); }
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 79, 60, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(255, 79, 60, 0.8);
    }
}

.outbid-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: shakeSad 0.5s ease-in-out;
}

.outbid-title {
    font-size: 28px;
    font-weight: bold;
    color: #ff4f3c;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 79, 60, 0.5);
}

.outbid-message {
    font-size: 16px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 500;
}

.outbid-bid-info {
    font-size: 18px;
    color: #efbf8f;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.outbid-bid-info .currency-icon-small {
    height: 14px;
}

.outbid-actions {
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.outbid-btn-bid,
.outbid-btn-close {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.outbid-btn-bid {
    animation: pulseButton 1.5s ease-in-out infinite;
}

@keyframes pulseButton {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(213, 167, 124, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(213, 167, 124, 0.8);
    }
}

.outbid-btn-close {
    background: #2c2c3e;
    color: #fff;
    border: 1px solid #444;
}

.outbid-btn-close:hover {
    background: #3a3a4e;
    border-color: #666;
}

@media (min-width: 428px) {
    .outbid-image-wrapper {
        width: 220px;
        height: 220px;
    }
    
    .outbid-overlay-badge {
        font-size: 15px;
        padding: 7px 14px;
    }
    
    .outbid-actions {
        flex-direction: row;
    }
    
    .outbid-btn-bid,
    .outbid-btn-close {
        width: auto;
        flex: 1;
    }
}

@media (min-width: 768px) {
    .outbid-image-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .outbid-overlay-badge {
        font-size: 16px;
        padding: 8px 16px;
    }
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 6, 14, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.celebration-overlay.active {
    opacity: 1;
}

.celebration-content {
    text-align: center;
    position: relative;
    z-index: 10;
    animation: celebrationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes celebrationBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 120px;
    margin-bottom: 20px;
    animation: celebrationRotate 0.6s ease-in-out;
}

@keyframes celebrationRotate {
    0% {
        transform: rotate(-180deg) scale(0);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.celebration-title {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(90deg, #d5a77c 0%, #efbf8f 45%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(213, 167, 124, 0.5);
}

.celebration-bid-number {
    font-size: 32px;
    font-weight: 600;
    color: #efbf8f;
    margin: 8px 0 0 0;
    padding: 0 20px;
    letter-spacing: 1px;
}

.celebration-message {
    font-size: 18px;
    color: #fff;
    margin: 0;
    padding: 0 20px;
    line-height: 1.6;
}

/* Confetti Animation */
.celebration-confetti {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

.confetti-circle {
    border-radius: 50%;
}

.confetti-square {
    border-radius: 2px;
}

.confetti-triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid;
    border-bottom-color: inherit;
    background: transparent !important;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile responsive celebration */
@media (max-width: 767px) {
    .celebration-icon {
        font-size: 80px;
    }
    
    .celebration-title {
        font-size: 32px;
    }
    
    .celebration-message {
        font-size: 16px;
        padding: 0 30px;
    }
    
    .confetti {
        width: 8px;
        height: 8px;
    }
}