/* Falling Beans Animation - The Beanary */
.bean-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.bean-jar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 200px;
    height: 250px;
    z-index: 100;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

.bean-jar-body {
    position: absolute;
    bottom: 0;
    left: 25px;
    width: 150px;
    height: 200px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.3) 100%);
    border: 4px solid rgba(90, 74, 106, 0.7);
    border-radius: 0 0 75px 75px;
    backdrop-filter: blur(3px);
    overflow: hidden;
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(90, 74, 106, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.2);
}

.bean-jar-neck {
    position: absolute;
    bottom: 200px;
    left: 60px;
    width: 80px;
    height: 30px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.5), 
        rgba(255, 255, 255, 0.3));
    border: 3px solid rgba(90, 74, 106, 0.7);
    border-radius: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.bean-jar-lid {
    position: absolute;
    bottom: 230px;
    left: 55px;
    width: 90px;
    height: 15px;
    background: linear-gradient(to bottom, 
        rgba(90, 74, 106, 0.9), 
        rgba(90, 74, 106, 0.7));
    border-radius: 45px;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

/* Accumulated beans in jar */
.bean-jar .accumulated-beans {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    transition: height 0.5s ease;
    overflow: visible;
}

.bean-jar .accumulated-beans .falling-bean {
    filter: brightness(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Individual falling bean */
.falling-bean {
    position: absolute;
    width: 20px;
    height: 30px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    pointer-events: none;
    animation: fall linear forwards;
    transform-origin: center;
}

/* Bean colors matching The Beanary theme */
.bean-pink {
    background: linear-gradient(135deg, #ecbac6, #e9ccd6);
    box-shadow: 0 2px 8px rgba(236, 186, 198, 0.5);
}

.bean-blue {
    background: linear-gradient(135deg, #a9c9ff, #8bb5ff);
    box-shadow: 0 2px 8px rgba(169, 201, 255, 0.5);
}

.bean-purple {
    background: linear-gradient(135deg, #cbcaee, #b5b4e0);
    box-shadow: 0 2px 8px rgba(203, 202, 238, 0.5);
}

.bean-light-purple {
    background: linear-gradient(135deg, #e6d9f2, #d4c4e8);
    box-shadow: 0 2px 8px rgba(230, 217, 242, 0.5);
}

/* Falling animation */
@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Bean wiggle animation for variety */
@keyframes bean-wiggle {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-5px) rotate(-5deg);
    }
    75% {
        transform: translateX(5px) rotate(5deg);
    }
}

.falling-bean.wiggle {
    animation: fall linear forwards, bean-wiggle 0.3s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bean-jar {
        bottom: 15px;
        left: 15px;
        width: 150px;
        height: 200px;
    }
    
    .bean-jar-body {
        left: 20px;
        width: 120px;
        height: 160px;
        border-radius: 0 0 60px 60px;
    }
    
    .bean-jar-neck {
        left: 45px;
        width: 60px;
        height: 25px;
        bottom: 160px;
    }
    
    .bean-jar-lid {
        left: 40px;
        width: 70px;
        height: 12px;
        bottom: 185px;
    }
    
    .falling-bean {
        width: 15px;
        height: 22px;
    }
}

/* Hide beans on very small screens to avoid performance issues */
@media (max-width: 480px) {
    .bean-container {
        display: none;
    }
}

