/* Achievement System Styles */

/* Star Counter in Navigation */
.star-counter {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 44px;
}

.star-counter:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

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

.star-pulse {
    animation: starPulse 0.6s ease-in-out;
}

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

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
    max-width: 350px;
}

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

.achievement-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.achievement-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.achievement-sparkle {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.5; transform: scale(1.2) rotate(180deg); }
}

.achievement-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    animation: bounce 1s ease-in-out;
}

.achievement-text {
    text-align: center;
    position: relative;
    z-index: 1;
}

.achievement-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.achievement-description {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.achievement-stars {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stars-earned {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Achievement Modal */
.achievement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

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

.achievement-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.achievement-modal.show .achievement-modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon {
    font-size: 2.5rem;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px 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: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Next Badge Section */
.next-badge-section {
    margin-bottom: 2rem;
}

.next-badge-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.badge-progress-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.badge-icon {
    font-size: 4rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.badge-info {
    flex: 1;
}

.badge-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 700;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.all-badges-unlocked {
    text-align: center;
    font-size: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
}

/* Badges Section */
.badges-section {
    margin-bottom: 2rem;
}

.badges-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

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

.badge-card {
    background: linear-gradient(135deg, #e0e0e0 0%, #b0b0b0 100%);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.badge-card.unlocked {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
}

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

.badge-card .badge-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.badge-card .badge-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

/* Achievements Section */
.achievements-section h3 {
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.achievement-count {
    font-size: 1rem;
    color: #667eea;
    font-weight: 600;
}

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

.achievement-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    background: #f5f5f5;
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #e3ffe7 0%, #d9e7ff 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.achievement-card.unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card-icon {
    font-size: 2.5rem;
    min-width: 50px;
    text-align: center;
}

.achievement-card-info {
    flex: 1;
}

.achievement-card-name {
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.achievement-card-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.achievement-card-stars {
    font-size: 1rem;
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.celebration-overlay.show {
    opacity: 1;
}

.celebration-content {
    text-align: center;
    color: white;
}

.celebration-emoji {
    font-size: 8rem;
    animation: celebrationBounce 0.6s ease-in-out;
}

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

.celebration-message {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-top: 1rem;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
}

.confetti.square {
    border-radius: 0;
}

.confetti.circle {
    border-radius: 50%;
}

.confetti.triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .achievement-popup {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .achievement-modal-content {
        margin: 10px;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .celebration-emoji {
        font-size: 5rem;
    }
    
    .celebration-message {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 1rem;
    }
    
    .badge-progress-card {
        flex-direction: column;
        text-align: center;
    }
}
