/**
 * Realistic Animated Candle
 * Creates a flickering candle with warm glow effect
 */

.candle-container {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 120px;
}

/* Candle body */
.candle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 80px;
    background: linear-gradient(180deg, #FFF8E7 0%, #E8D4A8 50%, #D4B896 100%);
    border-radius: 4px 4px 0 0;
    box-shadow:
        inset 2px 0 4px rgba(255, 255, 255, 0.3),
        inset -2px 0 4px rgba(0, 0, 0, 0.1);
}

/* Wick */
.candle::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 15px;
    background: linear-gradient(180deg, #2C2C2C 0%, #4A4A4A 100%);
    border-radius: 2px;
}

/* Wax drip */
.candle::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 10px;
    background: linear-gradient(180deg, #FAF2E4 0%, #E8D4A8 100%);
    border-radius: 50%;
}

/* Flame wrapper */
.flame-wrapper {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
}

/* Flame */
.flame {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 35px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 200, 1) 10%,
            rgba(255, 200, 50, 1) 30%,
            rgba(255, 150, 0, 1) 60%,
            rgba(255, 80, 0, 0.8) 80%,
            rgba(200, 50, 0, 0) 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.3s ease-in-out infinite alternate;
    filter: blur(1px);
}

/* Inner bright core */
.flame::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 15px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(200, 220, 255, 0.9) 50%,
            rgba(255, 200, 100, 0) 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    filter: blur(2px);
}

/* Glow effect */
.flame-glow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(ellipse at center,
            rgba(255, 200, 100, 0.4) 0%,
            rgba(255, 150, 50, 0.2) 30%,
            rgba(255, 100, 0, 0.1) 50%,
            transparent 70%);
    border-radius: 50%;
    animation: glow 2s ease-in-out infinite;
    pointer-events: none;
}

/* Flicker animation */
@keyframes flicker {
    0% {
        transform: translateX(-50%) scale(1, 1) rotate(-1deg);
        opacity: 1;
    }

    25% {
        transform: translateX(-50%) scale(0.97, 1.02) rotate(1deg);
        opacity: 0.95;
    }

    50% {
        transform: translateX(-50%) scale(1.02, 0.98) rotate(-0.5deg);
        opacity: 1;
    }

    75% {
        transform: translateX(-50%) scale(0.98, 1.01) rotate(0.5deg);
        opacity: 0.97;
    }

    100% {
        transform: translateX(-50%) scale(1, 0.99) rotate(0deg);
        opacity: 1;
    }
}

/* Glow pulse */
@keyframes glow {

    0%,
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

/* Smoke effect */
.smoke {
    position: absolute;
    bottom: 120px;
    left: 50%;
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg,
            rgba(100, 100, 100, 0.1) 0%,
            transparent 100%);
    border-radius: 50%;
    animation: smoke 3s ease-out infinite;
    opacity: 0;
}

@keyframes smoke {
    0% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    100% {
        transform: translateX(-50%) translateY(-40px) scale(2);
        opacity: 0;
    }
}

/* Hero section candle - simplified inline version */
.candle-icon-animated {
    display: inline-block;
    font-size: 3rem;
    animation: candleFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 200, 100, 0.6));
    position: relative;
}

.candle-icon-animated::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(ellipse at center,
            rgba(255, 200, 100, 0.5) 0%,
            rgba(255, 150, 50, 0.3) 30%,
            transparent 60%);
    border-radius: 50%;
    animation: candleGlow 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes candleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes candleGlow {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
}

/* Memorial page large candle */
.memorial-candle {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}