/* Cosmic Enhancements for Mystic Meditation */

/* Enhanced Cosmic Background */
.cosmic-background {
    background-image: url('/static/images/cosmic_background.svg');
    background-size: cover;
    background-position: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -100;
    animation: slowPulse 30s infinite alternate;
}

/* Animation for the cosmic background */
@keyframes slowPulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* Shooting star animation */
.shooting-star {
    opacity: 0;
    animation: shootStar 5s infinite;
    animation-delay: calc(var(--delay, 0) * 1s);
}

.shooting-star:nth-child(1) {
    --delay: 2;
}

.shooting-star:nth-child(2) {
    --delay: 7;
}

.shooting-star:nth-child(3) {
    --delay: 15;
}

@keyframes shootStar {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0);
    }
    1% {
        opacity: 1;
    }
    5% {
        opacity: 1;
        transform: translateX(300px) translateY(300px);
    }
    6% {
        opacity: 0;
    }
    100% {
        opacity: 0;
        transform: translateX(300px) translateY(300px);
    }
}

/* Yoga Stick Figures */
.yoga-stick-figure {
    width: 150px;
    height: 150px;
    margin: 10px;
    transition: transform 0.3s ease;
}

.yoga-stick-figure:hover {
    transform: scale(1.1);
}

/* Container for stick figures */
.stick-figure-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
    z-index: 10;
    position: relative;
}

/* Styles for card detail pages to include stick figures */
.card-detail .stick-figure-container {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

/* Add stick figure to loading screens */
.loading-container .yoga-stick-figure {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
}

/* Yogin animation (bobbing up and down) */
.yoga-stick-figure.animate {
    animation: yogiFloat 3s ease-in-out infinite;
}

@keyframes yogiFloat {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Add stick figure to card reading pages */
.reading-container .stick-figure-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 150px;
    z-index: 1000;
}

/* Make stick figures responsive */
@media (max-width: 768px) {
    .yoga-stick-figure {
        width: 100px;
        height: 100px;
    }
    
    .reading-container .stick-figure-container {
        width: 100px;
    }
    
    .loading-container .yoga-stick-figure {
        width: 70px;
        height: 70px;
    }
}

/* Fix for Z-index issues */
.card-reading-container, 
.card-detail-container, 
.meditation-container {
    position: relative;
    z-index: 10;
}

/* Humorous annotations for the stick figures */
.stick-figure-caption {
    font-size: 0.8rem;
    color: white;
    text-align: center;
    margin-top: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 3px 8px;
}

/* Random wiggle animation for "struggling" stick figures */
.yoga-stick-figure.struggle {
    animation: yogiWiggle 0.5s ease-in-out infinite;
}

@keyframes yogiWiggle {
    0% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(2deg);
    }
    100% {
        transform: rotate(-2deg);
    }
}