/**
 * D&D AI RPG - Achievement System Styles
 * Achievements, progress tracking, and unlock notifications
 */

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.95) 0%, rgba(243, 156, 18, 0.95) 100%);
    border: 3px solid #f1c40f;
    border-radius: 12px;
    padding: 15px 25px;
    color: #1a1a2e;
    z-index: 5000;
    animation: achievementUnlock 0.5s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(241, 196, 15, 0.4);
    min-width: 300px;
    max-width: 500px;
}

@keyframes achievementUnlock {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5) translateY(-30px);
    }
    50% {
        transform: translateX(-50%) scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

.achievement-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px);
    transition: all 0.5s ease;
}

.achievement-notification .trophy-icon {
    font-size: 32px;
    animation: trophyBounce 0.5s ease 0.3s;
}

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

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

.achievement-notification .achievement-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.achievement-notification .achievement-desc {
    font-size: 13px;
    opacity: 0.8;
}

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

/* Achievement Panel - supports both singular and plural class names */
.achievement-panel,
.achievements-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3400;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.achievement-content,
.achievements-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #f1c40f;
    border-radius: 15px;
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.achievement-header,
.achievements-header {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.achievement-header h2,
.achievements-header h2 {
    margin: 0;
    color: #1a1a2e;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.achievements-summary {
    display: flex;
    gap: 15px;
    align-items: center;
}

.unlocked-count {
    font-weight: bold;
    color: #1a1a2e;
    font-size: 14px;
}

.total-points {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    color: #1a1a2e;
    font-size: 13px;
}

.achievement-header .close-btn,
.achievements-header .close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #1a1a2e;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.achievement-header .close-btn:hover,
.achievements-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

.achievement-stats {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid rgba(241, 196, 15, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #f1c40f;
}

.stat-label {
    font-size: 12px;
    color: #95a5a6;
    text-transform: uppercase;
}

.achievement-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px 0;
    gap: 5px;
    overflow-x: auto;
}

.achievement-tab {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px 8px 0 0;
    color: #95a5a6;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 13px;
}

.achievement-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.achievement-tab.active {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    border-bottom: 2px solid #f1c40f;
}

.achievement-body,
.achievements-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

/* Achievement Category */
.achievement-category {
    margin-bottom: 25px;
}

.achievement-category h3 {
    color: #f39c12;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(243, 156, 18, 0.3);
}

/* Achievement Grid */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 15px;
    transition: all 0.3s;
}

.achievement-card.unlocked {
    border-color: rgba(241, 196, 15, 0.5);
    background: rgba(241, 196, 15, 0.1);
}

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

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.achievement-icon,
.achievement-card-icon {
    font-size: 36px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    flex-shrink: 0;
}

.achievement-card.locked .achievement-icon,
.achievement-card.locked .achievement-card-icon {
    filter: grayscale(1);
}

.achievement-details,
.achievement-card-info {
    flex: 1;
    min-width: 0;
}

.achievement-name,
.achievement-card-name {
    font-size: 15px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 4px;
}

.achievement-card.unlocked .achievement-name,
.achievement-card.unlocked .achievement-card-name {
    color: #f1c40f;
}

.achievement-description,
.achievement-card-desc {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.achievement-progress-container,
.achievement-progress {
    margin-bottom: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.achievement-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.achievement-progress-text {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 3px;
    text-align: right;
}

.achievement-rewards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.achievement-reward-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border-radius: 4px;
}

.achievement-card.unlocked .achievement-reward-tag {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.achievement-unlock-date {
    font-size: 10px;
    color: #7f8c8d;
    margin-top: 6px;
}

/* Category Icons */
.category-combat .achievement-icon { background: rgba(231, 76, 60, 0.2); }
.category-exploration .achievement-icon { background: rgba(52, 152, 219, 0.2); }
.category-quests .achievement-icon { background: rgba(155, 89, 182, 0.2); }
.category-social .achievement-icon { background: rgba(46, 204, 113, 0.2); }
.category-wealth .achievement-icon { background: rgba(241, 196, 15, 0.2); }
.category-magic .achievement-icon { background: rgba(142, 68, 173, 0.2); }
.category-progression .achievement-icon { background: rgba(26, 188, 156, 0.2); }

/* Rarity indicators */
.achievement-card.rarity-legendary {
    border-color: rgba(255, 165, 0, 0.5);
}

.achievement-card.rarity-legendary .achievement-icon {
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.3);
}

.achievement-card.rarity-epic {
    border-color: rgba(155, 89, 182, 0.5);
}

/* Points display */
.achievement-points,
.achievement-card-points {
    font-size: 12px;
    font-weight: bold;
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .achievement-content {
        max-width: 98%;
    }

    .achievement-grid {
        grid-template-columns: 1fr;
    }

    .achievement-tabs {
        padding: 5px 10px 0;
    }

    .achievement-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .achievement-stats {
        flex-wrap: wrap;
        gap: 15px;
    }
}
