/* FLOATING ANIMATION FOR CHARACTER AVATAR */
@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-14px); }
    100% { transform: translateY(0px); }
}

.animated-avatar {
    animation: float 3s ease-in-out infinite;
}

/* ACHIEVEMENT UNLOCK POPUP */
.achievement-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.9));
    border: 3px solid #ffd700;
    border-radius: 16px;
    padding: 20px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.4), 0 0 80px rgba(255, 215, 0, 0.2);
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-popup.show {
    transform: translateX(0);
    opacity: 1;
    animation: achievementBounce 0.6s ease;
}

@keyframes achievementBounce {
    0% { transform: translateX(450px) scale(0.8); }
    50% { transform: translateX(-10px) scale(1.05); }
    100% { transform: translateX(0) scale(1); }
}

.achievement-icon {
    font-size: 3.5rem;
    flex-shrink: 0;
    animation: iconSpin 0.8s ease;
}

@keyframes iconSpin {
    0% { transform: rotate(0deg) scale(0); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.achievement-content {
    flex-grow: 1;
}

.achievement-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 4px;
}

.achievement-name {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.achievement-desc {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 600;
}

/* ============================================================
   SMOOTH PAGE TRANSITIONS
   ============================================================ */

/* Page fade-in on load */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageEnter 0.4s ease-out;
}

/* Smooth page exit (add this class with JavaScript on navigation) */
body.page-exit {
    animation: pageExit 0.3s ease-in forwards;
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Content fade-in stagger effect */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delays for multiple elements */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }

/* Smooth transitions for interactive elements */
a, button, .btn, .card, .planet-card, .mode-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth hover effects */
a:hover, button:hover, .btn:hover {
    transform: translateY(-2px);
}

/* Modal/Dialog fade-in */
.modal, .dialog, .popup {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide transitions for sections */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading spinner with smooth animation */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
