/* Gamification System Styles */

/* Notification System */
.gamification-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 350px;
    min-width: 300px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.gamification-notification.level_up {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gamification-notification.achievement {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gamification-notification.badge {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.notification-content {
    padding: 16px;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-message {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 500;
}

.notification-description {
    margin: 0 0 8px 0;
    font-size: 12px;
    opacity: 0.9;
}

.notification-reward {
    margin: 0;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* Player Stats */
.player-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.player-level {
    text-align: center;
    margin-bottom: 20px;
}

.level-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    margin-bottom: 10px;
}

.experience-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.experience-fill {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.experience-text {
    font-size: 12px;
    opacity: 0.9;
}

.player-currency {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
}

.player-achievements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.achievements-count,
.badges-count {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
}

/* Achievements List */
.achievements-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.achievements-list h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border-color: #43e97b;
}

.achievement-item.locked {
    background: #f8f9fa;
    color: #6c757d;
    opacity: 0.7;
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    font-size: 32px;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.achievement-description {
    margin: 0 0 8px 0;
    font-size: 14px;
    opacity: 0.9;
}

.achievement-reward {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.achievement-item.locked .achievement-reward {
    background: rgba(0, 0, 0, 0.1);
}

/* Rewards Shop */
.rewards-shop {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.shop-header h3 {
    margin: 0;
    color: #333;
}

.player-coins {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.coin-icon {
    margin-right: 5px;
    font-size: 18px;
}

.reward-category {
    margin-bottom: 30px;
}

.category-title {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    text-transform: capitalize;
}

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

.reward-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.2s;
    background: white;
}

.reward-item.unlocked {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border-color: #43e97b;
}

.reward-item.available {
    border-color: #007bff;
    background: #f8f9ff;
}

.reward-item.locked {
    opacity: 0.6;
    background: #f8f9fa;
}

.reward-item:hover:not(.locked) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.reward-icon {
    font-size: 28px;
    margin-right: 12px;
    min-width: 35px;
    text-align: center;
}

.reward-info {
    flex: 1;
}

.reward-name {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.reward-cost {
    font-size: 12px;
    opacity: 0.8;
}

.reward-buy-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}

.reward-buy-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.reward-buy-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Progress Indicators */
.progress-ring {
    width: 60px;
    height: 60px;
    position: relative;
    display: inline-block;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.progress-ring .background {
    stroke: #e9ecef;
}

.progress-ring .progress {
    stroke: #43e97b;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gamification-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
        transform: translateY(-100px);
    }
    
    .gamification-notification.show {
        transform: translateY(0);
    }
    
    .player-currency {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reward-items {
        grid-template-columns: 1fr;
    }
    
    .shop-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .player-achievements {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .player-stats {
        padding: 15px;
    }
    
    .achievements-list,
    .rewards-shop {
        padding: 15px;
    }
    
    .achievement-item,
    .reward-item {
        padding: 12px;
    }
    
    .achievement-icon,
    .reward-icon {
        font-size: 24px;
        margin-right: 10px;
    }
    
    .stat-item {
        padding: 10px;
    }
    
    .stat-icon {
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 16px;
    }
}

/* Animation Classes */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(67, 233, 123, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(67, 233, 123, 0.8);
    }
}

.bounce {
    animation: bounce 1s;
}

.pulse {
    animation: pulse 2s infinite;
}

.glow {
    animation: glow 2s infinite;
}

/* Special Effects */
.star-burst {
    position: relative;
    overflow: hidden;
}

.star-burst::before {
    content: '✨';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    animation: bounce 1s infinite;
}

.coin-flip {
    display: inline-block;
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% {
        transform: rotateY(0);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0);
    }
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}