/* =========================================
   BLOOD BAG STOCK DISPLAY
   ========================================= */

.stock-grid-elegant {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding: 2rem 0;
    justify-items: center;
}

/* The Bag Container */
.liquid-card {
    position: relative;
    width: 200px;
    height: 280px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px 15px 40px 40px;
    overflow: visible;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 1;
}

.liquid-card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Bag Hanging Loop (Top) */
.liquid-card::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    z-index: -1;
}

.liquid-card::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* --- The Sticker Label --- */
.card-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    background: #fff;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border: 1px solid #f0f0f0;
}

.blood-type-display {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 5px;
}

.blood-type-display sup {
    font-size: 0.4em;
    color: var(--primary-red);
}

.stock-qty-display {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stock-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 5px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
    display: block;
}

.stock-status-badge {
    margin-top: 5px;
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* --- The Liquid Layer (Outer Container) --- */
.liquid-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px 15px 40px 40px;
    overflow: hidden;
    /* Clips the wave inside the bag */
    z-index: 0;
}

/* Base Red Color just in case wave misses */
.liquid-bg::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(220, 20, 60, 0.85);
    /* Matches wave color */
    z-index: 0;
}

/* --- The Wave Animation Wrapper --- */
.wave {
    position: absolute;
    bottom: 10%;
    /* Lift up slightly */
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, 0);
    z-index: 1;
}

/* The Rotating Elements */
.wave::before,
.wave::after {
    content: "";
    position: absolute;
    width: 100%;
    /* Relative to .wave */
    height: 100%;
    top: 50%;
    /* Center the rotating shape */
    left: 0;
    border-radius: 40%;
    background: rgba(220, 20, 60, 0.85);
    animation: wave-rotate 8s linear infinite;
    transform-origin: 50% 50%;
}

.wave::after {
    background: rgba(180, 0, 0, 0.6);
    animation: wave-rotate 10s linear infinite;
    border-radius: 45%;
}

@keyframes wave-rotate {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* --- Status Variations --- */

/* Normal: High wave */
.liquid-card .wave {
    bottom: 0%;
    /* Fills mostly */
    transform: translate(-50%, 10%);
    /* Adjust vertical pos */
}

/* Critical: Low wave */
.liquid-card.critical .wave {
    bottom: -50%;
    /* Only top visible at bottom of card */
}

.liquid-card.critical .wave::before {
    background: rgba(255, 140, 0, 0.9);
}

.liquid-card.critical .wave::after {
    background: rgba(255, 69, 0, 0.7);
}

.liquid-card.critical .liquid-bg::before {
    background: rgba(255, 140, 0, 0.9);
    bottom: -80%;
    /* Lower the fill */
}


/* Empty: No wave, white background */
.liquid-card.empty .wave {
    display: none;
}

.liquid-card.empty .liquid-bg {
    background: linear-gradient(0deg, #f5f5f5 0%, #ffffff 100%);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.liquid-card.empty .liquid-bg::before {
    display: none;
}