/* Achievement Badges System Styles */

.achievement-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.achievement-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.achievement-icon {
    font-size: 1.2rem;
}

.achievement-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.achievement-count {
    font-weight: 700;
    font-size: 1rem;
}

.achievement-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.new-achievements {
    background: #f39c12;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

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

/* Achievement Modal */
.achievement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.achievement-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

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

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.achievement-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    flex: 1;
    transition: transform 0.2s ease;
}

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

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.achievement-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 16px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.category-tab:hover {
    background: #e9ecef;
}

.category-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.category-icon {
    font-size: 1rem;
}

.category-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.category-count {
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.category-tab.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.achievement-item.locked {
    opacity: 0.6;
    background: #f1f3f4;
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.rarity-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

/* Rarity levels */
.achievement-item.common .rarity-indicator { background-color: #95a5a6; }
.achievement-item.uncommon .rarity-indicator { background-color: #27ae60; }
.achievement-item.rare .rarity-indicator { background-color: #3498db; }
.achievement-item.epic .rarity-indicator { background-color: #9b59b6; }
.achievement-item.legendary .rarity-indicator { background-color: #f39c12; }

.achievement-icon {
    font-size: 2rem;
    margin-right: 16px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.achievement-item.locked .achievement-icon {
    background: #e9ecef;
    color: #95a5a6;
}

.achievement-details {
    flex: 1;
    margin-right: 16px;
}

.achievement-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 1rem;
}

.achievement-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.achievement-requirements {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.achievement-reward {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.points {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status {
    background: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Achievement Notifications */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #f39c12;
    z-index: 1001;
    animation: slideInRight 0.5s ease-out;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.achievement-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.badge-info {
    flex: 1;
}

.badge-name {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.badge-title {
    font-weight: 600;
    color: #f39c12;
    margin-bottom: 2px;
}

.badge-points {
    color: #666;
    font-size: 0.9rem;
}

/* Badge Grid View */
.badge-grid {
    margin-top: 24px;
}

.badge-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.badge-grid-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
}

.badge-progress {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.badge-item.locked {
    opacity: 0.6;
    background: #f1f3f4;
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-item.locked .badge-icon {
    background: #e9ecef;
    color: #95a5a6;
}

.badge-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.badge-rarity {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 8px;
}

.badge-points {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .achievement-modal .modal-content {
        width: 95%;
        margin: 20px;
    }

    .achievement-stats {
        flex-direction: column;
        gap: 12px;
    }

    .achievement-categories {
        flex-direction: column;
        gap: 8px;
    }

    .category-tab {
        justify-content: space-between;
    }

    .achievement-list {
        gap: 8px;
    }

    .achievement-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .achievement-details {
        margin-right: 0;
        margin-bottom: 12px;
    }

    .achievement-reward {
        align-items: flex-start;
        width: 100%;
    }

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

    .achievement-notification {
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .achievement-grid {
        grid-template-columns: 1fr;
    }

    .badge-icon {
        font-size: 1.5rem;
        width: 48px;
        height: 48px;
    }

    .achievement-name {
        font-size: 0.8rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .achievement-indicator,
    .achievement-item,
    .badge-item,
    .achievement-notification,
    .modal-content {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .achievement-item,
    .badge-item {
        border: 2px solid #000;
    }

    .achievement-indicator {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .achievement-indicator,
    .achievement-modal,
    .achievement-notification {
        display: none;
    }

    .badge-item {
        break-inside: avoid;
        border: 1px solid #000;
    }
}