/* ============================================
   FluentMaster - Component Styles
   ============================================ */

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--bg-dark);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    z-index: 400;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
    max-width: 200px;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--bg-dark);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s ease infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Confetti */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 3s ease-out forwards;
}

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

/* XP Pop Animation */
.xp-pop {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    z-index: 600;
    animation: xp-pop-anim 1s ease forwards;
    pointer-events: none;
    font-family: var(--font-display);
}

@keyframes xp-pop-anim {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}

/* Level up animation */
.level-up-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.level-up-content {
    text-align: center;
    color: white;
    animation: modalIn 0.5s ease;
}

.level-up-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.level-up-level {
    font-size: 5rem;
    font-weight: 900;
    font-family: var(--font-display);
    background: linear-gradient(135deg, #F59E0B, #FBBF24, #FCD34D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

/* Streak fire animation */
.streak-flame {
    animation: flame 0.5s ease infinite alternate;
}

@keyframes flame {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* Correct/Wrong answer glow */
.glow-correct {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3) !important;
}

.glow-wrong {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3) !important;
}

/* Progress circle */
.progress-circle {
    width: 60px;
    height: 60px;
    position: relative;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 4;
}

.progress-circle-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-primary { background: rgba(108,99,255,0.1); color: var(--primary); }
.badge-success { background: rgba(16,185,129,0.1); color: var(--secondary); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--accent); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--danger); }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.3) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

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

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-text:last-child { width: 60%; }

/* Correct indicator */
.check-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    animation: bounce-in 0.3s ease;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Install prompt banner */
.install-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 90;
    max-width: 90%;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

.install-banner-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.install-banner-text {
    flex: 1;
    font-size: 0.85rem;
}

.install-banner-text strong { display: block; }

.install-banner-close {
    color: var(--text-light);
    font-size: 1.2rem;
}

/* Matching pairs - connected state */
.match-line {
    position: absolute;
    height: 2px;
    background: var(--secondary);
    transform-origin: left;
    z-index: 1;
}

/* Audio waveform visual */
.audio-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 30px;
}

.audio-wave-bar {
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
    animation: wave 0.8s ease infinite;
}

.audio-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 8px; }
    50% { height: 24px; }
}
