/* =========================================
   ADVANCED ANIMATIONS & INTERACTIONS
   ========================================= */

/* Particles Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes mantraScroll {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.particles-container span {
    position: absolute;
    font-size: 1.5rem;
    color: rgba(212, 175, 55, 0.3);
    animation: float 10s infinite linear;
    user-select: none;
    pointer-events: none;
}

.mantra-scroll {
    animation: mantraScroll 45s infinite linear;
    white-space: nowrap;
    display: inline-block;
}

.sanskrit-mantra {
    pointer-events: none;
    z-index: 2;
}

.hero-content {
    animation: panelGlow 6s ease-in-out infinite;
}

/* Story Container & Characters */
.story-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1200;
}

.character-section {
    position: absolute;
    bottom: clamp(1rem, 2vw, 2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    /* Allow interactions with characters */
}

.guru-section {
    left: clamp(1rem, 2vw, 2rem);
}

.disciple-section {
    right: clamp(1rem, 2vw, 2rem);
}

.story-bubble {
    position: absolute;
    background: rgba(10, 25, 47, 0.95);
    border: 1px solid var(--primary-gold, #D4AF37);
    color: #f6f1e4;
    padding: 0.85rem 1.25rem;
    border-radius: 20px;
    max-width: 280px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.story-bubble.active {
    opacity: 1;
    transform: translateY(0);
}

.bubble-left::after {
    content: '';
    position: absolute;
    left: 2rem;
    bottom: -10px;
    width: 16px;
    height: 16px;
    background: rgba(10, 25, 47, 0.85);
    border-left: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    transform: rotate(45deg);
}

.bubble-right::after {
    content: '';
    position: absolute;
    right: 2rem;
    bottom: -10px;
    width: 16px;
    height: 16px;
    background: rgba(10, 25, 47, 0.85);
    border-right: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    transform: rotate(-45deg);
}

.story-line {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.story-speaker {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-gold, #D4AF37);
}

.character-avatar {
    width: 250px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
    animation: figureFloat 4s ease-in-out infinite;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    overflow: visible;
}

.character-section:nth-child(2) .character-avatar {
    animation-delay: 0.5s;
}

.story-model {
    width: 280px;
    height: 280px;
    display: block;
    background: transparent !important;
    --poster-color: transparent;
    margin-bottom: -15px;
}

.story-role {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-gold, #D4AF37);
    padding-bottom: 0.8rem;
    font-weight: bold;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.story-portal-global {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 250px;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.story-portal-global video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px);
}

@keyframes figureFloat {

    0%,
    100% {
        transform: translateY(0) rotateY(-6deg);
    }

    50% {
        transform: translateY(-8px) rotateY(6deg);
    }
}

/* Temple Card Animations */
.temple-card {
    perspective: 1000px;
    background: transparent;
}

.temple-card.card-animate .temple-card-inner {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: cardRise 0.6s ease forwards;
}

@keyframes cardRise {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.temple-card-inner {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s ease;
    transform-style: preserve-3d;
    position: relative;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--primary-gold, #D4AF37);
}

.temple-card:hover .temple-card-inner {
    transform: translateY(-10px) rotateX(2deg);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.2);
}

.temple-image-wrapper {
    transition: transform 0.5s ease;
    height: 200px;
    overflow: hidden;
}

.temple-card:hover .temple-image-wrapper img {
    transform: scale(1.1);
    transition: transform 0.8s ease;
}

.temple-image-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.temple-card:hover .temple-image-overlay {
    opacity: 1;
}

.temple-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(212, 175, 55, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 5;
}

.temple-card:hover .temple-hover-effect {
    opacity: 1;
    animation: shine 1.5s ease;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Page Transition Animations */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Loading Animation */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: #D4AF37;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Glowing Effects */
.glow-effect {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    }

    to {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
    }
}

/* Scroll Reveal Animation */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Ripple Effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple-effect:focus:after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Badge Colors */
.bg-gold {
    background-color: var(--primary-gold, #D4AF37) !important;
}

.text-gold {
    color: var(--primary-gold, #D4AF37) !important;
}

.border-gold {
    border-color: var(--primary-gold, #D4AF37) !important;
}

.bg-parchment-light {
    background-color: #F5E9D4;
}

.text-dark-parchment {
    color: #5D4037;
}

/* Custom Badge Classes */
.badge-sea {
    background-color: #0077be;
    color: white;
}

.badge-mountain {
    background-color: #5D4037;
    color: white;
}

.badge-river {
    background-color: #00bcd4;
    color: white;
}

.badge-forest {
    background-color: #2e7d32;
    color: white;
}

.badge-cave {
    background-color: #424242;
    color: white;
}

.badge-island {
    background-color: #ffa000;
    color: white;
}

/* Hero Panel Ambient Glow */
@keyframes panelGlow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.45), inset 0 0 20px rgba(212, 175, 55, 0.08);
    }

    50% {
        box-shadow: 0 0 45px rgba(0, 0, 0, 0.6), inset 0 0 35px rgba(212, 175, 55, 0.18);
    }
}

/* Yatra Updates Aesthetic Cards */
.glow-effect-text {
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    animation: glow-pulse-text 3s infinite alternate;
}

@keyframes glow-pulse-text {
    0% { text-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
    100% { text-shadow: 0 0 30px rgba(212, 175, 55, 0.6); }
}

.update-card {
    background: rgba(15, 20, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(212, 175, 55, 0.15) !important;
    border-radius: 16px !important;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-style: preserve-3d;
}

.update-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: rgba(212, 175, 55, 0.6) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 175, 55, 0.2) inset !important;
}

.update-card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.update-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s ease;
}

.update-card:hover .update-card-img-wrapper img {
    transform: scale(1.15);
}

.update-date-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(10, 25, 47, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--primary-gold);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.update-content {
    background: linear-gradient(180deg, rgba(15, 20, 35, 0) 0%, rgba(15, 20, 35, 0.9) 20%, rgba(10, 15, 30, 1) 100%);
    position: relative;
    z-index: 2;
    margin-top: -40px;
    padding-top: 50px !important;
}

.read-more-btn {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: bold;
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.read-more-btn::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-gold);
    transition: width 0.3s ease;
}

.read-more-btn:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.read-more-btn:hover::after {
    width: 100%;
}

/* Cosmic Background Effect */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #0B0E14 0%, #000 100%);
    z-index: -999;
    overflow: hidden;
}

.cosmic-bg::before,
.cosmic-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: celestialSpin 150s linear infinite;
    opacity: 0.25;
}

.cosmic-bg::after {
    background-size: 300px 300px;
    animation: celestialSpin 100s linear infinite reverse;
    opacity: 0.15;
}

@keyframes celestialSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sacred Footer Enhancements */
.sacred-footer {
    position: relative;
    background: linear-gradient(0deg, #050810 0%, #151a2e 100%);
    padding: 80px 0 40px 0;
    border-top: 2px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    overflow: hidden;
    z-index: 10;
}

.sacred-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    animation: shadowPulse 4s infinite alternate;
}

.footer-links a {
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-gold) !important;
    transform: translateX(10px);
    text-shadow: 0 0 10px rgba(212,175,55,0.5);
}

.hover-gold { transition: all 0.3s ease; }
.hover-gold:hover {
    color: var(--primary-gold) !important;
    text-shadow: 0 0 10px rgba(212,175,55,0.8);
    transform: scale(1.2);
}

@media (prefers-reduced-motion: reduce) {
    .hero-content,
    .temple-card.card-animate,
    .scroll-indicator,
    .mantra-scroll,
    .story-avatar,
    .glow-effect-text,
    .update-card {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}