/**
 * Avatar System Styles
 * AgentMath.app - Animal Avatars
 * 
 * This file contains all styles for the avatar system.
 * BACKOUT: Remove this file and references to disable avatar styling.
 */

/* ==================== AVATAR SIZES ==================== */

.avatar-tiny {
    width: 32px;
    height: 32px;
}

.avatar-small {
    width: 48px;
    height: 48px;
}

.avatar-medium {
    width: 64px;
    height: 64px;
}

.avatar-large {
    width: 96px;
    height: 96px;
}

.avatar-xlarge {
    width: 128px;
    height: 128px;
}

/* ==================== AVATAR CONTAINER ==================== */

.avatar-container {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.avatar-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==================== BACKGROUND COLORS ==================== */

.avatar-bg-none {
    background: #e8e8e8;
}

.avatar-bg-forest {
    background: linear-gradient(135deg, #90EE90, #228B22);
}

.avatar-bg-ocean {
    background: linear-gradient(135deg, #87CEEB, #4169E1);
}

.avatar-bg-sunset {
    background: linear-gradient(135deg, #FFB347, #FF6B6B);
}

.avatar-bg-space {
    background: linear-gradient(135deg, #2C3E50, #1a1a2e);
}

.avatar-bg-rainbow {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
}

/* ==================== AVATAR IN QUIZ HEADER ==================== */

.quiz-header-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-header-avatar .avatar-container {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.quiz-header-avatar .avatar-container:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

/* ==================== AVATAR SHOP ==================== */

.avatar-shop {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.avatar-shop-header {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-shop-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.avatar-shop-preview .avatar-container {
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.avatar-shop-points {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.2em;
}

/* ==================== SHOP CATEGORIES ==================== */

.shop-category {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.shop-category-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

/* ==================== SHOP ITEM CARDS ==================== */

.shop-item {
    background: #f8f9ff;
    border: 3px solid #e0e7ff;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.shop-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.shop-item.owned {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
}

.shop-item.equipped {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border-color: #ffc107;
}

.shop-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.shop-item-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.shop-item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.shop-item-cost {
    font-size: 0.9em;
    color: #666;
}

.shop-item-cost.free {
    color: #28a745;
}

/* Rarity badges */
.shop-item-rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.rarity-common {
    background: #e9ecef;
    color: #6c757d;
}

.rarity-rare {
    background: #cce5ff;
    color: #004085;
}

.rarity-epic {
    background: #e2d4f0;
    color: #6f42c1;
}

.rarity-legendary {
    background: linear-gradient(135deg, #fff3cd, #ffd700);
    color: #856404;
}

/* ==================== OWNED/EQUIPPED BADGES ==================== */

.shop-item-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    font-size: 0.7em;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: bold;
}

.shop-item-badge.equipped {
    background: #ffc107;
    color: #333;
}

/* ==================== PURCHASE BUTTON ==================== */

.shop-item-buy {
    margin-top: 10px;
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
}

.shop-item-buy.can-afford {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.shop-item-buy.can-afford:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.shop-item-buy.cannot-afford {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.shop-item-buy.owned {
    background: #28a745;
    color: white;
}

/* ==================== LEADERBOARD AVATARS ==================== */

.leaderboard-avatar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-avatar .avatar-container {
    border: 2px solid #e0e7ff;
}

.leaderboard-avatar.rank-1 .avatar-container {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-avatar.rank-2 .avatar-container {
    border-color: #c0c0c0;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.leaderboard-avatar.rank-3 .avatar-container {
    border-color: #cd7f32;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

/* ==================== RESULTS SCREEN AVATAR ==================== */

.results-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.results-avatar .avatar-container {
    margin: 0 auto;
    border: 4px solid #ffd700;
    animation: results-glow 2s ease-in-out infinite;
}

@keyframes results-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

.results-avatar-name {
    margin-top: 15px;
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.results-avatar-level {
    color: #667eea;
    font-size: 1em;
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 768px) {
    .avatar-shop-preview {
        padding: 20px;
    }
    
    .shop-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .shop-item {
        padding: 10px;
    }
    
    .shop-item-icon {
        font-size: 2em;
    }
    
    /* Hide large avatars on quiz screen for mobile */
    .quiz-mobile-hide {
        display: none;
    }
}

/* ==================== ANIMATIONS ==================== */

.avatar-bounce {
    animation: avatar-bounce 0.5s ease;
}

@keyframes avatar-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.avatar-shake {
    animation: avatar-shake 0.5s ease;
}

@keyframes avatar-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* New item unlocked celebration */
.avatar-celebrate {
    animation: avatar-celebrate 1s ease;
}

@keyframes avatar-celebrate {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-10deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}
