/* Engagement & Gamification Styles */

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 10000;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: contents;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    width: 0%;
    transition: width 0.16s ease-out;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ============================================
   REACTIONS SYSTEM
   ============================================ */

.reactions-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .reactions-container {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.reactions-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 2rem;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 500;
}

.reaction-btn:hover {
    transform: scale(1.1);
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.reaction-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    animation: reactionPop 0.3s ease;
}

.reaction-count {
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

@keyframes reactionPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   STREAK BADGE
   ============================================ */

.streak-badge {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    z-index: 9999;
    animation: streakFloat 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.streak-badge:hover {
    transform: scale(1.05);
}

.streak-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.streak-icon {
    font-size: 1.5rem;
    animation: streakPulse 2s ease-in-out infinite;
}

.streak-count {
    font-size: 1.5rem;
    font-weight: 700;
}

.streak-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.streak-badge.streak-silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
}

.streak-badge.streak-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
}

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

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

/* ============================================
   POINTS SYSTEM
   ============================================ */

.points-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: transform 0.3s ease;
}

.dark .points-display {
    background: rgba(31, 41, 55, 0.95);
}

.points-display:hover {
    transform: scale(1.05);
}

.points-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.points-icon {
    font-size: 1.25rem;
    animation: pointsSpin 3s linear infinite;
}

.points-count {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3b82f6;
}

@keyframes pointsSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.points-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    z-index: 10001;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}

.points-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.points-amount {
    font-size: 1.5rem;
    font-weight: 700;
    animation: pointsBounce 0.5s ease;
}

.points-reason {
    font-size: 0.875rem;
    opacity: 0.9;
}

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

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    width: 90%;
}

.notification {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #3b82f6;
}

.dark .notification {
    background: #1f2937;
    color: white;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    border-left-color: #10b981;
}

.notification-streak {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.notification-achievement {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.dark .notification-streak,
.dark .notification-achievement {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */

.achievement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.achievement-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    max-width: 400px;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.achievement-modal.show .achievement-modal-content {
    transform: scale(1);
    animation: achievementPop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievement-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: achievementBounce 1s ease infinite;
}

.achievement-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.achievement-modal-content p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.achievement-close {
    background: white;
    color: #667eea;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.achievement-close:hover {
    transform: scale(1.05);
}

@keyframes achievementPop {
    0% {
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

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

/* ============================================
   RECOMMENDATIONS
   ============================================ */

.recommendations-section {
    margin: 4rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 1.5rem;
}

.recommendations-header {
    text-align: center;
    margin-bottom: 2rem;
}

.recommendations-header h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recommendation-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dark .recommendation-card {
    background: #1f2937;
}

.recommendation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.recommendation-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recommendation-content {
    padding: 1.5rem;
}

.recommendation-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ============================================
   SOCIAL PROOF
   ============================================ */

.social-proof {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    animation: socialProofFade 2s ease;
}

@keyframes socialProofFade {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CONFETTI EFFECT
   ============================================ */

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 10004;
    animation: confettiFall linear forwards;
    border-radius: 50%;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Hover effects on cards */
article {
    position: relative;
    overflow: hidden;
}

article::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

article:hover::after {
    left: 100%;
}

/* Click ripple effect */
article {
    position: relative;
}

article:active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Smooth page transitions */
body {
    transition: opacity 0.3s ease;
}

/* Loading shimmer effect */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .loading-shimmer {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

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

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

@media (max-width: 768px) {
    .streak-badge {
        top: 60px;
        right: 10px;
        padding: 0.5rem 0.75rem;
    }
    
    .points-display {
        top: 10px;
        right: 10px;
        padding: 0.5rem 0.75rem;
    }
    
    .points-notification {
        top: 80px;
        right: 10px;
        min-width: auto;
        padding: 0.75rem 1rem;
    }
    
    .achievement-modal-content {
        padding: 2rem;
        margin: 1rem;
    }
}

