/**
 * Learning Features Styles
 * Spectacular styles for young and all learners
 */

/* ============================================
   LEARNING MODE STYLES
   ============================================ */

/* Kids Mode - Playful and Colorful */
.learning-mode-kids {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFD93D;
    --success: #6BCF7F;
    --bg: #FFF9E6;
    --bg-secondary: #FFE9B9;
    --text: #2C3E50;
}

.learning-mode-kids .button,
.learning-mode-kids .cta-button,
.learning-mode-kids .filter-btn {
    min-height: 60px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.learning-mode-kids .button:active,
.learning-mode-kids .cta-button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.learning-mode-kids h1 {
    font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive;
    color: var(--primary);
    text-shadow: 3px 3px 0 var(--accent);
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

.learning-mode-kids .tribe-card {
    border: 4px solid var(--primary);
    box-shadow: 8px 8px 0 var(--accent);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.learning-mode-kids .tribe-card:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 12px 12px 0 var(--accent);
}

/* Student Mode - Clean and Focused */
.learning-mode-student {
    --primary: #3498db;
    --secondary: #2ecc71;
    --accent: #f39c12;
}

.learning-mode-student .container {
    max-width: 1000px;
}

/* Research Mode - Professional */
.learning-mode-researcher {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #e74c3c;
}

.learning-mode-researcher .container {
    max-width: 1400px;
}

/* ============================================
   POINTS & BADGES ANIMATIONS
   ============================================ */

.points-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
}

.points-popup {
    background: linear-gradient(135deg, #6BCF7F, #2ecc71);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: pointsPopup 3s ease-out forwards;
}

.points-reason {
    font-size: 1rem;
    font-weight: 400;
    margin-top: 0.5rem;
    opacity: 0.9;
}

@keyframes pointsPopup {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
    70% {
        transform: scale(1) rotate(-5deg);
    }
    100% {
        transform: scale(0) translateY(-100px);
        opacity: 0;
    }
}

/* Badge Earned Modal */
.badge-earned-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.badge-earned-content {
    background: white;
    padding: 3rem;
    border-radius: 30px;
    text-align: center;
    max-width: 500px;
    position: relative;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.badge-icon.large {
    font-size: 8rem;
    animation: spin 1s ease-in-out;
}

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

.badge-rarity {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 700;
    margin: 1rem 0;
}

.badge-rarity.common {
    background: #95a5a6;
    color: white;
}

.badge-rarity.uncommon {
    background: #27ae60;
    color: white;
}

.badge-rarity.rare {
    background: #3498db;
    color: white;
}

.badge-rarity.epic {
    background: #9b59b6;
    color: white;
}

.badge-rarity.legendary {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
}

.badge-points {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f39c12;
    margin: 1rem 0;
}

.badge-message {
    font-size: 1.125rem;
    color: #7f8c8d;
    margin: 1rem 0 2rem;
}

.celebrate-btn {
    background: linear-gradient(135deg, #6BCF7F, #2ecc71);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 50px;
    min-width: 200px;
    transition: all 0.3s ease;
}

.celebrate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Confetti Animation */
.confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti::before,
.confetti::after {
    content: '🎉';
    position: absolute;
    font-size: 2rem;
    animation: confettiFall 3s linear infinite;
}

.confetti::before {
    left: 20%;
    animation-delay: 0s;
}

.confetti::after {
    right: 20%;
    animation-delay: 0.5s;
}

@keyframes confettiFall {
    0% {
        top: -10%;
        opacity: 1;
        transform: rotate(0deg);
    }
    100% {
        top: 110%;
        opacity: 0;
        transform: rotate(720deg);
    }
}

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

.level-up-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem;
    border-radius: 30px;
    text-align: center;
    color: white;
    position: relative;
    animation: zoomIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.level-icon {
    animation: pulse 2s ease-in-out infinite;
}

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

.level-number {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0 2rem;
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.sparkles::before,
.sparkles::after {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    animation: sparkle 2s linear infinite;
}

.sparkles::before {
    left: 10%;
    top: 20%;
}

.sparkles::after {
    right: 10%;
    bottom: 20%;
    animation-delay: 1s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   FUN FACTS CARD
   ============================================ */

.fun-fact-card {
    width: 300px;
    height: 400px;
    perspective: 1000px;
    cursor: pointer;
    margin: 2rem auto;
}

.fun-fact-front,
.fun-fact-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fun-fact-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fun-fact-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.fun-fact-card.flipped .fun-fact-front {
    transform: rotateY(-180deg);
}

.fun-fact-card.flipped .fun-fact-back {
    transform: rotateY(0deg);
}

.fun-fact-emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.fun-fact-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.fun-fact-hint {
    font-size: 1rem;
    opacity: 0.9;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.fun-fact-text {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.fun-fact-category {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   PROGRESS DASHBOARD
   ============================================ */

.learner-dashboard {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.level-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.level-icon-large {
    font-size: 4rem;
}

.level-info h2 {
    margin: 0;
    color: var(--primary);
}

.level-progress {
    max-width: 600px;
    margin: 2rem auto;
}

.progress-bar-container {
    background: rgba(0, 0, 0, 0.1);
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 15px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-item {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
}

.badges-showcase {
    margin: 3rem 0;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.badge-item {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.badge-item.earned {
    cursor: pointer;
}

.badge-item.earned:hover {
    transform: translateY(-5px);
}

.badge-item.locked {
    opacity: 0.3;
    filter: grayscale(100%);
}

.badge-item-icon {
    font-size: 3rem;
}

.badge-item-name {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.daily-challenge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    text-align: center;
}

.daily-challenge-icon {
    font-size: 4rem;
}

.daily-challenge h3 {
    margin: 1rem 0;
}

.daily-challenge-points {
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    margin-top: 1rem;
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Learning Mode Selector */
.learning-mode-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.mode-button {
    background: white;
    border: 3px solid var(--border);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 150px;
}

.mode-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.mode-button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.mode-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mode-description {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .learning-mode-kids h1 {
        font-size: 2rem;
    }

    .badge-earned-content,
    .level-up-content {
        padding: 2rem;
        margin: 1rem;
    }

    .fun-fact-card {
        width: 100%;
        max-width: 300px;
    }

    .learner-dashboard {
        padding: 1rem;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* Print styles - hide gamification in print */
@media print {
    .points-animation,
    .badge-earned-modal,
    .level-up-modal,
    .fun-fact-card,
    .learner-dashboard,
    .learning-mode-selector {
        display: none !important;
    }
}
