/* Achievement/Badges System Styling */

/* Achievement Container */
.achievements-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.achievements-header {
    text-align: center;
    margin-bottom: 40px;
}

.achievements-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.achievements-subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    color: #667eea;
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Achievement Categories */
.achievement-categories {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-filter {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-weight: 500;
}

.category-filter:hover,
.category-filter.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Achievement Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.achievement-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.achievement-card.earned {
    border-color: #27ae60;
    background: linear-gradient(135deg, #fff, #f8fff9);
}

.achievement-card.earned::before {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #27ae60;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.achievement-card.locked {
    opacity: 0.6;
    background: #f8f9fa;
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.achievement-icon {
    font-size: 3em;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.achievement-card.locked .achievement-icon {
    filter: grayscale(100%) opacity(0.5);
}

.achievement-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.achievement-category {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.achievement-progress {
    margin-top: 15px;
}

.progress-bar {
    background: #ecf0f1;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9em;
    color: #7f8c8d;
    display: flex;
    justify-content: space-between;
}

.earned-date {
    background: #e8f5e8;
    color: #27ae60;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
}

/* Leaderboard */
.leaderboard-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 25px;
}

.leaderboard-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.leaderboard-rank {
    font-size: 1.5em;
    font-weight: bold;
    color: #3498db;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.first {
    color: #f1c40f;
}

.leaderboard-rank.second {
    color: #95a5a6;
}

.leaderboard-rank.third {
    color: #e67e22;
}

.leaderboard-username {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.leaderboard-count {
    background: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.9em;
}

/* Recent Achievements */
.recent-achievements {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.recent-achievements h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.3s ease;
}

.recent-item:hover {
    background: #f8f9fa;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-icon {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.recent-info {
    flex: 1;
}

.recent-achievement-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.recent-username {
    color: #7f8c8d;
    font-size: 0.9em;
}

.recent-time {
    color: #bdc3c7;
    font-size: 0.8em;
    text-align: right;
}

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.5s ease;
    z-index: 1000;
    max-width: 350px;
}

.achievement-notification.show {
    transform: translateX(0);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.notification-icon {
    font-size: 1.5em;
}

.notification-title {
    font-weight: bold;
    font-size: 1.1em;
}

.notification-description {
    opacity: 0.9;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .achievements-container {
        padding: 15px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .user-stats {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px 20px;
    }
    
    .achievement-card {
        padding: 20px;
    }
    
    .achievement-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .achievement-icon {
        font-size: 2.5em;
    }
    
    .category-filter {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .leaderboard-item {
        gap: 15px;
        padding: 12px 15px;
    }
    
    .leaderboard-rank {
        min-width: 30px;
        font-size: 1.3em;
    }
    
    .achievement-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-200px);
    }
    
    .achievement-notification.show {
        transform: translateY(0);
    }
}

/* Animation for new achievements */
@keyframes achievementEarned {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.achievement-card.new-earned {
    animation: achievementEarned 0.6s ease-out;
}
