/**
 * ========================================
 * Estilos del Sistema de Logros
 * ========================================
 */

/* ==================== NOTIFICACIÓN DE LOGRO ==================== */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    width: 350px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.achievement-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffd700);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.achievement-notification.show {
    right: 20px;
}

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

.achievement-icon {
    font-size: 48px;
    flex-shrink: 0;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(0.9) rotate(5deg); }
}

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

.achievement-unlock-text {
    color: #ffd700;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.achievement-name {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.achievement-desc {
    color: #b0b0b0;
    font-size: 13px;
    line-height: 1.4;
}

/* ==================== MODAL DE LOGROS ==================== */
.achievements-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    overflow-y: auto;
    backdrop-filter: blur(5px);
}

.achievements-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.achievements-container {
    width: 100%;
    max-width: 900px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 32px;
    position: relative;
    animation: slideDown 0.4s ease;
}

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

.achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.achievements-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.achievements-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

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

.achievements-progress {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.progress-text {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

.progress-bar {
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 12px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 14px;
}

.achievements-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border-color: #ffd700;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.achievement-card:hover::before {
    opacity: 1;
}

.achievement-card.unlocked {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
}

.achievement-card.unlocked::before {
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffd700);
    opacity: 1;
}

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

.achievement-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.achievement-card-icon {
    font-size: 40px;
    flex-shrink: 0;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s;
}

.achievement-card.unlocked .achievement-card-icon {
    filter: grayscale(0%);
    opacity: 1;
    animation: iconPop 0.5s ease;
}

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

.achievement-card-title {
    flex: 1;
    min-width: 0;
}

.achievement-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-badge {
    font-size: 18px;
    flex-shrink: 0;
}

.achievement-card-game {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-card-description {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.achievement-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.achievement-difficulty {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.achievement-difficulty.easy {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.achievement-difficulty.medium {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.achievement-difficulty.hard {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.achievement-date {
    font-size: 11px;
    color: #666;
}

.achievement-card.unlocked .achievement-date {
    color: #ffd700;
}

.lock-icon {
    font-size: 20px;
    opacity: 0.3;
}

/* ==================== BOTÓN DE LOGROS EN JUEGOS ==================== */
.achievements-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievements-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.achievements-button:active {
    transform: scale(0.95);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .achievement-notification {
        width: calc(100% - 40px);
        right: -100%;
    }

    .achievement-notification.show {
        right: 20px;
    }

    .achievements-container {
        padding: 24px 16px;
    }

    .achievements-title {
        font-size: 22px;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .achievement-card-icon {
        font-size: 32px;
    }

    .achievement-card-name {
        font-size: 14px;
    }

    .achievements-button {
        width: 48px;
        height: 48px;
        font-size: 24px;
        bottom: 16px;
        right: 16px;
    }
}

/* ==================== ANIMACIONES ADICIONALES ==================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.achievement-card.just-unlocked {
    animation: pulse 0.6s ease;
    border-color: #ffd700;
}

/* ==================== STATS DISPLAY ==================== */
.achievements-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== SECCIONES DE LOGROS POR JUEGO ==================== */
.game-achievements-section {
    margin-bottom: 32px;
}

.game-achievements-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.game-progress {
    font-size: 16px;
    color: #ffd700;
    font-weight: 600;
    background: rgba(255, 215, 0, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}
