/* Smooth Card Flip Transition Animations */

.flippable-card {
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), 
                opacity 0.3s ease,
                box-shadow 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
    backface-visibility: hidden;
}

.flippable-card.flipping {
    pointer-events: none;
}

.flippable-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-meaning-side, .card-numerology-side {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    min-height: 300px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: cardContentFadeIn 0.4s ease-out;
}

@keyframes cardContentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.meaning-header, .numerology-header {
    text-align: center;
    margin-bottom: 20px;
    animation: headerSlideIn 0.5s ease-out 0.1s both;
}

@keyframes headerSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.meaning-content {
    line-height: 1.6;
    animation: contentSlideUp 0.6s ease-out 0.2s both;
}

@keyframes contentSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.description-section, .history-section, .symbolism-section {
    margin-bottom: 15px;
    animation: sectionFadeIn 0.5s ease-out var(--delay, 0.3s) both;
}

.description-section { --delay: 0.2s; }
.history-section { --delay: 0.3s; }
.symbolism-section { --delay: 0.4s; }

.description-section h4, .history-section h4, .symbolism-section h4 {
    color: #ffd700;
    margin-bottom: 8px;
    animation: titleGlow 0.6s ease-out;
}

@keyframes titleGlow {
    0% { opacity: 0; text-shadow: none; }
    100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
    animation: statsGridSlide 0.7s ease-out 0.3s both;
}

@keyframes statsGridSlide {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    animation: valueCountUp 0.8s ease-out;
}

@keyframes valueCountUp {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.power-level {
    color: #ffd700;
    animation: powerPulse 2s ease-in-out infinite;
}

@keyframes powerPulse {
    0%, 100% { text-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { text-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
}

.power-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.power-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    animation: powerFillAnimation 1s ease-out 0.5s both;
}

@keyframes powerFillAnimation {
    0% { width: 0% !important; }
    100% { width: var(--target-width); }
}

.card-number-large {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: numberReveal 0.8s cubic-bezier(0.6, -0.28, 0.735, 0.045) 0.2s both;
}

@keyframes numberReveal {
    0% {
        opacity: 0;
        transform: rotateY(180deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
    }
}

.flip-indicator {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: indicatorSlideUp 0.5s ease-out 0.4s both;
}

@keyframes indicatorSlideUp {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.flip-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 5px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: scale(1);
}

.dot.active {
    background: #ffd700;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Landing page specific animations */
.meditation-card {
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.meditation-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Three-card layout animations */
.card-position .meditation-card {
    animation: cardSlideIn 0.6s ease-out var(--card-delay, 0s) both;
}

.card-position:nth-child(1) .meditation-card { --card-delay: 0.1s; }
.card-position:nth-child(2) .meditation-card { --card-delay: 0.2s; }
.card-position:nth-child(3) .meditation-card { --card-delay: 0.3s; }

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Gallery grid animations */
.cards-grid .card-item {
    animation: gridItemFadeIn 0.5s ease-out var(--grid-delay, 0s) both;
}

.cards-grid .card-item:nth-child(1) { --grid-delay: 0.1s; }
.cards-grid .card-item:nth-child(2) { --grid-delay: 0.15s; }
.cards-grid .card-item:nth-child(3) { --grid-delay: 0.2s; }
.cards-grid .card-item:nth-child(4) { --grid-delay: 0.25s; }
.cards-grid .card-item:nth-child(5) { --grid-delay: 0.3s; }
.cards-grid .card-item:nth-child(6) { --grid-delay: 0.35s; }

@keyframes gridItemFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}