/**
 * Coin Rise Animation
 * Click a coin row - coins rise, enlarge, and spin
 * Coins stay enlarged until user makes a choice
 * Integrates with coin selector modal in widget-daily-reading.php
 */

/* Make coin selector modal scrollable */
#rdrCoinSelectorModal .rdr-modal-content,
.rdr-modal .rdr-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.rdr-coin-options {
    max-height: none;
    overflow: visible;
}

/* Overlay that appears when coin is animating - sits on TOP of modal */
.rdr-coin-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999999;
    pointer-events: none;
}

.rdr-coin-overlay.show {
    display: block;
    pointer-events: auto;
}

/* The rising/enlarged coin display - inline styles control size, position, background */
.rdr-coin-enlarged {
    position: fixed;
    border-radius: 50%;
    border: 4px solid #C9A227;
    box-shadow: 0 0 40px rgba(201, 162, 39, 0.8), 0 0 80px rgba(201, 162, 39, 0.4);
    z-index: 9999999;
    pointer-events: none;
    /* Don't set width, height, background-size, background-position here - let inline styles control */
}

/* Final resting state after coin reaches destination */
.rdr-coin-enlarged.floating {
    pointer-events: auto;
    cursor: pointer;
    /* All other properties controlled by inline styles */
}

/* Animation is controlled entirely by JavaScript inline styles */

/* Fireworks celebration canvas */
#rdrFireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999998;
    pointer-events: none;
}

/* Choice links container */
.rdr-coin-choices {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999999;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rdr-coin-choices.show {
    display: flex;
    opacity: 1;
}

.rdr-coin-choice {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    min-width: 220px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.rdr-coin-choice.primary {
    background: linear-gradient(135deg, #B11226 0%, #8B0F1F 100%);
    border: 2px solid #B11226;
}

.rdr-coin-choice.primary:hover {
    background: linear-gradient(135deg, #c91a30 0%, #a01225 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(177, 18, 38, 0.4);
}

.rdr-coin-choice.secondary {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #C9A227;
    color: #C9A227;
}

.rdr-coin-choice.secondary:hover {
    background: rgba(201, 162, 39, 0.2);
    transform: scale(1.05);
}

/* Animation for coin previews in the selector modal */
.rdr-coin-preview.animate {
    animation: coinRise 1.5s ease-out forwards;
}

/* Stagger animation for each coin in the row */
.rdr-coin-row .rdr-coin-preview:nth-child(1).animate { animation-delay: 0s; }
.rdr-coin-row .rdr-coin-preview:nth-child(2).animate { animation-delay: 0.1s; }
.rdr-coin-row .rdr-coin-preview:nth-child(3).animate { animation-delay: 0.2s; }
.rdr-coin-row .rdr-coin-preview:nth-child(4).animate { animation-delay: 0.3s; }
.rdr-coin-row .rdr-coin-preview:nth-child(5).animate { animation-delay: 0.4s; }

@keyframes coinRise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateY(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-40px) scale(1.3) rotateY(360deg);
    }
    100% {
        opacity: 1;
        transform: translateY(-60px) scale(1.5) rotateY(720deg);
    }
}

/* Standalone container (if used outside modal) */
.coin-animation-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    padding-bottom: 20px;
    overflow: visible;
}

.rising-coin {
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rising-coin:hover {
    transform: scale(1.1);
}

.rising-coin.animate {
    animation: coinRise 1.5s ease-out forwards;
}
