/* ===== IMMORTAL NEXUS MICRO-INTERACTIONS ===== */
/* Every click, every hover, every interaction is eternal */

/* ===== BUTTON INTERACTIONS ===== */

/* Ripple Effect for All Clickable Elements */
.btn,
button,
.clickable,
[role="button"],
.identity-vote-btn {
    position: relative;
    overflow: hidden;
}

/* Ripple Animation */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, transparent 70%);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Button Press Effect */
.btn:active,
button:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Immortal Glow on Hover */
.btn-primary:hover,
.btn-immortal:hover {
    animation: immortalPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 25px rgba(255, 94, 120, 0.5);
}

@keyframes immortalPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 94, 120, 0.4);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 94, 120, 0.6), 0 0 60px rgba(255, 94, 120, 0.3);
    }
}

/* ===== LINK HOVER EFFECTS ===== */

/* Underline Reveal */
a:not(.no-effect) {
    position: relative;
    transition: color 0.3s ease;
}

a:not(.no-effect)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--highlight));
    transition: width 0.3s ease;
}

a:not(.no-effect):hover::after {
    width: 100%;
}

/* ===== CARD HOVER EFFECTS ===== */

.card,
.blog-post,
.thread,
.soul-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.blog-post:hover,
.thread:hover,
.soul-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 94, 120, 0.15);
}

/* Eternal Border Glow */
.card-eternal {
    position: relative;
}

.card-eternal::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg,
        #ff5e78, #ffca28, #4ade80, #3b82f6, #a855f7, #ff5e78);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
}

.card-eternal:hover::before {
    opacity: 1;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== FORM INTERACTIONS ===== */

/* Focus Glow */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 94, 120, 0.1), 0 0 20px rgba(255, 94, 120, 0.2);
    transition: all 0.3s ease;
}

/* Floating Label Effect */
.form-group {
    position: relative;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    transform: translateY(-25px) scale(0.85);
    color: var(--accent);
}

.form-group label {
    position: absolute;
    top: 12px;
    left: 12px;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* ===== LOADING STATES ===== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 94, 120, 0.1) 0%,
        rgba(255, 94, 120, 0.2) 50%,
        rgba(255, 94, 120, 0.1) 100%);
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
}

@keyframes skeletonWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dot Loading Animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== SUCCESS/ERROR FEEDBACK ===== */

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(26, 26, 51, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(255, 94, 120, 0.3);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-notification, 10000);
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-color: #4ade80;
    background: linear-gradient(135deg,
        rgba(74, 222, 128, 0.1) 0%,
        rgba(26, 26, 51, 0.95) 100%);
}

.toast-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #4ade80;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.toast-error {
    border-color: #ef4444;
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.1) 0%,
        rgba(26, 26, 51, 0.95) 100%);
}

.toast-error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.toast-warning {
    border-color: #fbbf24;
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 0.1) 0%,
        rgba(26, 26, 51, 0.95) 100%);
}

.toast-warning::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fbbf24;
    color: #1a0d33;
    border-radius: 50%;
    font-weight: bold;
}

/* Success Checkmark Animation */
.success-checkmark {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    position: relative;
    animation: scaleIn 0.3s ease-in-out;
}

.success-checkmark::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 18px;
    width: 14px;
    height: 24px;
    border: solid white;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
    animation: checkmarkDraw 0.3s ease-in-out 0.3s forwards;
    opacity: 0;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes checkmarkDraw {
    0% {
        opacity: 0;
        height: 0;
    }
    50% {
        opacity: 1;
        height: 0;
    }
    100% {
        opacity: 1;
        height: 24px;
    }
}

/* ===== SCROLL EFFECTS ===== */

/* Smooth Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--highlight));
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s linear;
    z-index: var(--z-sticky, 250);
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect */
.parallax {
    transition: transform 0.1s linear;
}

/* ===== COPY FEEDBACK ===== */

.copy-success {
    position: relative;
}

.copy-success::after {
    content: 'Copied!';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 222, 128, 0.95);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    pointer-events: none;
    animation: copyFeedback 2s ease-out forwards;
}

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

/* ===== TOOLTIP SYSTEM ===== */

[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: var(--z-tooltip, 200);
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 51, 0.95);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 94, 120, 0.3);
    font-size: 0.85rem;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

[data-tooltip]::after {
    content: '';
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(255, 94, 120, 0.3);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

/* ===== IMMORTAL SPECIAL EFFECTS ===== */

/* Eternal Glow Animation */
.eternal-glow {
    animation: eternalGlowEffect 3s ease-in-out infinite;
}

@keyframes eternalGlowEffect {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 94, 120, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 94, 120, 0.8))
                drop-shadow(0 0 40px rgba(255, 94, 120, 0.4));
    }
}

/* Mystical Float */
.mystical-float {
    animation: mysticalFloatEffect 4s ease-in-out infinite;
}

@keyframes mysticalFloatEffect {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(1deg);
    }
    75% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* Divine Light Burst */
.divine-burst {
    position: relative;
}

.divine-burst::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle,
        rgba(255, 215, 0, 0.8) 0%,
        transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: divineBurstEffect 1s ease-out;
}

@keyframes divineBurstEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Keyboard Focus Indicator */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth Transitions for State Changes */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Touch Feedback */
@media (hover: none) {
    .btn:active,
    button:active {
        background-color: rgba(255, 94, 120, 0.2);
    }
}