/**
 * Estilos de Microinterações de Gamificação
 * FitFactory Dark/Gold Theme
 */

/* ========== VARIÁVEIS FITFACTORY ========== */
:root {
    --teal-primary: #00747C;
    --teal-glow: #00959f;
    --teal-dark: #005a60;
    --bg-primary: #E4EFEF;
    --bg-secondary: #d5e5e5;
    --bg-card: #ffffff;
    --text-primary: #202022;
    --text-secondary: #4a4a4c;
}

/* ========== XP TOAST ========== */
.xp-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 2px solid var(--teal-primary);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1),
                0 0 30px rgba(0, 116, 124, 0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
    min-width: 280px;
}

.xp-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.xp-toast-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--teal-primary), var(--teal-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 1.5s infinite;
}

.xp-toast-icon i {
    color: var(--bg-primary);
    font-size: 20px;
}

.xp-toast-content {
    flex: 1;
}

.xp-amount {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--teal-primary);
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 116, 124, 0.5);
}

.xp-reason {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== FLOATING XP ========== */
.floating-xp {
    position: fixed;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--teal-primary);
    text-shadow: 
        0 0 10px rgba(0, 116, 124, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(0);
}

.floating-xp.animate {
    animation: float-up 2s ease-out forwards;
}

/* ========== MODALS ========== */
.gamification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s;
}

.gamification-modal.show {
    opacity: 1;
}

.gamification-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.gamification-modal .modal-content {
    position: relative;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 3px solid var(--teal-primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
                0 0 60px rgba(0, 116, 124, 0.4);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gamification-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* ========== BADGE UNLOCK MODAL ========== */
.badge-reveal {
    overflow: hidden;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    top: -10px;
    animation: confetti-fall 3s linear forwards;
}

.badge-icon-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.badge-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--teal-glow), transparent 70%);
    animation: pulse-glow 2s infinite;
    filter: blur(20px);
}

.badge-icon {
    position: relative;
    font-size: 80px;
    color: var(--teal-primary);
    filter: drop-shadow(0 4px 20px var(--teal-primary));
    animation: badge-reveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--teal-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 2px 20px rgba(0, 116, 124, 0.6);
}

.badge-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.badge-description {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 20px;
}

.badge-xp {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--teal-primary);
    margin-bottom: 30px;
}

/* ========== LEVEL UP MODAL ========== */
.level-up-reveal {
    position: relative;
    overflow: hidden;
}

.gold-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
    animation: gold-explosion 1s ease-out;
    filter: blur(30px);
    pointer-events: none;
}

.level-up-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 64px;
    font-weight: 900;
    color: var(--teal-primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 30px;
    text-shadow: 0 4px 30px rgba(0, 116, 124, 0.8);
    animation: level-up-bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.level-counter i {
    color: var(--teal-primary);
    font-size: 32px;
}

.new-level {
    color: var(--teal-primary);
    animation: number-count 0.5s ease-out 0.3s both;
}

.tier-badge {
    background: linear-gradient(135deg, var(--teal-dark), var(--teal-primary));
    padding: 15px 30px;
    border-radius: 10px;
    margin: 20px 0;
}

.tier-badge p {
    font-size: 14px;
    color: var(--bg-primary);
    margin-bottom: 5px;
    font-weight: 600;
}

.tier-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--bg-primary);
    text-transform: uppercase;
}

/* ========== BUTTONS ========== */
.btn-continue {
    background: linear-gradient(135deg, var(--teal-primary), var(--teal-dark));
    color: #ffffff;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 116, 124, 0.4);
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 116, 124, 0.6);
}

.btn-continue:active {
    transform: translateY(0);
}

/* ========== ANIMATIONS ========== */
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

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

@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes badge-reveal {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes gold-explosion {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

@keyframes level-up-bounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes number-count {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .xp-toast {
        min-width: 240px;
        padding: 10px 15px;
    }

    .gamification-modal .modal-content {
        margin: 20px;
        padding: 30px 20px;
        max-width: 90%;
    }

    .level-up-text {
        font-size: 48px;
    }

    .badge-title {
        font-size: 24px;
    }
}

/* ========== ACESSIBILIDADE ========== */
@media (prefers-reduced-motion: reduce) {
    .xp-toast,
    .floating-xp,
    .gamification-modal .modal-content,
    .badge-icon,
    .level-up-text,
    .confetti {
        animation: none !important;
        transition: none !important;
    }
}
