/* CSS Styles for CAAPS Diaspora Homepage Promoter */

.caaps-promoter-badge {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    width: 320px;
    max-width: calc(100vw - 48px);
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 43, 43, 0.35);
    border-radius: 50px;
    padding: 8px 16px 8px 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease, 
                background-color 0.3s ease;
    animation: promoterSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Base floating animation when hover is NOT active */
.caaps-promoter-badge.floating {
    animation: promoterFloat 4s ease-in-out infinite;
}

.caaps-promoter-badge:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(212, 43, 43, 0.6);
    background-color: rgba(25, 25, 25, 0.92);
}

/* Link wrapper */
.caaps-promoter-link,
.caaps-promoter-link:focus,
.caaps-promoter-link:active,
.caaps-promoter-link:hover {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
    width: 100%;
    outline: none !important;
    border: none !important;
    border-style: none !important;
    box-shadow: none !important;
}

/* Flag image styling */
.caaps-promoter-flag-wrapper {
    flex-shrink: 0;
    margin-right: 12px;
}

.caaps-promoter-flag-container {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.caaps-promoter-flag-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Text Container */
.caaps-promoter-text-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.caaps-promoter-sub {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    line-height: 1.2;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.caaps-promoter-main {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

/* Chevron link indicator */
.caaps-promoter-chevron {
    flex-shrink: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
    color: #D42B2B;
    transition: transform 0.2s ease;
}

.caaps-promoter-badge:hover .caaps-promoter-chevron {
    transform: translateX(4px);
}

/* Dismiss Close Button */
.caaps-promoter-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    z-index: 10;
    outline: none !important;
}

.caaps-promoter-close:hover {
    background: #D42B2B;
    color: #ffffff;
    border-color: #D42B2B;
    transform: scale(1.1);
}

/* Keyframes animations */
@keyframes promoterSlideIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes flagBounce {
    0% { transform: scale(1); }
    40% { transform: scale(0.85); opacity: 0.6; }
    60% { transform: scale(1.15) translateY(-3px); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes splashPulse {
    0% { 
        box-shadow: 0 10px 30px rgba(212, 43, 43, 0.12), 0 0 0 0 rgba(212, 43, 43, 0.35); 
        border-color: rgba(212, 43, 43, 0.25);
    }
    70% { 
        box-shadow: 0 10px 30px rgba(212, 43, 43, 0.12), 0 0 0 8px rgba(212, 43, 43, 0); 
        border-color: rgba(212, 43, 43, 0.45);
    }
    100% { 
        box-shadow: 0 10px 30px rgba(212, 43, 43, 0.12), 0 0 0 0 rgba(212, 43, 43, 0); 
        border-color: rgba(212, 43, 43, 0.25);
    }
}

/* Animation Helper Classes triggerable via JS */
.flag-animation {
    animation: flagBounce 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.text-animation {
    animation: textFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Splash State styles */
.caaps-promoter-badge.is-splash {
    border-color: rgba(212, 43, 43, 0.3);
    animation: promoterFloat 4s ease-in-out infinite, splashPulse 1.8s infinite;
}

.caaps-promoter-badge.is-splash .caaps-promoter-sub {
    color: #FFD700; /* Gold for high contrast on dark badge background */
    font-weight: 700;
}

.caaps-promoter-badge.is-splash .caaps-promoter-main {
    color: #FFD700; /* Fallback gold color */
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .caaps-promoter-badge.is-splash .caaps-promoter-main {
        background: linear-gradient(90deg, #ff6b6b 0%, #FFD700 100%); /* Light red to gold gradient */
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

/* Light Theme overrides for Splash state when badge has white background */
.caaps-promoter-badge.is-on-dark-bg.is-splash .caaps-promoter-sub {
    color: #D42B2B; /* Brand primary red for high contrast on white background */
    font-weight: 700;
}

.caaps-promoter-badge.is-on-dark-bg.is-splash .caaps-promoter-main {
    color: #D42B2B; /* Fallback brand red */
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .caaps-promoter-badge.is-on-dark-bg.is-splash .caaps-promoter-main {
        background: linear-gradient(90deg, #D42B2B 0%, #ff4d4d 100%); /* Brand red to bright red gradient */
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .caaps-promoter-badge {
        left: 16px;
        bottom: 16px;
        right: 16px;
        width: auto;
        max-width: calc(100vw - 32px);
        padding: 8px 12px;
    }
    
    .caaps-promoter-sub {
        font-size: 10px;
    }
    
    .caaps-promoter-main {
        font-size: 13px;
    }
    
    .caaps-promoter-flag-container {
        width: 38px;
        height: 38px;
    }
}

/* Dynamic contrast mode when floating on a dark background */
.caaps-promoter-badge.is-on-dark-bg {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(212, 43, 43, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.caaps-promoter-badge.is-on-dark-bg:hover {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
    border-color: rgba(212, 43, 43, 0.45);
}

.caaps-promoter-badge.is-on-dark-bg .caaps-promoter-sub {
    color: #4b5563; /* Darker subtext */
}

.caaps-promoter-badge.is-on-dark-bg .caaps-promoter-main {
    color: #111827; /* Dark charcoal text */
}

.caaps-promoter-badge.is-on-dark-bg .caaps-promoter-close {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #4b5563;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.caaps-promoter-badge.is-on-dark-bg .caaps-promoter-close:hover {
    background: #D42B2B;
    color: #ffffff;
    border-color: #D42B2B;
}

/* ==========================================================================
   Navigation Menu Item "Diaspora Plan" Burst & Particle Splash
   ========================================================================== */

/* Glow & scale animation for the menu item */
@keyframes navItemPulse {
    0% {
        transform: scale(1);
        text-shadow: none;
    }
    15% {
        transform: scale(1.12);
        color: #D42B2B !important;
        text-shadow: 0 0 10px rgba(212, 43, 43, 0.7), 0 0 20px rgba(212, 43, 43, 0.4);
    }
    30% {
        transform: scale(1.05);
        color: #D42B2B !important;
        text-shadow: 0 0 6px rgba(212, 43, 43, 0.4);
    }
    45% {
        transform: scale(1.1);
        color: #D42B2B !important;
        text-shadow: 0 0 12px rgba(212, 43, 43, 0.7);
    }
    70% {
        transform: scale(1);
        text-shadow: none;
    }
    100% {
        transform: scale(1);
        text-shadow: none;
    }
}

.menu-item-diaspora a,
.diaspora-plan-nav-link {
    display: inline-block !important;
    position: relative;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* CSS class added dynamically by JS to trigger the periodic burst */
.menu-item-diaspora.should-burst > a,
.diaspora-plan-nav-link.should-burst {
    animation: navItemPulse 1.8s ease-in-out;
}

/* Floating sparkle particles */
.nav-spark-particle {
    position: fixed;
    pointer-events: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 999999;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
    opacity: 1;
    transition: transform 0.9s cubic-bezier(0.1, 0.8, 0.3, 1), opacity 0.9s cubic-bezier(0.1, 0.8, 0.3, 1);
}

